Previous changeset 8:d147d6455873 (2022-05-04) Next changeset 10:480d9e9d156b (2023-10-27) |
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ena_upload commit 6770d277b4136b4068293c4260022d4ae33b2379 |
modified:
ena_upload.xml extract_tables.py |
b |
diff -r d147d6455873 -r a62c4a11a67d ena_upload.xml --- a/ena_upload.xml Wed May 04 17:06:42 2022 +0000 +++ b/ena_upload.xml Thu Nov 10 15:18:00 2022 +0000 |
b |
@@ -1,6 +1,6 @@ <tool id="ena_upload" name="ENA Upload tool" version="@VERSION@" profile="20.01" license="MIT"> <macros> - <token name="@VERSION@">0.6.0</token> + <token name="@VERSION@">0.6.1</token> <import>samples_macros.xml</import> </macros> <requirements> @@ -640,7 +640,7 @@ <assert_contents> <has_n_lines n="2"/> <has_n_columns n="8"/> - <has_line_matching expression="alias\tstatus\taccession\ttitle\tstudy_type\tstudy_abstract\tpubmed_id\tsubmission_date"/> + <has_line_matching expression="alias\tstatus\ttitle\tstudy_type\tstudy_abstract\tpubmed_id\taccession\tsubmission_date"/> </assert_contents> </output> <output name="samples_table_out"> @@ -653,7 +653,7 @@ <assert_contents> <has_n_lines n="3"/> <has_n_columns n="8"/> - <has_line_matching expression="alias\tstatus\taccession\texperiment_alias\tfile_name\tfile_format\tfile_checksum\tsubmission_date"/> + <has_line_matching expression="alias\tstatus\texperiment_alias\tfile_name\tfile_format\taccession\tsubmission_date\tfile_checksum"/> </assert_contents> </output> </test> |
b |
diff -r d147d6455873 -r a62c4a11a67d extract_tables.py --- a/extract_tables.py Wed May 04 17:06:42 2022 +0000 +++ b/extract_tables.py Thu Nov 10 15:18:00 2022 +0000 |
[ |
@@ -19,19 +19,19 @@ with open(args.studies_json_path, 'r') as studies_json_file: studies_dict = json.load(studies_json_file) studies_table = open(pathlib.Path(args.out_path) / 'studies.tsv', 'w') -studies_table.write('\t'.join(['alias', 'status', 'accession', 'title', 'study_type', - 'study_abstract', 'pubmed_id', 'submission_date']) + '\n') +studies_table.write('\t'.join(['alias', 'status', 'title', 'study_type', + 'study_abstract', 'pubmed_id']) + '\n') samples_table = open(pathlib.Path(args.out_path) / 'samples.tsv', 'w') experiments_table = open(pathlib.Path(args.out_path) / 'experiments.tsv', 'w') -experiments_table.write('\t'.join(['alias', 'status', 'accession', 'title', 'study_alias', +experiments_table.write('\t'.join(['alias', 'status', 'title', 'study_alias', 'sample_alias', 'design_description', 'library_name', 'library_strategy', 'library_source', 'library_selection', 'library_layout', 'insert_size', 'library_construction_protocol', 'platform', 'instrument_model', - 'submission_date']) + '\n') + ]) + '\n') runs_table = open(pathlib.Path(args.out_path) / 'runs.tsv', 'w') -runs_table.write('\t'.join(['alias', 'status', 'accession', 'experiment_alias', 'file_name', - 'file_format', 'file_checksum', 'submission_date']) + '\n') +runs_table.write('\t'.join(['alias', 'status', 'experiment_alias', 'file_name', + 'file_format']) + '\n') action = args.action @@ -39,25 +39,25 @@ timestamp = dt_oobj.strftime("%Y%m%d_%H:%M:%S") for study_index, study in enumerate(studies_dict): study_alias = 'study_' + str(study_index) + '_' + timestamp - studies_table.write('\t'.join([study_alias, action, 'ENA_accession', study['title'], + studies_table.write('\t'.join([study_alias, action, study['title'], study['type'], study['abstract'], study['pubmed_id'], - 'ENA_submission_data'])) + ])) if "geo_location" in study['samples'][0].keys(): # sample belongs to a viral sample - samples_table.write('\t'.join(['alias', 'status', 'accession', 'title', 'scientific_name', + samples_table.write('\t'.join(['alias', 'status', 'title', 'scientific_name', 'taxon_id', 'sample_description', 'collection date', 'geographic location (country and/or sea)', 'host common name', 'host subject id', 'host health state', 'host sex', 'host scientific name', 'collector name', 'collecting institution', 'isolate', - 'submission_date']) + '\n') + ]) + '\n') else: - samples_table.write('\t'.join(['alias', 'status', 'accession', 'title', 'scientific_name', - 'taxon_id', 'sample_description', 'submission_date']) + '\n') + samples_table.write('\t'.join(['alias', 'status', 'title', 'scientific_name', + 'taxon_id', 'sample_description']) + '\n') for sample_index, sample in enumerate(study['samples']): sample_alias = 'sample_' + str(sample_index) + '_' + timestamp if "geo_location" in sample.keys(): # sample belongs to a viral sample if sample['collector_name'] == '': sample['collector_name'] = 'unknown' - samples_table.write('\t'.join([sample_alias, action, 'ena_accession', sample['title'], + samples_table.write('\t'.join([sample_alias, action, sample['title'], sample['tax_name'], sample['tax_id'], sample['description'], sample['collection_date'], sample['geo_location'], sample['host_common_name'], @@ -65,22 +65,22 @@ sample['host_sex'], sample['host_scientific_name'], sample['collector_name'], sample['collecting_institution'], sample['isolate'], - 'ENA_submission_date']) + '\n') + ]) + '\n') else: - samples_table.write('\t'.join([sample_alias, action, 'ena_accession', sample['title'], + samples_table.write('\t'.join([sample_alias, action, sample['title'], sample['tax_name'], sample['tax_id'], - sample['description'], 'ENA_submission_date']) + '\n') + sample['description']]) + '\n') for exp_index, exp in enumerate(sample['experiments']): exp_alias = 'experiment_' + str(exp_index) + '.' + str(sample_index) + '_' + timestamp lib_alias = 'library_' + str(exp_index) + '_' + str(sample_index) - experiments_table.write('\t'.join([exp_alias, action, 'accession_ena', exp['title'], + experiments_table.write('\t'.join([exp_alias, action, exp['title'], study_alias, sample_alias, exp['experiment_design'], lib_alias, exp['library_strategy'], exp['library_source'], exp['library_selection'], exp['library_layout'].lower(), exp['insert_size'], exp['library_construction_protocol'], exp['platform'], exp['instrument_model'], - 'submission_date_ENA']) + '\n') + ]) + '\n') run_index = 0 # exp['runs'] is a list of lists for (base_run, run_files) in exp['runs']: @@ -92,9 +92,8 @@ run_alias = '_'.join(['run_' + str(run_index), str(exp_index), str(sample_index)]) + '_' + timestamp for file_entry in run_files: - runs_table.write('\t'.join([run_alias, action, 'ena_run_accession', exp_alias, - file_entry, FILE_FORMAT, 'file_checksum', - 'submission_date_ENA']) + '\n') + runs_table.write('\t'.join([run_alias, action, exp_alias, + file_entry, FILE_FORMAT]) + '\n') studies_table.close() samples_table.close() |