diff metaphlan2.xml @ 31:83f06bee818c draft

planemo upload for repository https://github.com/ASaiM/galaxytools/tree/master/tools/metaphlan2/ commit a6bf1721b4efa39b8cbcd059288c68e4abf8f9bd-dirty
author bebatut
date Tue, 21 Feb 2017 12:29:37 -0500
parents 99fe591b59fb
children c941148c75c7
line wrap: on
line diff
--- a/metaphlan2.xml	Thu Jun 16 06:07:23 2016 -0400
+++ b/metaphlan2.xml	Tue Feb 21 12:29:37 2017 -0500
@@ -1,4 +1,4 @@
-<tool id="metaphlan2" name="MetaPhlAn2" version="2.5.0">
+<tool id="metaphlan2" name="MetaPhlAn2" version="@WRAPPER_VERSION@.0">
 
     <description>to profile the composition of microbial communities</description>
 
@@ -6,7 +6,10 @@
         <import>metaphlan2_macros.xml</import>
     </macros>
 
-    <expand macro="requirements"/>
+    <expand macro="requirements">
+        <requirement type="package" version="2.2.5">bowtie2</requirement>
+    </expand>
+    
     <expand macro="stdio"/>
 
     <version_command>
@@ -24,87 +27,85 @@
         #if $db.db_selector == "history"
             mkdir ref_db
             &&
-            bowtie2-build $db.db_sequences ref_db/ref_db
+            bowtie2-build '$db.bowtie2db' 'ref_db/ref_db'
             &&
-            python $__tool_directory__/transform_json_to_pkl.py
-                --json_input $db_metadata
-                --pkl_output ref_db/metadata.pkl
+            python '$__tool_directory__/transform_json_to_pkl.py'
+                --json_input '$db.mpa_pkl'
+                --pkl_output 'ref_db/metadata.pkl'
             &&
         #end if
 
         metaphlan2.py
-            $input_file
-            -o $output_file
-            --input_type ${input_file.datatype.file_ext}
+            '$input_file'
+            -o '$output_file'
+            --input_type '${input_file.datatype.file_ext}'
 
             --bowtie2_exe `which bowtie2`
 
             #if $db.db_selector == "cached"
                 #set $table = dict([(_[0], _[2]) for _ in $db.cached_db.input.options.tool_data_table.data])
                 #set $db_choice = $db.cached_db.value
-                --bowtie2db $table[$db_choice]
+                --bowtie2db '$table[$db_choice]'
                 --mpa_pkl $table[$db_choice]".pkl"
             #else
-                --bowtie2db ref_db/ref_db
-                --mpa_pkl ref_db/metadata.pkl
+                --bowtie2db 'ref_db/ref_db'
+                --mpa_pkl 'ref_db/metadata.pkl'
             #end if
 
             --no_map
 
-            -t $analysis_type.analysis_type_select
-            #if $analysis_type.analysis_type_select == "rel_ab"
-                --tax_lev $analysis_type.taxonomic_level
+            -t '$analysis_type.analysis_type_select'
+            #if $analysis_type.analysis_type_select == "rel_ab" or $analysis_type.analysis_type_select == "rel_ab_w_read_stats"
+                --tax_lev '$analysis_type.taxonomic_level'
             #else if $analysis_type.analysis_type_select == "marker_ab_table"
-                --nreads $analysis_type.nreads
+                --nreads '$analysis_type.nreads'
             #else if $analysis_type.analysis_type_select == "marker_pres_table"
-                --pres_th $analysis_type.pres_th
+                --pres_th '$analysis_type.pres_th'
             #end if
 
-            --min_cu_len $min_cu_len
-            --min_alignment_len $min_alignment_len
+            --min_cu_len '$min_cu_len'
+            --min_alignment_len '$min_alignment_len'
 
             $ignore_viruses
             $ignore_eukaryotes
             $ignore_bacteria
             $ignore_archaea
 
-            --stat_q $stat_q
-            -s $sam_output_file
+            --stat_q '$stat_q'
+            -s '$sam_output_file'
+            --biom '$biom_output_file'
 ]]>
     </command>
 
     <inputs>
         <param name="input_file" type="data" format="fastq,fasta,sam" label="Input file" help=""/>
