diff nextclade.xml @ 17:07ab9bd68a02 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/nextclade commit 2c63aeec74c260ccd9b2cdbbe1869bef2f3d5cda
author iuc
date Thu, 04 Aug 2022 06:58:48 +0000
parents 9e10ba792be2
children feb40665d7cd
line wrap: on
line diff
--- a/nextclade.xml	Mon Mar 21 22:10:16 2022 +0000
+++ b/nextclade.xml	Thu Aug 04 06:58:48 2022 +0000
@@ -3,6 +3,11 @@
     <macros>
         <import>macros.xml</import>
         <token name="@VERSION_SUFFIX@">0</token>
+        <!-- sars-cov-2 and influenza databases are compatible with nextclade 1+, MPXV ones
+             with nextclade 2+ but at time of writing this tool is for nextclade version 2,
+             so the following regexp will select all databases known to be compatible with
+             this tool and exclude any requiring a future nextclade version 3. -->
+        <token name="@COMPATIBILITY_SPEC@"><![CDATA[(^1\..+$|^2\.[0-4](\..+)*$)]]></token>
     </macros>
     <requirements>
         <requirement type="package" version="@TOOL_VERSION@">nextclade</requirement>
@@ -10,9 +15,13 @@
     </requirements>
     <version_command>nextclade --version-detailed</version_command>
     <command detect_errors="exit_code"><![CDATA[
-        nextclade dataset get -n '${organism}' -o db &&
+        #if $db.source == "cached"
+            ln -s '${db.release.fields.path}' db &&
+        #elif $db.source == "download"
+            nextclade dataset get -n '${organism}' -o db &&
+        #end if 
+        @QUERY_FASTA@
         nextclade run
-        --input-fasta '${input_fasta}'
         --input-dataset db/
         #if $adv.advanced_options == 'yes'
             #if $adv.input_qc_config
@@ -53,12 +62,44 @@
                 $adv.include_reference
             #end if
         #end if
+        $query
         #if $outputs and "report_tsv" in $outputs and not $include_header
             && tail -n+2 report.tsv >'$report_tsv'
         #end if 
     ]]></command>
     <inputs>
-        <param argument="--input-fasta" name="input_fasta" type="data" format="fasta" label="SARS-CoV-2 consensus sequences (FASTA)" />
+        <param argument="--input-fasta" name="input_fasta" type="data" format="fasta,fasta.gz" label="FASTA file with input sequences" />
+        <param name="organism" type="select" label="Organism">
+            <option value="sars-cov-2" selected="true">SARS-CoV-2</option>
+            <option value="sars-cov-2-no-recomb">SARS-CoV-2 without recombinants</option>
+            <option value="flu_h1n1pdm_ha">Influenza A H1N1pdm HA</option>
+            <option value="flu_h3n2_ha">Influenza A H3N2 HA</option>
+            <option value="flu_vic_ha">Influenza B Victoria HA</option>
+            <option value="flu_yam_ha">Influenza B Yamagata HA</option>
+            <option value="MPXV">Monkeypox (All Clades)</option>
+            <option value="hMPXV">Human Monkeypox (hMPXV)</option>
+            <option value="hMPXV_B1">Human Monkeypox Clade B.1</option>
+        </param>   
+        <conditional name="db">
+            <param name="source" type="select" label="Version of database to use">
+                <option value="cached" selected="true">Use specific database version cached on this Galaxy server</option>
+                <option value="download">Download latest available database version from web</option>
+            </param>
+            <when value="cached">
+                <param name="release" label="Cached nextclade database release" type="select">
+                    <options from_data_table="nextclade">
+                        <column name="value" index="0" />
+                        <column name="description" index="2" />
+                        <column name="date" index="4" />
+                        <column name="path" index="5" />
+                        <filter type="sort_by" column="4" />
+                        <filter type="param_value" ref="organism" column="1" />
+                        <filter type="regexp" column="3" value="@COMPATIBILITY_SPEC@" />
+                    </options>
+                </param>
+            </when>
+            <when value="download"></when>
+        </conditional>
         <param name="outputs" type="select" label="Output options" help="Output reports and optionally tree" multiple="true">
             <option value="report_json">JSON format report</option>
             <option value="report_tsv" selected="true">Tabular format report</option>
