# HG changeset patch # User trinity_ctat # Date 1525092403 14400 # Node ID 772b977ac9a1683b9b3c3a164aa8751e9ca44989 # Parent 8f5e700757f36f70fa2455cf99f878f9a90a7166 Uploaded diff -r 8f5e700757f3 -r 772b977ac9a1 data_manager/add_ctat_centrifuge_index.py --- a/data_manager/add_ctat_centrifuge_index.py Fri Apr 27 10:29:42 2018 -0400 +++ b/data_manager/add_ctat_centrifuge_index.py Mon Apr 30 08:46:43 2018 -0400 @@ -300,9 +300,16 @@ print "\nThe location of the Centrifuge Index is {:s}.\n".format(index_directory) files_in_index_directory = set(os.listdir(index_directory)) index_file_found = False + index_file_path = index_directory for filename in files_in_index_directory: + # The current index is split into 3 files. + # filenames are in the form: index_root_name.#.cf, + # where # is a numeral (1, 2, or 3) + # indicating the order of the files. if filename.split(".")[-1] == _CentrifugeIndexFileExtension: index_file_found = True + # The centrifuge program wants the root name of the files to be final part of the path. + index_file_path = "{:s}/{:s}".format(index_directory, filename.split(".")[0]) if not index_file_found: raise ValueError("Cannot find any Centrifuge Index files.\n" + \ "The contents of the directory {:s} are:\n\t".format(index_directory) + \ @@ -329,12 +336,12 @@ print "The Index's display_name will be set to: {:s}\n".format(display_name) print "Its unique_id will be set to: {:s}\n".format(unique_id) - print "Its dir_path will be set to: {:s}\n".format(index_directory) + print "Its dir_path will be set to: {:s}\n".format(index_file_path) data_manager_dict = {} data_manager_dict['data_tables'] = {} data_manager_dict['data_tables'][_CTAT_CentrifugeIndexTableName] = [] - data_table_entry = dict(value=unique_id, name=display_name, path=index_directory) + data_table_entry = dict(value=unique_id, name=display_name, path=index_file_path) data_manager_dict['data_tables'][_CTAT_CentrifugeIndexTableName].append(data_table_entry) # Temporarily the output file's dictionary is written for debugging: