Repository 'ena_webin_cli'
hg clone https://toolshed.g2.bx.psu.edu/repos/ieguinoa/ena_webin_cli

Changeset 2:1ecd8ce07db4 (2022-02-04)
Previous changeset 1:f24eb2f2cb0c (2021-05-18) Next changeset 3:7d751b5943b0 (2022-02-22)
Commit message:
Uploaded
modified:
ena_consensus_submit.xml
added:
test-data/phiX2.fasta
b
diff -r f24eb2f2cb0c -r 1ecd8ce07db4 ena_consensus_submit.xml
--- a/ena_consensus_submit.xml Tue May 18 21:00:09 2021 +0000
+++ b/ena_consensus_submit.xml Fri Feb 04 15:52:45 2022 +0000
[
b'@@ -1,6 +1,6 @@\n-<tool id="ena_consensus_submit" name="Submit consensus sequence to ENA" version="0.1.0" python_template_version="3.5">\n+<tool id="ena_consensus_submit" name="Submit consensus sequence to ENA" version="@VERSION@" python_template_version="3.5">\n     <macros>\n-        <token name="@VERSION@">3.7.0</token>\n+        <token name="@VERSION@">4.3.0</token>\n     </macros>\n     <requirements>\n         <requirement type="package" version="@VERSION@">ena-webin-cli</requirement>\n@@ -8,16 +8,22 @@\n         <requirement type="package" version="5.3">pyyaml</requirement>\n     </requirements>\n     <command detect_errors="exit_code"><![CDATA[\n+#if $test_submit == "True":\n+    #set $credentials=\'./test_fake_path\';\n+    touch $credentials;\n+    echo "username:test_user" >> $credentials;\n+    echo "password:test_password" >> $credentials;\n+#end if\n \n-webin_id=`grep \'username\' $credentials | cut -f2,2`;\n+webin_id=`grep \'username\' $credentials | cut -d\':\' -f2,2`;\n if [ "\\$webin_id" = "" ]; then\n   ## No credentials in user defined preferences    \n   ## Fallback to global defined credentials (if exist)   \n   #import os\n   #if os.path.isfile(os.environ.get(\'GALAXY_ENA_SECRETS\', \'\')):\n       credentials_path=\\${GALAXY_ENA_SECRETS};     \n-      webin_id=`grep \'username\' \\$GALAXY_ENA_SECRETS | cut -d\' \' -f2,2`;\n-      password=`grep \'password\' \\$GALAXY_ENA_SECRETS | cut -d\' \' -f2,2`;\n+      webin_id=`grep \'username\' \\$GALAXY_ENA_SECRETS | cut -d\':\' -f2,2` | sed -e \'s/^[[:space:]]*//\'`;\n+      password=`grep \'password\' \\$GALAXY_ENA_SECRETS | cut -d\':\' -f2,2` | sed -e \'s/^[[:space:]]*//\'`;\n       if [ "\\$webin_id" = "" ]; then\n           echo "No global credentials defined. Check your GALAXY_ENA_SECRETS file or set your credentials via: User -> Preferences -> Manage Information";\n           exit 1;\n@@ -27,23 +33,22 @@\n       exit 1;\n   #end if\n else\n-  password=`grep \'password\' $credentials | cut -f2,2`;\n+  password=`grep \'password\' $credentials | cut -d\':\' -f2,2`;\n fi;\n \n-## if it is still running at this point then the webin_id and password are set\n \n-## create a manifaste base file with the parameters that are identical for all sequences that will be submited (if submitting a multifasta)\n+## create a manifest base file with the parameters that are identical for all sequences that will be submited (if submitting a multifasta)\n #set $manifest_base = \'manifest_base.tab\'\n mkdir manifests;\n mkdir fasta;\n \n-echo -e "ASSEMBLY_TYPE\\t$assembly_type" >> $manifest_base;\n-echo -e "COVERAGE\\t$coverage" >> $manifest_base;\n-echo -e "PROGRAM\\t$assembly_program" >> $manifest_base;\n+echo -e \'ASSEMBLY_TYPE\\t$assembly_type\' > $manifest_base;\n+echo -e \'COVERAGE\\t$coverage\' >> $manifest_base;\n+echo -e \'PROGRAM\\t$assembly_program\' >> $manifest_base;\n #if $min_gap_length:\n-    echo -e "MINGAPLENGTH\\t$min_gap_length" >> $manifest_base;\n+    echo -e \'MINGAPLENGTH\\t$min_gap_length\' >> $manifest_base;\n #end if\n-echo -e "MOLECULETYPE\\t$molecule_type" >> $manifest_base;\n+echo -e \'MOLECULETYPE\\t$molecule_type\' >> $manifest_base;\n         \n #if $metadata_file_or_form.metadata_format == "file":\n     ## process the input tables, this creates an intermediate file with information\n@@ -51,17 +56,18 @@\n     center_name=`grep \'center_name\' $metadata_file_or_form.ena_receipt | cut -f2,2 | tr -d \'\\n\'`;\n #else:\n     #set $generated_manifest=\'./manifests/generated_manifest.txt\'\n-    cp $manifest_base $generated_manifest\n-    $study_id = $metadata_file_or_form.study_accession\n-    $sample_id = $metadata_file_or_form.sample_accession\n-    echo "STUDY\\t$study_id" > $generated_manifest;\n-    echo "SAMPLE\\t$sample_id" >> $generated_manifest;\n-    center_name=$metadata_file_or_form.center_name;\n-    echo "ASSEMBLY_NAME\\t$metadata_file_or_form.assembly_name" >> $generated_manifest;\n-    echo "PLATFORM\\t$platform_name" >> $generated_manifest;\n+    cp $manifest_base $generated_manifest;\n+    #set $study_id = $metadata_file_or_form.study_accession\n+    #set $sample_id = $metadata_file_or_'..b'true" falsevalue="false" label="Validate files and metadata but do not submit" help="Generate input files and run Webin-CLI with -validate option. If \'No\' is selected then it will validate and submit (-submit flag)"/>\n     <param name="genome_fasta" type="data" label="Select the consensus sequence assembly file" format="fasta"/>\n     <param name="assembly_type" type="select" label="Assembly type">\n         <option value="clone">Clone</option>\n@@ -127,8 +140,8 @@\n     <param name="coverage" type="float" optional="False" value="10000" label="Coverage"/>\n     <conditional name="metadata_file_or_form">\n         <param name="metadata_format" type="select" label="Select the method to load study and sample metadata">\n-            <option value="file" selected="True">I used Galaxy ENA upload tool for raw data submission, parse my submission receipt</option>\n-            <option value="form">Fill in required metadata for linking</option>\n+            <option value="form" selected="True">Fill in required submission metadata</option>\n+            <option value="file">(Beta) I used the Galaxy ENA upload tool to submit the raw data: parse the received submission receipt</option>\n         </param>\n         <when value="file">\n             <param type="data" format="txt" name="ena_receipt" label="Submission receipt obtained from ENA upload tool"/>\n@@ -146,15 +159,40 @@\n     </inputs>\n     <outputs>\n         <collection name="generated_manifests" type="list" label="Generated manifests">\n-            <!--<discover_datasets pattern="__name_and_ext__" directory="manifests" />-->\n-            <discover_datasets pattern="(?P&lt;designation&gt;.+)\\.manifest\\.txt$" ext="txt" directory="manifests" />\n+            <discover_datasets pattern="(?P&lt;designation&gt;.+)\\.txt" ext="txt" directory="manifests/"/>\n         </collection>\n-        <collection name="manifests_reports" type="list" label="Manifests reports">\n-            <!--[><discover_datasets pattern="__name_and_ext__" directory="manifests" /><]-->\n-            <discover_datasets pattern="(?P&lt;designation&gt;.+)\\.manifest\\.txt\\.report$" ext="txt" directory="manifests" />\n-        </collection>\n-        <data name="webin_cli_report" label="ENA submission receipt" format="txt" from_work_dir="manifests/webin-cli.report"/>\n+        <data name="webin_cli_log" label="ENA submission log" format="txt"/>\n+        <data name="webin_cli_outputs" label="Webin cli outputs" format="tar"/>\n+        \n     </outputs>\n+    <tests>\n+        <test>\n+            <param name="submit_test" value="true" />\n+            <param name="dry_run" value="true" />\n+            <param name="test_submit" value="True" />\n+            <param name="genome_fasta" value="phiX2.fasta"/>\n+            <param name="assembly_type" value="isolate"/>\n+            <param name="assembly_program" value="Test assembly program"/>\n+            <param name="molecule_type" value="viral cRNA"/>\n+            <param name="coverage" value="10000"/>\n+            <conditional name="metadata_file_or_form">\n+                <param name="metadata_format" value="form"/>\n+                <param name="assembly_name" value="Test assembly name"/>\n+                <param name="study_accession" value="PRJEB49173"/>\n+                <param name="sample_accession" value="SAMEA11953908"/>\n+                <param name="sequencing_platform" value="Nanopore 0011"/>\n+                <param name="description" value="Test Description"/>\n+                <param name="center_name" value="Test center name"/>\n+            </conditional>\n+            <param name="min_gap_length" value="30"/>\n+            <output name="webin_cli_log">\n+                <assert_contents>\n+                    <has_n_lines n="4"/>\n+                    <has_text_matching expression="ERROR: Invalid submission account user name or password."/>\n+                </assert_contents>\n+            </output>\n+        </test>\n+    </tests>\n     <help><![CDATA[\n         TODO: Fill in help.\n     ]]></help>\n'
b
diff -r f24eb2f2cb0c -r 1ecd8ce07db4 test-data/phiX2.fasta
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/phiX2.fasta Fri Feb 04 15:52:45 2022 +0000
b
@@ -0,0 +1,90 @@
+>phiX174
+GAGTTTTATCGCTTCCATGACGCAGAAGTTAACACTTTCGGATATTTCTGATGAGTCGAAAAATTATCTT
+GATAAAGCAGGAATTACTACTGCTTGTTTACGAATTAAATCGAAGTGGACTGCTGGCGGAAAATGAGAAA
+ATTCGACCTATCCTTGCGCAGCTCGAGAAGCTCTTACTTTGCGACCTTTCGCCATCAACTAACGATTCTG
+TCAAAAACTGACGCGTTGGATGAGGAGAAGTGGCTTAATATGCTTGGCACGTTCGTCAAGGACTGGTTTA
+GATATGAGTCACATTTTGTTCATGGTAGAGATTCTCTTGTTGACATTTTAAAAGAGCGTGGATTACTATC
+TGAGTCCGATGCTGTTCAACCACTAATAGGTAAGAAATCATGAGTCAAGTTACTGAACAATCCGTACGTT
+TCCAGACCGCTTTGGCCTCTATTAAGCTCATTCAGGCTTCTGCCGTTTTGGATTTAACCGAAGATGATTT
+CGATTTTCTGACGAGTAACAAAGTTTGGATTGCTACTGACCGCTCTCGTGCTCGTCGCTGCGTTGAGGCT
+TGCGTTTATGGTACGCTGGACTTTGTGGGATACCCTCGCTTTCCTGCTCCTGTTGAGTTTATTGCTGCCG
+TCATTGCTTATTATGTTCATCCCGTCAACATTCAAACGGCCTGTCTCATCATGGAAGGCGCTGAATTTAC
+GGAAAACATTATTAATGGCGTCGAGCGTCCGGTTAAAGCCGCTGAATTGTTCGCGTTTACCTTGCGTGTA
+CGCGCAGGAAACACTGACGTTCTTACTGACGCAGAAGAAAACGTGCGTCAAAAATTACGTGCAGAAGGAG
+TGATGTAATGTCTAAAGGTAAAAAACGTTCTGGCGCTCGCCCTGGTCGTCCGCAGCCGTTGCGAGGTACT
+AAAGGCAAGCGTAAAGGCGCTCGTCTTTGGTATGTAGGTGGTCAACAATTTTAATTGCAGGGGCTTCGGC
+CCCTTACTTGAGGATAAATTATGTCTAATATTCAAACTGGCGCCGAGCGTATGCCGCATGACCTTTCCCA
+TCTTGGCTTCCTTGCTGGTCAGATTGGTCGTCTTATTACCATTTCAACTACTCCGGTTATCGCTGGCGAC
+TCCTTCGAGATGGACGCCGTTGGCGCTCTCCGTCTTTCTCCATTGCGTCGTGGCCTTGCTATTGACTCTA
+CTGTAGACATTTTTACTTTTTATGTCCCTCATCGTCACGTTTATGGTGAACAGTGGATTAAGTTCATGAA
+GGATGGTGTTAATGCCACTCCTCTCCCGACTGTTAACACTACTGGTTATATTGACCATGCCGCTTTTCTT
+GGCACGATTAACCCTGATACCAATAAAATCCCTAAGCATTTGTTTCAGGGTTATTTGAATATCTATAACA
+ACTATTTTAAAGCGCCGTGGATGCCTGACCGTACCGAGGCTAACCCTAATGAGCTTAATCAAGATGATGC
+TCGTTATGGTTTCCGTTGCTGCCATCTCAAAAACATTTGGACTGCTCCGCTTCCTCCTGAGACTGAGCTT
+TCTCGCCAAATGACGACTTCTACCACATCTATTGACATTATGGGTCTGCAAGCTGCTTATGCTAATTTGC
+ATACTGACCAAGAACGTGATTACTTCATGCAGCGTTACCGTGATGTTATTTCTTCATTTGGAGGTAAAAC
+CTCTTATGACGCTGACAACCGTCCTTTACTTGTCATGCGCTCTAATCTCTGGGCATCTGGCTATGATGTT
+GATGGAACTGACCAAACGTCGTTAGGCCAGTTTTCTGGTCGTGTTCAACAGACCTATAAACATTCTGTGC
+CGCGTTTCTTTGTTCCTGAGCATGGCACTATGTTTACTCTTGCGCTTGTTCGTTTTCCGCCTACTGCGAC
+TAAAGAGATTCAGTACCTTAACGCTAAAGGTGCTTTGACTTATACCGATATTGCTGGCGACCCTGTTTTG
+TATGGCAACTTGCCGCCGCGTGAAATTTCTATGAAGGATGTTTTCCGTTCTGGTGATTCGTCTAAGAAGT
+TTAAGATTGCTGAGGGTCAGTGGTATCGTTATGCGCCTTCGTATGTTTCTCCTGCTTATCACCTTCTTGA
+AGGCTTCCCATTCATTCAGGAACCGCCTTCTGGTGATTTGCAAGAACGCGTACTTATTCGCCACCATGAT
+TATGACCAGTGTTTCCAGTCCGTTCAGTTGTTGCAGTGGAATAGTCAGGTTAAATTTAATGTGACCGTTT
+ATCGCAATCTGCCGACCACTCGCGATTCAATCATGACTTCGTGATAAAAGATTGAGTGTGAGGTTATAAC
+GCCGAAGCGGTAAAAATTTTAATTTTTGCCGCTGAGGGGTTGACCAAGCGAAGCGCGGTAGGTTTTCTGC
+TTAGGAGTTTAATCATGTTTCAGACTTTTATTTCTCGCCATAATTCAAACTTTTTTTCTGATAAGCTGGT
+TCTCACTTCTGTTACTCCAGCTTCTTCGGCACCTGTTTTACAGACACCTAAAGCTACATCGTCAACGTTA
+TATTTTGATAGTTTGACGGTTAATGCTGGTAATGGTGGTTTTCTTCATTGCATTCAGATGGATACATCTG
+TCAACGCCGCTAATCAGGTTGTTTCTGTTGGTGCTGATATTGCTTTTGATGCCGACCCTAAATTTTTTGC
+CTGTTTGGTTCGCTTTGAGTCTTCTTCGGTTCCGACTACCCTCCCGACTGCCTATGATGTTTATCCTTTG
+AATGGTCGCCATGATGGTGGTTATTATACCGTCAAGGACTGTGTGACTATTGACGTCCTTCCCCGTACGC
+CGGGCAATAATGTTTATGTTGGTTTCATGGTTTGGTCTAACTTTACCGCTACTAAATGCCGCGGATTGGT
+TTCGCTGAATCAGGTTATTAAAGAGATTATTTGTCTCCAGCCACTTAAGTGAGGTGATTTATGTTTGGTG
+CTATTGCTGGCGGTATTGCTTCTGCTCTTGCTGGTGGCGCCATGTCTAAATTGTTTGGAGGCGGTCAAAA
+AGCCGCCTCCGGTGGCATTCAAGGTGATGTGCTTGCTACCGATAACAATACTGTAGGCATGGGTGATGCT
+GGTATTAAATCTGCCATTCAAGGCTCTAATGTTCCTAACCCTGATGAGGCCGCCCCTAGTTTTGTTTCTG
+GTGCTATGGCTAAAGCTGGTAAAGGACTTCTTGAAGGTACGTTGCAGGCTGGCACTTCTGCCGTTTCTGA
+TAAGTTGCTTGATTTGGTTGGACTTGGTGGCAAGTCTGCCGCTGATAAAGGAAAGGATACTCGTGATTAT
+CTTGCTGCTGCATTTCCTGAGCTTAATGCTTGGGAGCGTGCTGGTGCTGATGCTTCCTCTGCTGGTATGG
+TTGACGCCGGATTTGAGAATCAAAAAGAGCTTACTAAAATGCAACTGGACAATCAGAAAGAGATTGCCGA
+GATGCAAAATGAGACTCAAAAAGAGATTGCTGGCATTCAGTCGGCGACTTCACGCCAGAATACGAAAGAC
+CAGGTATATGCACAAAATGAGATGCTTGCTTATCAACAGAAGGAGTCTACTGCTCGCGTTGCGTCTATTA
+TGGAAAACACCAATCTTTCCAAGCAACAGCAGGTTTCCGAGATTATGCGCCAAATGCTTACTCAAGCTCA
+AACGGCTGGTCAGTATTTTACCAATGACCAAATCAAAGAAATGACTCGCAAGGTTAGTGCTGAGGTTGAC
+TTAGTTCATCAGCAAACGCAGAATCAGCGGTATGGCTCTTCTCATATTGGCGCTACTGCAAAGGATATTT
+CTAATGTCGTCACTGATGCTGCTTCTGGTGTGGTTGATATTTTTCATGGTATTGATAAAGCTGTTGCCGA
+TACTTGGAACAATTTCTGGAAAGACGGTAAAGCTGATGGTATTGGCTCTAATTTGTCTAGGAAATAACCG
+TCAGGATTGACACCCTCCCAATTGTATGTTTTCATGCCTCCAAATCTTGGAGGCTTTTTTATGGTTCGTT
+CTTATTACCCTTCTGAATGTCACGCTGATTATTTTGACTTTGAGCGTATCGAGGCTCTTAAACCTGCTAT
+TGAGGCTTGTGGCATTTCTACTCTTTCTCAATCCCCAATGCTTGGCTTCCATAAGCAGATGGATAACCGC
+ATCAAGCTCTTGGAAGAGATTCTGTCTTTTCGTATGCAGGGCGTTGAGTTCGATAATGGTGATATGTATG
+TTGACGGCCATAAGGCTGCTTCTGACGTTCGTGATGAGTTTGTATCTGTTACTGAGAAGTTAATGGATGA
+ATTGGCACAATGCTACAATGTGCTCCCCCAACTTGATATTAATAACACTATAGACCACCGCCCCGAAGGG
+GACGAAAAATGGTTTTTAGAGAACGAGAAGACGGTTACGCAGTTTTGCCGCAAGCTGGCTGCTGAACGCC
+CTCTTAAGGATATTCGCGATGAGTATAATTACCCCAAAAAGAAAGGTATTAAGGATGAGTGTTCAAGATT
+GCTGGAGGCCTCCACTATGAAATCGCGTAGAGGCTTTACTATTCAGCGTTTGATGAATGCAATGCGACAG
+GCTCATGCTGATGGTTGGTTTATCGTTTTTGACACTCTCACGTTGGCTGACGACCGATTAGAGGCGTTTT
+ATGATAATCCCAATGCTTTGCGTGACTATTTTCGTGATATTGGTCGTATGGTTCTTGCTGCCGAGGGTCG
+CAAGGCTAATGATTCACACGCCGACTGCTATCAGTATTTTTGTGTGCCTGAGTATGGTACAGCTAATGGC
+CGTCTTCATTTCCATGCGGTGCATTTTATGCGGACACTTCCTACAGGTAGCGTTGACCCTAATTTTGGTC
+GTCGGGTACGCAATCGCCGCCAGTTAAATAGCTTGCAAAATACGTGGCCTTATGGTTACAGTATGCCCAT
+CGCAGTTCGCTACACGCAGGACGCTTTTTCACGTTCTGGTTGGTTGTGGCCTGTTGATGCTAAAGGTGAG
+CCGCTTAAAGCTACCAGTTATATGGCTGTTGGTTTCTATGTGGCTAAATACGTTAACAAAAAGTCAGATA
+TGGACCTTGCTGCTAAAGGTCTAGGAGCTAAAGAATGGAACAACTCACTAAAAACCAAGCTGTCGCTACT
+TCCCAAGAAGCTGTTCAGAATCAGAATGAGCCGCAACTTCGGGATGAAAATGCTCACAATGACAAATCTG
+TCCACGGAGTGCTTAATCCAACTTACCAAGCTGGGTTACGACGCGACGCCGTTCAACCAGATATTGAAGC
+AGAACGCAAAAAGAGAGATGAGATTGAGGCTGGGAAAAGTTACTGTAGCCGACGTTTTGGCGGCGCAACC
+TGTGACGACAAATCTGCTCAAATTTATGCGCGCTTCGATAAAAATGATTGGCGTATCCAACCTGCA
+>phi2174
+GAGTTTTATCGCTTCCATGACGCAGAAGTTAACACTTTCGGATATTTCTGATGAGTCGAAAAATTATCTT
+GATAAAGCAGGAATTACTACTGCTTGTTTACGAATTAAATCGAAGTGGACTGCTGGCGGAAAATGAGAAA
+ATTCGACCTATCCTTGCGCAGCTCGAGAAGCTCTTACTTTGCGACCTTTCGCCATCAACTAACGATTCTG
+TCAAAAACTGACGCGTTGGATGAGGAGAAGTGGCTTAATATGCTTGGCACGTTCGTCAAGGACTGGTTTA
+GATATGAGTCACATTTTGTTCATGGTAGAGATTCTCTTGTTGACATTTTAAAAGAGCGTGGATTACTATC
+TGAGTCCGATGCTGTTCAACCACTAATAGGTAAGAAATCATGAGTCAAGTTACTGAACAATCCGTACGTT
+TCCAGACCGCTTTGGCCTCTATTAAGCTCATTCAGGCTTCTGCCGTTTTGGATTTAACCGAAGATGATTT
+CGATTTTCTGACGAGTAACAAAGTTTGGATTGCTACTGACCGCTCTCGTGCTCGTCGCTGCGTTGAGGCT
+TGCGTTTATGGTACGCTGGACTTTGTGGGATACCCTCGCTTTCCTGCTCCTGTTGAGTTTATTGCTGCCG
+TCATTGCTTATTATGTTCATCCCGTCAACATTCAAACGGCCTGTCTCATCATGGAAGGCGCTGAATTTAC
+GGAAAACATTATTAATGGCGTCGAGCGTCCGGTTAAAGCCGCTGAATTGTTCGCGTTTACCTTGCGTGTA