Mercurial > repos > ieguinoa > ena_upload
changeset 14:436da36c6114 draft
Uploaded
author | ieguinoa |
---|---|
date | Tue, 22 Sep 2020 20:36:41 +0000 |
parents | 91a3a617d94b |
children | d85e35a36715 |
files | ena_upload.xml extract_tables.py tool-data/geographic_location_1.loc.sample tool-data/host_health_state_1.loc.sample tool-data/host_sex_1.loc.sample |
diffstat | 5 files changed, 308 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/ena_upload.xml Fri Sep 18 14:29:47 2020 +0000 +++ b/ena_upload.xml Tue Sep 22 20:36:41 2020 +0000 @@ -1,6 +1,6 @@ <tool id="ena_upload" name="ENA Upload tool" version="0.1.0" python_template_version="3.5"> <macros> - <token name="@VERSION@">0.1.7</token> + <token name="@VERSION@">0.1.8</token> </macros> <requirements> <requirement type="package" version="@VERSION@">ena-upload-cli</requirement> @@ -69,6 +69,9 @@ --study $action_options.input_format_conditional.studies_users_table --run $action_options.input_format_conditional.runs_users_table --sample $action_options.input_format_conditional.samples_users_table + #if $action_options.input_format_conditional.viral_submission == "true": + --vir + #end if #else: --experiment $experiments_table_path --study $studies_table_path @@ -101,7 +104,7 @@ #end for $runs.append($run_files) #end for - $experiments.append({'title':str($experiment.experiment_title),'experiment_design':str($experiment.experiment_design),'library_strategy':str($experiment.library_strategy),'library_source':str($experiment.library_source),'library_selection':str($experiment.library_selection),'library_layout':str($experiment.library_layout),'insert_size':str($experiment.insert_size),'library_construction_protocol':str($experiment.library_construction_protocol),'platform':str($experiment.platform),'instrument_model':str($experiment.instrument_model),'runs':$runs}) + $experiments.append({'title':str($experiment.experiment_title),'experiment_design':str($experiment.experiment_design),'library_strategy':str($experiment.library_strategy),'library_source':str($experiment.library_source),'library_selection':str($experiment.library_strategy),'library_layout':str($experiment.library_layout),'insert_size':str($experiment.insert_size),'library_construction_protocol':str($experiment.library_construction_protocol),'platform':str($experiment.platform),'instrument_model':str($experiment.instrument_model),'runs':$runs}) #end for $samples.append({'title':str($sample.sample_title),'description':str($sample.sample_description),'tax_name':str($sample.scientific_name),'tax_id':str($sample.tax_id),'experiments':$experiments}) #end for @@ -125,6 +128,7 @@ <option value="build_tables" selected="False">Interactive generation of studies structure from dataset</option> </param> <when value="user_generated_tables"> + <param name="viral_submission" type="boolean" label="Does your submission data belong to a viral sample?" help="If you select yes then your data will be submitted using the ENA virus pathogen reporting standard checklist (see: https://ena-browser-docs.readthedocs.io/en/latest/help_and_guides/sars-cov-2-submissions.html)" /> <param name="data" type="data" format="fastqsanger.gz,fastqsanger.bz2,fastq.gz,fastq.bz2" multiple="true" label="Select all datasets to upload" help="Compressed reads files listed in the runs table"/> <param name="studies_users_table" type="data" format="tabular" multiple="false" label="Studies table" help="Studies metadata file"/> <param name="samples_users_table" type="data" format="tabular" multiple="false" label="Samples table" help="Samples metadata file"/> @@ -137,7 +141,7 @@ <param name="study_title" type="text" optional="False" label="Please provide a short descriptive title for the study"/> <param name="study_abstract" type="text" optional="True" label="Please provide an abstract to describe the study in detail"/> <param name="study_type" type="select" label="Please select the type of study"> - <options from_data_table="study_type"> + <options from_file="study_type.txt"> <column name="value" index="0"/> </options> </param> @@ -151,22 +155,22 @@ <param name="experiment_title" type="text" label="Specify an experiment title" /> <param name="experiment_design" type="text" label="Describe the experiment design" /> <param name="library_strategy" type="select" label="Library strategy" help="The library strategy specifies the sequencing technique intended for this library"> - <options from_data_table="library_strategy"> + <options from_file="library_strategy.txt"> <column name="value" index="0"/> </options> </param> <param name="library_source" type="select" label="Select library source" help="The library source specifies the type of source material that is being sequenced"> - <options from_data_table="library_source"> + <options from_file="library_source.txt"> <column name="value" index="0"/> </options> </param> <param name="library_selection" type="select" label="Library selection" help="The library selection specifies whether any method was used to select for or against, enrich, or screen the material being sequenced"> - <options from_data_table="library_selection"> + <options from_file="library_selection.txt"> <column name="value" index="0"/> </options> </param> <param name="library_layout" type="select" label="Library layout"> - <options from_data_table="library_layout"> + <options from_file="library_layout.txt"> <column name="value" index="0"/> </options> </param> @@ -185,7 +189,7 @@ <option value="CAPILLARY">Capillary sequencing</option> </param> <param name="instrument_model" type="select" label="Instrument model"> - <options from_data_table="instrument_model"> + <options from_file="instrument_model.txt"> <column name="value" index="0"/> </options> </param>
--- a/extract_tables.py Fri Sep 18 14:29:47 2020 +0000 +++ b/extract_tables.py Tue Sep 22 20:36:41 2020 +0000 @@ -34,14 +34,14 @@ for exp_index,exp in enumerate(sample['experiments']): exp_alias = 'experiment_'+str(exp_index)+'_'+str(sample_index) lib_alias = 'library_'+str(exp_index)+'_'+str(sample_index) - experiments_table.write('\t'.join([exp_alias,action,'accession_ena',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') + experiments_table.write('\t'.join([exp_alias,action,'accession_ena',exp['title'],study_alias,sample_alias,exp['experiment_design'],lib_alias,exp['library_strategy'],exp['library_source'],exp['library_selection'],exp['library_layout'],exp['insert_size'],exp['library_construction_protocol'],exp['platform'],exp['instrument_model'],'submission_date_ENA']) + '\n') run_index = 0 # exp['runs'] is a list of lists for run in exp['runs']: run_index += 1 run_alias = '_'.join(['run',str(exp_index),str(sample_index),str(run_index)]) for file_entry in run: - file_format = 'fastq' + file_format = 'fastq.gz' if os.path.splitext(file_entry)[-1] == '.gz' else 'fastq.bz2' runs_table.write('\t'.join([run_alias,action,'ena_run_accession',exp_alias,file_entry,file_format,'file_checksum','submission_date_ENA']) + '\n') studies_table.close()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/geographic_location_1.loc.sample Tue Sep 22 20:36:41 2020 +0000 @@ -0,0 +1,279 @@ +not applicable +not collected +not provided +restricted access +Afghanistan +Albania +Algeria +American Samoa +Andorra +Angola +Anguilla +Antarctica +Antigua and Barbuda +Arctic Ocean +Argentina +Armenia +Aruba +Ashmore and Cartier Islands +Atlantic Ocean +Australia +Austria +Azerbaijan +Bahamas +Bahrain +Baker Island +Baltic Sea +Bangladesh +Barbados +Bassas da India +Belarus +Belgium +Belize +Benin +Bermuda +Bhutan +Bolivia +Borneo +Bosnia and Herzegovina +Botswana +Bouvet Island +Brazil +British Virgin Islands +Brunei +Bulgaria +Burkina Faso +Burundi +Cambodia +Cameroon +Canada +Cape Verde +Cayman Islands +Central African Republic +Chad +Chile +China +Christmas Island +Clipperton Island +Cocos Islands +Colombia +Comoros +Cook Islands +Coral Sea Islands +Costa Rica +Cote d'Ivoire +Croatia +Cuba +Curacao +Cyprus +Czech Republic +Democratic Republic of the Congo +Denmark +Djibouti +Dominica +Dominican Republic +East Timor +Ecuador +Egypt +El Salvador +Equatorial Guinea +Eritrea +Estonia +Ethiopia +Europa Island +Falkland Islands (Islas Malvinas) +Faroe Islands +Fiji +Finland +France +French Guiana +French Polynesia +French Southern and Antarctic Lands +Gabon +Gambia +Gaza Strip +Georgia +Germany +Ghana +Gibraltar +Glorioso Islands +Greece +Greenland +Grenada +Guadeloupe +Guam +Guatemala +Guernsey +Guinea +Guinea-Bissau +Guyana +Haiti +Heard Island and McDonald Islands +Honduras +Hong Kong +Howland Island +Hungary +Iceland +India +Indian Ocean +Indonesia +Iran +Iraq +Ireland +Isle of Man +Israel +Italy +Jamaica +Jan Mayen +Japan +Jarvis Island +Jersey +Johnston Atoll +Jordan +Juan de Nova Island +Kazakhstan +Kenya +Kerguelen Archipelago +Kingman Reef +Kiribati +Kosovo +Kuwait +Kyrgyzstan +Laos +Latvia +Lebanon +Lesotho +Liberia +Libya +Liechtenstein +Lithuania +Luxembourg +Macau +Macedonia +Madagascar +Malawi +Malaysia +Maldives +Mali +Malta +Marshall Islands +Martinique +Mauritania +Mauritius +Mayotte +Mediterranean Sea +Mexico +Micronesia +Midway Islands +Moldova +Monaco +Mongolia +Montenegro +Montserrat +Morocco +Mozambique +Myanmar +Namibia +Nauru +Navassa Island +Nepal +Netherlands +New Caledonia +New Zealand +Nicaragua +Niger +Nigeria +Niue +Norfolk Island +North Korea +North Sea +Northern Mariana Islands +Norway +Oman +Pacific Ocean +Pakistan +Palau +Palmyra Atoll +Panama +Papua New Guinea +Paracel Islands +Paraguay +Peru +Philippines +Pitcairn Islands +Poland +Portugal +Puerto Rico +Qatar +Republic of the Congo +Reunion +Romania +Ross Sea +Russia +Rwanda +Saint Helena +Saint Kitts and Nevis +Saint Lucia +Saint Pierre and Miquelon +Saint Vincent and the Grenadines +Samoa +San Marino +Sao Tome and Principe +Saudi Arabia +Senegal +Serbia +Seychelles +Sierra Leone +Singapore +Sint Maarten +Slovakia +Slovenia +Solomon Islands +Somalia +South Africa +South Georgia and the South Sandwich Islands +South Korea +Southern Ocean +Spain +Spratly Islands +Sri Lanka +Sudan +Suriname +Svalbard +Swaziland +Sweden +Switzerland +Syria +Taiwan +Tajikistan +Tanzania +Tasman Sea +Thailand +Togo +Tokelau +Tonga +Trinidad and Tobago +Tromelin Island +Tunisia +Turkey +Turkmenistan +Turks and Caicos Islands +Tuvalu +USA +Uganda +Ukraine +United Arab Emirates +United Kingdom +Uruguay +Uzbekistan +Vanuatu +Venezuela +Viet Nam +Virgin Islands +Wake Island +Wallis and Futuna +West Bank +Western Sahara +Yemen +Zambia +Zimbabwe