diff cmbuild.xml @ 5:6e18e0b098cd draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/infernal commit 80c721dcfe02a2b8baf8e2c64b76cbcd71b23d86
author bgruening
date Sat, 21 Jan 2017 17:36:57 -0500
parents c47a7c52ac4f
children ee4be6eadd34
line wrap: on
line diff
--- a/cmbuild.xml	Mon Dec 19 15:27:06 2016 -0500
+++ b/cmbuild.xml	Sat Jan 21 17:36:57 2017 -0500
@@ -1,62 +1,96 @@
-<tool id="infernal_cmbuild" name="Build covariance models" version="1.1.0.2">
-    <description>from sequence alignments (cmbuild)</description>
-    <parallelism method="multi" split_inputs="alignment_infile" split_mode="to_size" split_size="10" shared_inputs="" merge_outputs="cmfile_outfile"></parallelism>
-    <requirements>
-        <requirement type="package">infernal</requirement>
-        <requirement type="package" version="1.1">infernal</requirement>
-        <requirement type="package" version="8.22">gnu_coreutils</requirement>
-    </requirements>
+<tool id="infernal_cmbuild" name="cmbuild" version="@VERSION@.0">
+    <description>Build covariance models from sequence alignments</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <parallelism method="multi" split_inputs="alignment_infile" split_mode="to_size" split_size="10" merge_outputs="cmfile_outfile"></parallelism>
+    <expand macro="requirements" />
+    <expand macro="stdio" />
     <command>
 <![CDATA[
-        cmbuild -F
-            #if $is_summery_output:
-                -o '$summary_outfile'
-            #end if
-
-            $model_construction_opts.model_construction_opts_selector
-            #if $model_construction_opts.model_construction_opts_selector == '--fast':
-                --symfrac $model_construction_opts.symfrac
+    cmbuild
+        -F
+        #if $is_summery_output:
+            -o '$summary_outfile'
+        #end if
+        ## to many outputs, is that one really needed?
+        ##-O $annotated_source_alignment_outfile
+        $model_construction_opts.model_construction_opts_selector
+        #if $model_construction_opts.model_construction_opts_selector == '--fast':
+            --symfrac $model_construction_opts.symfrac
+        #end if
+        $noss
+        $relative_weights_opts.relative_weights_opts_selector
+        #if $relative_weights_opts.relative_weights_opts_selector == '--wblosum':
+            --wid $relative_weights_opts.wid
+        #end if
+        --p7ere $controlling_filter_p7_hmm.p7ere
+        $controlling_filter_p7_hmm.p7ml
+        --EmN $controlling_filter_p7_hmm.EmN
+        --EvN $controlling_filter_p7_hmm.EvN
+        --ElfN $controlling_filter_p7_hmm.ElfN
+        --EgfN $controlling_filter_p7_hmm.EgfN
+        $effective_opts.effective_opts_selector
+        #if str($effective_opts.effective_opts_selector) == '--eent':
+            #if $effective_opts.ere
+                --ere $effective_opts.ere
             #end if
-
-            $noss
-
-            $relative_weights_opts.relative_weights_opts_selector
-            #if $relative_weights_opts.relative_weights_opts_selector == '--wblosum':
-                --wid $relative_weights_opts.wid
+            #if $effective_opts.eminseq
+                --eminseq $effective_opts.eminseq
             #end if
-
-            $effective_opts.effective_opts_selector
-            #if str($effective_opts.effective_opts_selector) == '--eent':
-                --ere $effective_opts.ere
-                --eminseq $effective_opts.eminseq
+            #if $effective_opts.ehmmre
                 --ehmmre $effective_opts.ehmmre
+            #end if
+            #if $effective_opts.eset
                 --eset $effective_opts.eset
             #end if
+        #end if
+        #if str($refining_opts.refining_opts_selector) == '--refine':
+            #if $refining_opts.refine_output:
+                --refine '$refined_multiple_alignment_output'
+            #else:
+                --refine /dev/null
+            #end if
+            $refining_opts.l
+            $refining_opts.gibbs_opts.gibbs_opts_selector
+            #if str($refining_opts.gibbs_opts.gibbs_opts_selector) == '--gibbs':
+                --seed $refining_opts.gibbs_opts.random_seed
+            #end if
+            $refining_opts.notrunc
+            $refining_opts.cyk
+        #end if
+        '$cmfile_outfile'
+        '$alignment_infile'
 
-            #if str($refining_opts.refining_opts_selector) == '--refine':
-                #if $refining_opts.refine_output:
-                    --refine $refined_multiple_alignment_output
-                #else:
-                    --refine /dev/null
-                #end if
-
-                $l
-                $refining_opts.gibbs_opts.gibbs_opts_selector
 
-                #if str($refining_opts.gibbs_opts.gibbs_opts_selector) == '--gibbs':
-                    $refining_opts.gibbs_opts.random_seed
+    #if $Calibrate.selector=="true"
+        && cmcalibrate
+            -L$Calibrate.L
+            #if $Calibrate.output_options_cond.selector == "extra"
+                #if str($Calibrate.output_options_cond.output_options) != 'None'
+                    #for j in $Calibrate.output_options_cond.output_options.value:
+                        --$j $getVar($j)
+                    #end for
                 #end if
-
-                $notrunc
-                $cyk
             #end if
-
+            #if $Calibrate.cont_exp_tails_fits.selector == "top_n"
+                --gtailn $Calibrate.cont_exp_tails_fits.gtailn
+                --ltailn $Calibrate.cont_exp_tails_fits.ltailn
+            #elif $Calibrate.cont_exp_tails_fits.selector == "frac"
+                --tailp $Calibrate.cont_exp_tails_fits.tailp
+            #end if
+            --seed $Calibrate.add_opts.seed
+            --beta $Calibrate.add_opts.beta
+            $Calibrate.add_opts.nonbanded
+            $Calibrate.add_opts.nonull3
+            $Calibrate.add_opts.random
+            #if str($Calibrate.add_opts.gc) != 'None'
+                --gc '$Calibrate.add_opts.gc'
+            #end if
+            --cpu "\${GALAXY_SLOTS:-2}"
             '$cmfile_outfile'
-            '$alignment_infile'
-      &&
-      cmcalibrate
-        -L 0.01 --cpu \${GALAXY_SLOTS:-2}
-        '$cmfile_outfile'
+    #end if
+
 ]]>
     </command>
         <inputs>
