Mercurial > repos > trinity_ctat > ctat_genome_resource_libs_data_manager_3
changeset 52:0e3e4f24e300 draft
Adding ctat_cravat_tissues table.
| author | trinity_ctat |
|---|---|
| date | Tue, 06 Nov 2018 11:53:38 -0500 |
| parents | 0a4bec29a609 |
| children | 9fdaeb356e22 |
| files | data_manager/add_ctat_resource_lib.py data_manager/add_ctat_resource_lib.xml data_manager_conf.xml tool-data/cravat_tissues.loc.sample tool-data/ctat_cravat_tissues.loc.sample tool_data_table_conf.xml.sample |
| diffstat | 6 files changed, 68 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/data_manager/add_ctat_resource_lib.py Fri Nov 02 14:17:08 2018 -0400 +++ b/data_manager/add_ctat_resource_lib.py Tue Nov 06 11:53:38 2018 -0500 @@ -1324,6 +1324,12 @@ 'Normally they are assumed to reside in the build directory, ' + \ 'but if that directory has not been created yet when this program ' + \ 'is called, you can specify the full path to the directory where they reside.') + parser.add_argument('-t', '--cravat_tissues_filepath', + default='', \ + help='Specify a non-default location where the Cosmic files reside. ' + \ + 'Normally they are assumed to reside in the build directory, ' + \ + 'but if that directory has not been created yet when this program ' + \ + 'is called, you can specify the full path to the directory where they reside.') # Method 1) arguments - Download and Build. # - One can optionally utilize --build_location argument with this group of arguments. download_and_build_args = parser.add_argument_group('Download and Build arguments') @@ -1546,6 +1552,17 @@ data_manager_dict['data_tables']['ctat_genome_resource_libs'] = [] data_table_entry = dict(value=unique_id, name=display_name, path=genome_build_directory) data_manager_dict['data_tables']['ctat_genome_resource_libs'].append(data_table_entry) + + # Create the data table for the cravat_tissues, if the file is given: + if (args.cravat_tissues_filepath is not None) and (args.cravat_tissues_filepath != ""): + data_manager_dict['data_tables']['ctat_cravat_tissues'] = [] + cravat_file = open(args.cravat_tissues_filepath, 'r') + for line in cravat_file: + if line[0] != '#': + # The line is not a comment, so parse it. + items = [item.strip() for item in line.split("\t")] + data_table_entry = dict(value=items[0], name=items[1], code=items[2], date=items[3]) + data_manager_dict['data_tables']['ctat_cravat_tissues'].append(data_table_entry) # Temporarily the output file's dictionary is written for debugging: print "The dictionary for the output file is:\n\t{:s}".format(str(data_manager_dict))
--- a/data_manager/add_ctat_resource_lib.xml Fri Nov 02 14:17:08 2018 -0400 +++ b/data_manager/add_ctat_resource_lib.xml Tue Nov 06 11:53:38 2018 -0500 @@ -14,7 +14,8 @@ <