diff sarscov2formatter.xml @ 2:2e993ff8e7dc draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sarscov2formatter commit dc4d978a42ef881f602b813f9416fd37e3ea3b6a"
author iuc
date Mon, 22 Nov 2021 10:41:59 +0000
parents e3a7995dce75
children
line wrap: on
line diff
--- a/sarscov2formatter.xml	Fri Nov 20 18:21:33 2020 +0000
+++ b/sarscov2formatter.xml	Mon Nov 22 10:41:59 2021 +0000
@@ -1,12 +1,18 @@
-<tool id="sarscov2formatter" name="sarscov2formatter" version="0.5.3+galaxy1" profile="18.01">
+<tool id="sarscov2formatter" name="sarscov2formatter" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="18.01">
+    <macros>
+        <token name="@TOOL_VERSION@">1.0</token>
+        <token name="@VERSION_SUFFIX@">0</token>
+    </macros>
     <requirements>
-        <requirement type="package" version="0.5.3">sarscov2formatter</requirement>
+        <requirement type="package" version="@TOOL_VERSION@">sarscov2formatter</requirement>
     </requirements>
     <command><![CDATA[
 sarscov2formatter
 -a '$align'
 #if $source.source_choice == 'ncbi':
-    -m ncbi
+    #if $source.meta
+        -n '$source.meta'
+    #end if
 #else:
     -m '$source.meta'
 #end if
@@ -18,9 +24,11 @@
                 <option value="ncbi">NCBI</option>
                 <option value="other">Other</option>
             </param>
-            <when value="ncbi" />
+            <when value="ncbi">
+                 <param name="meta" type="data" format="json" optional="true" label="Metadata from NCBI" help="If not given it will be downloaded" />
+            </when>
             <when value="other" >
-                 <param name="meta" type="data" format="tabular" label="Metadata source" help="Tabular file with metadata with the correct columns (see below)" />
+                 <param name="meta" type="data" format="tabular" label="Metadata" help="Tabular file with metadata with the correct columns (see below)" />
             </when>
         </conditional>
     </inputs>
@@ -30,12 +38,12 @@
         <data name="outmeta" format="json" from_work_dir="meta.json" label="${tool.name}: Metadata" />
     </outputs>
     <tests>
-        <!-- note: test with ncbi yields unstable results for meta -> assert contents.
-             also needs a surprising amount memory (1.7G) which might
-             become impractival in the future -->
+        <!-- note: test with ncbi yields unstable results for meta -> assert contents. -->
         <test>
             <param name="align" ftype="fasta" value="align.fasta" />
-            <param name="source_choice" value="ncbi" />
+            <conditional name="source" >
+                <param name="source_choice" value="ncbi" />
+            </conditional>
             <output name="msa" ftype="fasta" compare="diff" value="msa.fasta" />
             <output name="dups" ftype="json" compare="diff" value="dups.json" />
             <output name="outmeta" ftype="json">
@@ -53,19 +61,41 @@
                 </assert_contents>
             </output>
         </test>
-        <!-- TODO test with tabular input, does not work yet
-             test.tsv has been generated with test.py
-             https://github.com/nickeener/sarscov2formatter/issues/2 -->
-<!--        <test>-->
-<!--            <param name="align" ftype="fasta" value="align.fasta" />-->
-<!--            <conditional name="source" >-->
-<!--                <param name="source_choice" value="other" />-->
-<!--                <param name="meta" ftype="tabular" value="test.tsv" />-->
-<!--            </conditional>-->
-<!--            <output name="msa" ftype="fasta" compare="diff" value="msa-other.fasta" />-->
-<!--            <output name="dups" ftype="json" compare="diff" value="dups-other.json" />-->
-<!--            <output name="outmeta" ftype="json" compare="diff" value="meta-other.json" />-->
-<!--        </test>-->
+        <!-- test with local NCBI data, here a json file containing only the entries relevant for the fasta -->
+        <test>
+            <param name="align" ftype="fasta" value="align.fasta" />
+            <conditional name="source" >
+                <param name="source_choice" value="ncbi" />
+                <param name="meta" ftype="json" value="test.json" />
+            </conditional>
+            <output name="msa" ftype="fasta" compare="diff" value="msa.fasta" />
+            <output name="dups" ftype="json" compare="diff" value="dups.json" />
+            <output name="outmeta" ftype="json">
+                <assert_contents>
+                    <has_line_matching expression="\{"/>
+                    <has_line_matching expression="\}"/>
+                    <has_text_matching expression='"LR757995": \{'/>
+                    <has_text_matching expression='"collected": '/>
+                    <has_text_matching expression='"collected": '/>
+                    <has_text_matching expression='"location": '/>
+                    <has_text_matching expression='"country": '/>
+                    <has_text_matching expression='"locality": '/>
+                    <has_text_matching expression='"state": '/>
+                    <has_text_matching expression='"subregion": '/>
+                </assert_contents>
+            </output>
+        </test>
+        <!-- TODO test with tabular input -->
+       <test>
+           <param name="align" ftype="fasta" value="align.fasta" />
+           <conditional name="source" >
+               <param name="source_choice" value="other" />
+               <param name="meta" ftype="tabular" value="test.tsv" />
+           </conditional>
+           <output name="msa" ftype="fasta" compare="diff" value="msa-other.fasta" />
+           <output name="dups" ftype="json" compare="diff" value="dups-other.json" />
+           <output name="outmeta" ftype="json" compare="diff" value="meta-other.json" />
+       </test>
     </tests>
         <help><![CDATA[
 
@@ -75,11 +105,13 @@
 
 Custom sript that performs necessary formatting operations for the SARS-CoV2 Selection Analysis workflow.
 
+If using NCBI as data source the file can be obtained from https://www.ncbi.nlm.nih.gov/projects/genome/sars-cov-2-seqs/ncov-sequences.yaml.
+If not given the tool will download it automatically.
+
 If using non-NCBI data, the metadata input file must be tabular with the following columns: ID, collection_date, country, state (optional), and locality (optional). Optional columns should still be created even if they are not used.
 
 Dates should be of the format: YYMMDD (example: May 1 2020 = 20200501).
 
-
     ]]></help>
     <citations>
         <citation type="bibtex">