@@ -98,6 +132,15 @@
                 </when>
             </conditional>
 
+            <section name="controlling_filter_p7_hmm" title="Controlling Filter P7 HMM construction" >
+                <param argument="--p7ere" type="float" value="0.38" label="For the filter p7 HMM, set minimum rel entropy/posn to" help="Set the target mean match state relative entropy for the filter p7 HMM"/>
+                <param argument="--p7ml" type="boolean" truevalue="--p7ml" falsevalue="" checked="false" label="Define the filter p7 HMM as the ML p7 HMM" help="Use a mzimum likelihood p7 HMM built from the CM as the filter HMM"/>
+                <param argument="--EmN" type="integer" value="200" label="Number of sampled seqs to use for p7 local MSV calibration" help=""/>
+                <param argument="--EvN" type="integer" value="200" label="Number of sampled seqs to use for p7 local Vit calibration" help=""/>
+                <param argument="--ElfN" type="integer" value="200" label="Number of sampled seqs to use for p7 local Fwd calibration" help=""/>
+                <param argument="--EgfN" type="integer" value="200" label="Number of sampled seqs to use for p7 glocal Fwd calibration" help=""/>
+            </section>
+
             <conditional name="effective_opts">
                 <param name="effective_opts_selector" type="select" label="Options controlling effective sequence number" help="">
                     <option value="--eent" >entropy weighting strategy (--eent)</option>
@@ -105,24 +148,24 @@
                 </param>
                 <when value="--enone"/>
                 <when value="--eent">
-                    <param name="ere" type="float" value="0.59"
-                        label="Set the target mean match state relative entropy (--ere)" help=""/>
+                    <param name="ere" type="float" value=""
+                        label="Set the target mean match state relative entropy" help="(--ere)" optional="true"/>
 
                     <param name="eminseq" type="integer" value=""
-                        label="Define the minimum allowed effective sequence number (--eminseq)" help=""/>
+                        label="Define the minimum allowed effective sequence number" help="(--eminseq)" optional="true"/>
 
                     <param name="ehmmre" type="float" value=""
-                        label="Set the target HMM mean match state relative entropy (--ehmmre)" help=""/>
+                        label="Set the target HMM mean match state relative entropy" help="(--ehmmre)" optional="true"/>
 
                     <param name="eset" type="integer" value=""
-                        label="Set the effective sequence number for entropy weighting (--eset)" help=""/>
+                        label="Set the effective sequence number for entropy weighting" help="(--eset)" optional="true"/>
                 </when>
             </conditional>
 
             <conditional name="refining_opts">
                 <param name="refining_opts_selector" type="select" label="Options for refining the input alignment" help="">
+                    <option value="--refine">refine the input alignment</option>
                     <option value="" selected="true">No refinement</option>
-                    <option value="--refine">refine the input alignment</option>
                 </param>
                 <when value=""/>
                 <when value="--refine">