@@ -67,13 +108,6 @@
         </param>
         <param name="include_header" type="boolean" label="Include header line in output file" 
             truevalue="true" falsevalue="false" />
-        <param name="organism" type="select" label="Organism">
-            <option value="sars-cov-2" selected="true">SARS-CoV-2</option>
-            <option value="flu_h1n1pdm_ha">Influenza A H1N1pdm HA</option>
-            <option value="flu_h3n2_ha">Influenza A H3N2 HA</option>
-            <option value="flu_vic_ha">Influenza B Victoria HA</option>
-            <option value="flu_yam_ha">Influenza B Yamagata HA</option>
-        </param>   
         <conditional name="adv">
             <param name="advanced_options" type="select" label="Use advanced options" >
                 <option value="yes">Yes</option>
@@ -96,7 +130,7 @@
         <data name="report_tsv" format="tabular" label="${tool.name} on ${on_string} (TSV report)">            
             <filter>outputs and "report_tsv" in outputs</filter>
             <actions>
-                <action name="column_names" type="metadata" default="seqName,clade,qc.overallScore,qc.overallStatus,totalSubstitutions,totalDeletions,totalInsertions,totalFrameShifts,totalAminoacidSubstitutions,totalAminoacidDeletions,totalAminoacidInsertions,totalMissing,totalNonACGTNs,totalPcrPrimerChanges,substitutions,deletions,insertions,privateNucMutations.reversionSubstitutions,privateNucMutations.labeledSubstitutions,privateNucMutations.unlabeledSubstitutions,privateNucMutations.totalReversionSubstitutions,privateNucMutations.totalLabeledSubstitutions,privateNucMutations.totalUnlabeledSubstitutions,privateNucMutations.totalPrivateSubstitutions,frameShifts,aaSubstitutions,aaDeletions,aaInsertions,missing,nonACGTNs,pcrPrimerChanges,alignmentScore,alignmentStart,alignmentEnd,qc.missingData.missingDataThreshold,qc.missingData.score,qc.missingData.status,qc.missingData.totalMissing,qc.mixedSites.mixedSitesThreshold,qc.mixedSites.score,qc.mixedSites.status,qc.mixedSites.totalMixedSites,qc.privateMutations.cutoff,qc.privateMutations.excess,qc.privateMutations.score,qc.privateMutations.status,qc.privateMutations.total,qc.snpClusters.clusteredSNPs,qc.snpClusters.score,qc.snpClusters.status,qc.snpClusters.totalSNPs,qc.frameShifts.frameShifts,qc.frameShifts.totalFrameShifts,qc.frameShifts.frameShiftsIgnored,qc.frameShifts.totalFrameShiftsIgnored,qc.frameShifts.score,qc.frameShifts.status,qc.stopCodons.stopCodons,qc.stopCodons.totalStopCodons,qc.stopCodons.score,qc.stopCodons.status,errors" />
+                <action name="column_names" type="metadata" default="seqName,clade,Nextclade_pango,qc.overallScore,qc.overallStatus,totalSubstitutions,totalDeletions,totalInsertions,totalFrameShifts,totalAminoacidSubstitutions,totalAminoacidDeletions,totalAminoacidInsertions,totalMissing,totalNonACGTNs,totalPcrPrimerChanges,substitutions,deletions,insertions,privateNucMutations.reversionSubstitutions,privateNucMutations.labeledSubstitutions,privateNucMutations.unlabeledSubstitutions,privateNucMutations.totalReversionSubstitutions,privateNucMutations.totalLabeledSubstitutions,privateNucMutations.totalUnlabeledSubstitutions,privateNucMutations.totalPrivateSubstitutions,frameShifts,aaSubstitutions,aaDeletions,aaInsertions,missing,nonACGTNs,pcrPrimerChanges,alignmentScore,alignmentStart,alignmentEnd,qc.missingData.missingDataThreshold,qc.missingData.score,qc.missingData.status,qc.missingData.totalMissing,qc.mixedSites.mixedSitesThreshold,qc.mixedSites.score,qc.mixedSites.status,qc.mixedSites.totalMixedSites,qc.privateMutations.cutoff,qc.privateMutations.excess,qc.privateMutations.score,qc.privateMutations.status,qc.privateMutations.total,qc.snpClusters.clusteredSNPs,qc.snpClusters.score,qc.snpClusters.status,qc.snpClusters.totalSNPs,qc.frameShifts.frameShifts,qc.frameShifts.totalFrameShifts,qc.frameShifts.frameShiftsIgnored,qc.frameShifts.totalFrameShiftsIgnored,qc.frameShifts.score,qc.frameShifts.status,qc.stopCodons.stopCodons,qc.stopCodons.totalStopCodons,qc.stopCodons.score,qc.stopCodons.status,isReverseComplement,failedGenes,warnings,errors" />
             </actions>
         </data>
         <data name="report_json" format="json" label="${tool.name} on ${on_string} (JSON report)">