-
         <conditional name="db">
             <param name="db_selector" type="select" label="Database with clade-specific marker genes" help="">
                 <option value="cached" selected="true">Locally cached</option>
                 <option value="history">From history</option>
             </param>
-
             <when value="cached">
                 <param name="cached_db" label="Cached database with clade-specific marker genes" type="select" >
-                <options from_data_table="metaphlan2_db" />
+                <options from_data_table="metaphlan2_database" />
                 </param>
             </when>
             <when value="history">
-                <param name="db_sequences" type="data" format="fasta" label="Database with clade-specific marker genes from history" help="(--bowtie2db)"/>
-                <param name="db_metadata" type="data" format="json" label="Metadata associate to the database with clade-specific marker genes from history" help="(--mpa_pkl)"/>
+                <param argument="--bowtie2db" type="data" format="fasta" label="Database with clade-specific marker genes from history"/>
+                <param argument="--mpa_pkl" type="data" format="json" label="Metadata associate to the database with clade-specific marker genes from history"/>
             </when>
         </conditional>
-
         <conditional name="analysis_type">
-            <param name="analysis_type_select" type="select" label="Type of analysis to perform" help="(-t)">
+            <param name="analysis_type_select" type="select" label="Type of analysis to perform" argument="-t">
               <option value="rel_ab" selected="true">Profiling a metagenomes in terms of relative abundances</option>