@@ -158,6 +201,59 @@
             <param name="is_summery_output" truevalue="" falsevalue="" checked="False" type="boolean"
                 label="Output a summery file?" help=""/>
 
+            <!-- calibrate options -->
+            <conditional name="Calibrate">
+                <param name="selector" type="boolean" checked="true" label="Calibrate the covariance model"
+                    help="A CM file must be calibrated with cmcalibrate before it can be used in cmsearch or cmscan. cmcalibrate is very slow. It takes a couple of hours to calibrate a single average sized CM on a single CPU"/>
+                <when value="false"/>
+                <when value="true">
+                    <param argument="-L" type="float" value="1.6" min="0.01" max="160" label="Total length of random sequences to search" help="Set random seq length to search in Mb (megabases)"/>
+                    <conditional name="cont_exp_tails_fits" >
+                        <param name="selector" type="select" label="Options controlling exponential tail fits">
+                            <option value="top_n">Fit the top 'n' hits/Mb in thehistogram</option>
+                            <option value="frac">Fit a fraction of the histogram</option>
+                        </param>
+                        <when value="top_n">
+                            <param argument="--gtailn" type="integer" value="250" min="0" label=" Fit the top 'n' hits/Mb in histogram for glocal modes" help=""/>
+                            <param argument="--ltailn" type="integer" value="750" min="0" label=" Fit the top 'n' hits/Mb in histogram for local modes" help=""/>
+                        </when>
+                        <when value="frac">
+                            <param argument="--tailp" type="float" min="0" max="0.6" optional="true" label="Set fraction of histogram tail to fit to exp tail" help=""/>
+                        </when>
+                    </conditional>
+                    <conditional name="output_options_cond">
+                        <param name="selector" type="select" label="Output extra files">
+                            <option value="extra">Output extra files</option>
+                            <option value="none" selected="true">Don't output extra files</option>
+                        </param>
+                        <when value="extra">
+                            <param name="output_options" type="select" label="Optional output files" multiple="true" display="checkboxes">
+                                <option value="hfile">save fitted score histogram(s)</option>
+                                <option value="sfile">save survival plot </option>
+                                <option value="qqfile">save Q-Q plot for score histograms </option>
+                                <option value="ffile">save lambdas for different tail fit probs</option>
+                                <option value="xfile">save scores in fit tail</option>
+                            </param>
+                        </when>
+                        <when value="none"/>
+                    </conditional>
+                    <section name="add_opts" title="Additional Options">
+                        <param argument="--seed" type="integer" value="181"
+                            label="RNG seed" help="If the seed is nonzero, stochas-tic simulations will be reproducible. If 0, the random number generator is seeded arbitrarily"/>
+                        <param argument="--beta" type="float" value="1e-15"
+                            label="Tail loss prob. for query dependent banding (QDB)" help="The beta parameter is the amount of probability mass excluded during band calculation, higher values of beta give greater speedups but sacrifice more accuracy than lower values."/>
+                        <param argument="--nonbanded" truevalue="--nonbanded" falsevalue="" checked="false" type="boolean"
+                            label="Turn off QDB during E-value calibration" help="This will slow down calibration"/>
+                        <param argument="--nonull3" truevalue="--nonull3" falsevalue="" checked="false" type="boolean"
+                            label="Turn off the null3 post hoc additional null model" help="This is not recommended unless you plan on using the same option to cmsearch and/or cmscan"/>
+                        <param argument="--random" truevalue="--random" falsevalue="" checked="false" type="boolean"
+                            label="use GC content of random null background model of CM" help="Use the background null model of the CM to generate the random sequences, instead of the more realistic HMM. Unless the CM was built using the --null option to cmbuild, the background null model will be 25% each A, C, G and U"/>
+                        <param argument="--gc" type="data" format="*" optional="true" label="Use GC content distribution from file" help="Generate the random sequences using the nucleotide distribution from the sequence file"/>
+                    </section>
+                </when>
+            </conditional>
+
+
         </inputs>
     <outputs>
         <data format="text" name="summary_outfile" label="cmbuild summary on ${on_string}">
@@ -175,7 +271,68 @@
             </filter>
         </data>
 