@@ -112,22 +146,28 @@
     <tests>
         <test expect_num_outputs="1">
             <param name="input_fasta" value="sarscov2_1.fasta" ftype="fasta" />
+            <conditional name="db">
+                <param name="source" value="download" />
+            </conditional>
             <param name="outputs" value="report_tsv" />
             <param name="organism" value="sars-cov-2" />
             <output name="report_tsv">
                 <assert_contents>
-                    <has_n_columns n="63" />
+                    <has_n_columns n="66" />
                     <has_text text="20A" />
                 </assert_contents>
             </output>
         </test>
         <test expect_num_outputs="3">
             <param name="input_fasta" value="sarscov2_1.fasta" ftype="fasta" />
+            <conditional name="db">
+                <param name="source" value="download" />
+            </conditional>
             <param name="outputs" value="report_tsv,report_json,output_tree" />
             <param name="organism" value="sars-cov-2" />
             <output name="report_tsv">
                 <assert_contents>
-                    <has_n_columns n="63" />
+                    <has_n_columns n="66" />
                     <has_text text="20A" />
                 </assert_contents>
             </output>
@@ -144,6 +184,9 @@
         </test>
         <test expect_num_outputs="1">
             <param name="input_fasta" value="sarscov2_1.fasta" ftype="fasta" />
+            <conditional name="db">
+                <param name="source" value="download" />
+            </conditional>
             <param name="outputs" value="report_tsv" />
             <param name="organism" value="sars-cov-2" />
             <conditional name="adv">
@@ -152,13 +195,16 @@
             </conditional>
             <output name="report_tsv">
                 <assert_contents>
-                    <has_n_columns n="63" />
+                    <has_n_columns n="66" />
                     <has_text text="mediocre" />
                 </assert_contents>
             </output>
         </test>
         <test expect_num_outputs="2">
             <param name="input_fasta" value="sarscov2_1.fasta" ftype="fasta" />
+            <conditional name="db">
+                <param name="source" value="download" />
+            </conditional>
             <param name="outputs" value="report_tsv,output_fasta" />
             <param name="organism" value="sars-cov-2" />
             <conditional name="adv">
@@ -167,12 +213,26 @@
             </conditional>
             <output name="report_tsv">
                 <assert_contents>
-                    <has_n_columns n="63" />
+                    <has_n_columns n="66" />
                     <has_text text="mediocre" />
                 </assert_contents>
             </output>
             <output name="output_fasta" value="output_alignment.fasta" ftype="fasta" />
         </test>
+        <test expect_num_outputs="1">
+            <param name="input_fasta" value="mpxv.fasta.gz" ftype="fasta.gz" />
+            <conditional name="db">
+                <param name="source" value="download" />
+            </conditional>
+            <param name="outputs" value="report_tsv" />
+            <param name="organism" value="MPXV" />
+            <output name="report_tsv">
+                <assert_contents>
+                    <has_n_columns n="66" />
+                    <has_text text="hMPXV-1" />
+                </assert_contents>
+            </output>
+        </test>
     </tests>
     <help><![CDATA[