+              <option value="rel_ab_w_read_stats">Profiling a metagenomes in terms of relative abundances and estimate the number of reads comming from each clade</option>
               <option value="reads_map">Mapping from reads to clades (only reads hitting a marker)</option>
               <option value="clade_profiles">Normalized marker counts for clades with at least a non-null marker</option>
               <option value="marker_ab_table">Normalized marker counts (only when > 0.0 and normalized by metagenome size if --nreads is specified)</option>
               <option value="marker_counts">Non-normalized marker counts (use with extreme caution)</option>
               <option value="marker_pres_table">List of markers present in the sample (threshold at 1.0 if not differently specified with --pres_th</option>
             </param>
-
             <when value="rel_ab">
-              <param name="taxonomic_level" type="select" label="Taxonomic level for the relative abundance output" help="(--tax_lev)">
+              <param argument="--taxonomic_level" type="select" label="Taxonomic level for the relative abundance output">
                 <option value="a" selected="true">All taxonomic levels</option>
                 <option value="k">Kingdoms (Bacteria and Archaea) only</option>
                 <option value="p">Phyla only</option>
@@ -115,46 +116,51 @@
                 <option value="s">Species only</option>
               </param>
             </when>
-
+            <when value="rel_ab_w_read_stats">
+              <param argument="--taxonomic_level" type="select" label="Taxonomic level for the relative abundance output">
+                <option value="a" selected="true">All taxonomic levels</option>
+                <option value="k">Kingdoms (Bacteria and Archaea) only</option>
+                <option value="p">Phyla only</option>
+                <option value="c">Classes only</option>
+                <option value="o">Orders only</option>
+                <option value="f">Families only</option>
+                <option value="g">Genera only</option>
+                <option value="s">Species only</option>
+              </param>
+            </when>
             <when value="reads_map"/>
             <when value="clade_profiles"/>
-
             <when value="marker_ab_table">
-                <param name="nreads" type="integer" value="0" label="Total number of reads in the original metagenome" help="It is used for normalizing the length-normalized counts with the metagenome size as well. No normalization applied if the value is not specified"/>
+                <param argument="--nreads" type="integer" value="0" label="Total number of reads in the original metagenome" help="It is used for normalizing the length-normalized counts with the metagenome size as well. No normalization applied if the value is not specified"/>
             </when>
-
             <when value="marker_counts"/>
-
             <when value="marker_pres_table">
-                <param name="pres_th" type="integer" value="0" label=" Threshold for calling a marker present" help=""/>
+                <param argument="--pres_th" type="integer" value="0" label=" Threshold for calling a marker present"/>
             </when>
         </conditional>
-
-        <param name="min_cu_len" type="integer" value="2000" label="Minimum total nucleotide length for the markers in a clade for estimating the abundance without considering sub-clade abundances" help=""/>
-
-        <param name="min_alignment_len" type="integer" value="0" label="Sam records for aligned reads with the longest subalignment length smaller than this threshold will be discarded." help=""/>
-
-        <param name="ignore_viruses" type='boolean' checked="true" truevalue='' falsevalue='--ignore_viruses' label="Profile viral organisms?" help="" />
-        <param name="ignore_eukaryotes" type='boolean' checked="true" truevalue='' falsevalue='--ignore_eukaryotes' label="Profile eukaryotic organisms?" help="" />
-
-        <param name="ignore_bacteria" type='boolean' checked="true" truevalue='' falsevalue='--ignore_bacteria' label="Profile bacteria organisms?" help="" />
-
-        <param name="ignore_archaea" type='boolean' checked="true" truevalue='' falsevalue='--ignore_archaea' label="Profile archea organisms?" help="" />
-
-        <param name="stat_q" type="float" value="0.1" label="Quantile value for the robust average" help=""/>
+        <param argument="--min_cu_len" type="integer" value="2000" label="Minimum total nucleotide length for the markers in a clade for estimating the abundance without considering sub-clade abundances"/>
+        <param argument="--min_alignment_len" type="integer" value="0" label="Sam records for aligned reads with the longest subalignment length smaller than this threshold will be discarded."/>
+        <param argument="--ignore_viruses" type='boolean' checked="true" truevalue='' falsevalue='--ignore_viruses' label="Profile viral organisms?"/>
+        <param argument="--ignore_eukaryotes" type='boolean' checked="true" truevalue='' falsevalue='--ignore_eukaryotes' label="Profile eukaryotic organisms?"/>
+        <param argument="--ignore_bacteria" type='boolean' checked="true" truevalue='' falsevalue='--ignore_bacteria' label="Profile bacteria organisms?"/>
+        <param argument="--ignore_archaea" type='boolean' checked="true" truevalue='' falsevalue='--ignore_archaea' label="Profile archea organisms?"/>
+        <param argument="--stat_q" type="float" value="0.1" label="Quantile value for the robust average"/>
+        <param argument="--sample_id_key" type="text" value="#SampleID" label="Sample ID key"/>
+        <param argument="--sample_id" type="text" value="Metaphlan2_Analysis" label="Sample ID"/>
     </inputs>
 
     <outputs>
         <data format="tabular" name="output_file" label="${tool.name} on ${on_string}: Community profile" />
         <data format="sam" name="sam_output_file" label="${tool.name} on ${on_string}: SAM file" />
+        <data format="biom" name="biom_output_file" label="${tool.name} on ${on_string}: BIOM file" />
     </outputs>
 
     <tests>
         <test>
             <param name="input_file" value="input_sequences.fasta"/>
             <param name="db_selector" value="history" />
-            <param name="db_metadata" value="marker_metadata.json" />
-            <param name="db_sequences" value="marker_sequences.fasta" />
+            <param name="mpa_pkl" value="marker_metadata.json" />
+            <param name="bowtie2db" value="marker_sequences.fasta" />
             <param name="analysis_type_select" value="rel_ab" />
             <param name="taxonomic_level" value="a" />
             <param name="min_cu_len" value="2000" />
@@ -164,6 +170,8 @@
             <param name="ignore_bacteria" value="" />
             <param name="ignore_archaea" value="" />
             <param name="stat_q" value="0.1" />
+            <param name="sample_id_key" value="#SampleID"/>
+            <param name="sample_id" value="Metaphlan2_Analysis"/>
             <output name="output_file" file="community_profile.tabular"/>
         </test>
     </tests>
@@ -207,7 +215,5 @@
 
     ]]></help>
 
-    <citations>
-        <citation type="doi">10.1038/nmeth.3589</citation>
-    </citations>
+    <expand macro="citations"/>
 </tool>