+        <!-- cmcalibrate additional output files -->
+        <data name="hfile" format="txt" label="hfile, an cmcalibrate additional output file, on ${on_string}">
+            <filter>
+                ((
+                Calibrate['selector'] is True and
+                Calibrate['output_options_cond']['selector'] == "extra" and
+                'hfile' in Calibrate['output_options_cond']['output_options']
+                ))
+            </filter>
+        </data>
+        <data name="sfile" format="txt" label="sfile, an cmcalibrate additional output file, on ${on_string}">
+            <filter>
+                ((
+                Calibrate['selector'] is True and
+                Calibrate['output_options_cond']['selector'] == "extra" and
+                'sfile' in Calibrate['output_options_cond']['output_options']
+                ))
+            </filter>
+        </data>
+        <data name="qqfile" format="txt" label="qqfile, an cmcalibrate additional output file, on ${on_string}">
+            <filter>
+                ((
+                Calibrate['selector'] is True and
+                Calibrate['output_options_cond']['selector'] == "extra" and
+                'qqfile' in Calibrate['output_options_cond']['output_options']
+                ))
+            </filter>
+        </data>
+        <data name="ffile" format="txt" label="ffile, an cmcalibrate additional output file, on ${on_string}">
+            <filter>
+                ((
+                Calibrate['selector'] is True and
+                Calibrate['output_options_cond']['selector'] == "extra" and
+                'ffile' in Calibrate['output_options_cond']['output_options']
+                ))
+            </filter>
+        </data>
+        <data name="xfile" format="txt" label="xfile, an cmcalibrate additional output file, on ${on_string}">
+            <filter>
+                ((
+                Calibrate['selector'] is True and
+                Calibrate['output_options_cond']['selector'] == "extra" and
+                'xfile' in Calibrate['output_options_cond']['output_options']
+                ))
+            </filter>
+        </data>
+
     </outputs>
+
+    <tests>
+        <test>
+            <param name="alignment_infile" value="cmbuild_input_tRNA5.sto"/>
+            <conditional name="Calibrate">
+                <param name="selector" value="true"/>
+            </conditional>
+            <output name="outfile">
+                <assert_contents>
+                    <has_text text="S     0    -1 0     1     4     0     1    88   108  -7.713  -8.959  -0.044  -5.412"/>
+                </assert_contents>
+            </output>
+        </test>
+    </tests>
     <help>
 <![CDATA[
 
@@ -268,24 +425,17 @@
   - *Turn on the local alignment algorithm*: allows the alignment to span two or more subsequences if necessary (e.g. if the structures of the query model and target sequence are only partially shared), allowing certain large insertions and deletions in the structure to be penalized differently than normal indels. The default is to globally align the query model to the target sequences.
   - *--gibbs sampling*: Modifies the behavior of --refine so Gibbs sampling is used instead of EM. The difference is that during the alignment stage the alignment is not necessarily optimal, instead an alignment (parsetree) for each sequences is sampled from the posterior distribution of alignments as determined by the Inside algorithm. Due to this sampling step --gibbs is non- deterministic, so different runs with the same alignment may yield different results. This is not true when --refine is used without the --gibbs option, in which case the final alignment and CM will always be the same. When --gibbs is enabled, the --seed "number" option can be used to seed the random number generator predictably, making the results reproducible. The goal of the --gibbs option is to help expert RNA alignment curators refine structural alignments by allowing them to observe alternative high scoring alignments.
   - *--Random seed*: Seed the random number generator with an integer >= 0. This option can only be used in combination with --gibbs. If the given number is nonzero, stochastic sampling of alignments will be reproducible; the same command will give the same results. If the given number is 0, the random number generator is seeded arbitrarily, and stochastic samplings may vary from run to run of the same command. The default seed is 0.
-   - *--Turn off the truncated alignment algorithm*: With --refine, turn off the truncated alignment algorithm. There is more information on this in the cmalign manual page.
+  - *--Turn off the truncated alignment algorithm*: With --refine, turn off the truncated alignment algorithm. There is more information on this in the cmalign manual page.
   - *--cyk algorithm*: With --refine, align with the CYK algorithm. By default the optimal accuracy algorithm is used. There is more information on this in the cmalign manual page.
 
+
 For further questions please refere to the Infernal Userguide_.
 
-.. _Userguide: http://selab.janelia.org/software/infernal/Userguide.pdf
+.. _Userguide: http://eddylab.org/infernal/Userguide.pdf
 
 ]]>
     </help>
-    <citations>
-        <citation type="doi">10.1093/bioinformatics/btt509</citation>
-        <citation type="bibtex">
-            @ARTICLE{bgruening_galaxytools,
-                Author = {Björn Grüning, Cameron Smith, Torsten Houwaart, Nicola Soranzo, Eric Rasche},
-                keywords = {bioinformatics, ngs, galaxy, cheminformatics, rna},
-                title = {{Galaxy Tools - A collection of bioinformatics and cheminformatics tools for the Galaxy environment}},
-                url = {https://github.com/bgruening/galaxytools}
-            }
-        </citation>
-    </citations>
+
+    <expand macro="citations" />
+
 </tool>