view screen.seqs.xml @ 5:595419d427b6 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mothur commit be5c8af076296a53959fc3ed2b82d92dc7607eeb
author iuc
date Mon, 23 Apr 2018 09:38:33 -0400
parents 6202ff80199f
children c1feef4d5e34
line wrap: on
line source

<tool profile="16.07" id="mothur_screen_seqs" name="Screen.seqs" version="@WRAPPER_VERSION@.0">
    <description>Screen sequences</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="requirements"/>
    <expand macro="stdio"/>
    <expand macro="version_command"/>
    <command><![CDATA[
@SHELL_OPTIONS@

## create symlinks to input datasets
ln -s '$fasta' fasta.dat &&
ln -s '$names' names.dat &&
ln -s '$groups' groups.dat &&
ln -s '$qfile' qfile.dat &&
ln -s '$count' count.dat &&
ln -s '$taxonomy' taxonomy.dat &&
ln -s '$summary' summary.dat &&
#if $contigsrep.usecontigs == "yes":
    ln -s '$contigsrep.contigsreport' contigsreport.dat &&
#end if
#if $alignrep.usealign == "yes":
    ln -s '$alignrep.alignreport' alignreport.dat &&
#end if

echo 'screen.seqs(
    fasta=fasta.dat
    #if int($start) > -1:
        ,start=$start
    #end if
    #if int($end) > -1:
        ,end=$end
    #end if
    #if int($minlength) > -1:
        ,minlength=$minlength
    #end if
    #if int($maxlength) > -1:
        ,maxlength=$maxlength
    #end if
    #if int($maxambig) > -1:
        ,maxambig=$maxambig
    #end if
    #if int($maxhomop) > -1:
        ,maxhomop=$maxhomop
    #end if
    #if int($criteria) > -1:
        ,criteria=$criteria
    #end if
    #if $optimize:
        ,optimize=$optimize
    #end if
    #if $qfile:
        ,qfile=qfile.dat
    #end if
    #if $names:
        ,name=names.dat
    #end if
    #if $groups:
        ,group=groups.dat
    #end if
    #if $taxonomy:
        ,taxonomy=taxonomy.dat
    #end if
    #if $count:
        ,count=count.dat
    #end if
    #if $summary:
        ,summary=summary.dat
    #end if
    #if $contigsrep.usecontigs == "yes":
        ,contigsreport=contigsreport.dat
        ,minoverlap=$contigsrep.minoverlap
        ,ostart=$contigsrep.ostart
        ,oend=$contigsrep.oend
        ,mismatches=$contigsrep.mismatches
    #end if
    #if $alignrep.usealign == "yes":
        ,alignreport=alignreport.dat
        ,minsim=$alignrep.minsim
        ,minscore=$alignrep.minscore
        ,maxinsert=$alignrep.maxinsert
    #end if
    ,processors='"\${GALAXY_SLOTS:-8}"'
)'
| sed 's/ //g'  ## mothur trips over whitespace
| mothur
| tee mothur.out.log
    ]]></command>
    <inputs>
        <param argument="fasta" type="data" format="fasta,mothur.align" label="fasta - Fasta to screen"/>
        <param argument="start" type="integer" value="-1" label="start - Remove sequences that start after position (ignored when negative)"/>
        <param argument="end"   type="integer" value="-1" label="end - Remove sequences that end before position (ignored when negative)"/>
        <param argument="minlength" type="integer" value="10" label="minlength - Remove sequences shorter than (ignored when negative)"/>
        <param argument="maxlength" type="integer" value="-1" label="maxlength - Remove sequences longer than (ignored when negative)"/>
        <param argument="maxambig"  type="integer" value="-1" label="maxambig - Remove sequences with ambiguous bases greater than (ignored when negative)"/>
        <param argument="maxhomop"  type="integer" value="-1" label="maxhomop - Remove sequences with homopolymers greater than (ignored when negative)"/>
        <param argument="criteria"  type="integer" value="-1" label="criteria - Percent of sequences that an optimize value must match to be retained (ignored when negative)"/>
        <param argument="optimize"  type="select" multiple="true" display="checkboxes" label="optimize - Optimize selected paramenters">
            <option value="start">start</option>
            <option value="end">end</option>
            <option value="minlength">minlength</option>
            <option value="maxlength">maxlength</option>
            <option value="maxambig">maxambig</option>
            <option value="maxhomop">maxhomop</option>
        </param>
        <param argument="qfile"   type="data" format="qual" optional="true" label="qfile - Sequence Quality file to screen"/>
        <param argument="names"   type="data" format="mothur.names" optional="true" label="name - Sequence Names to screen"/>
        <param argument="groups"  type="data" format="mothur.groups" optional="true" label="group - Groups to screen"/>
        <param argument="summary" type="data" format="mothur.summary" optional="true" label="summary file - as created by summary.seqs"
            help="saves processing time when screening with parameters in the summary file"/>
        <param argument="taxonomy" type="data" format="taxonomy" optional="true" label="taxonomy - Taxonomy to screen"/>
        <param argument="count" type="data" format="mothur.count_table" optional="true" label="count - a count_table" help="generated by count.seqs"/>
        <conditional name="alignrep">
            <param name="usealign" type="select" label="Perform screening using an alignment report?" help="An alignment report is created by the align.seqs tool.
                If you provide the alignment report file you can screen your sequences using the following parameters: minsim, minscore, and maxinsert">
                <option value="yes">Yes</option>
                <option value="no" selected="true">No</option>
            </param>
            <when value="yes">
                <param argument="alignreport" type="data" format="mothur.align.report" label="alignreport - Align Report to screen with"/>
                <param argument="minsim"     type="integer" value="-1" min="-1" label="minsim - Minimum similarity to template sequences during alignment"/>
                <param argument="minscore"   type="integer" value="-1" min="-1" label="minscore - Minimum search score during alignment (ignored when negative)"/>
                <param argument="maxinsert"  type="integer" value="-1" min="-1" label="maxinsert - Maximum number of insertions during alignment (ignored when negative)"/>
            </when>
            <when value="no"/>
        </conditional>
        <conditional name="contigsrep">
            <param name="usecontigs" type="select" label="Perform screening using a contigsreport?" help="A contigsreport is created by the make.contigs tool.
                If you provide the contigs report file you can screen your sequences using the following parameters: minoverlap, ostart, oend and mismatches">
                <option value="yes">Yes</option>
                <option value="no" selected="true">No</option>
            </param>
            <when value="yes">
                <param argument="contigsreport" type="data" format="tabular" label="contigsreport - Contigs Report to screen with"
                    help="this file is created by the make.contigs command"/>
                <param argument="minoverlap" type="integer" value="-1" min="-1" label="minoverlap - Minimum overlap length (ignored when negative)"/>
                <param argument="ostart"     type="integer" value="-1" min="-1" label="ostart - Position the overlap must start by (ignored when negative)"/>
                <param argument="oend"       type="integer" value="-1" min="-1" label="oend - Position the overlap must end after (ignored when negative)"/>
                <param argument="mismatches" type="integer" value="-1" min="-1" label="mismatches - Maximum number of mismatches (ignored when negative)"/>
            </when>
            <when value="no"/>
        </conditional>
        <expand macro="param-savelog"/>
    </inputs>
    <outputs>
        <expand macro="logfile-output"/>
        <data name="fasta_out" format_source="fasta" from_work_dir="fasta*.good.dat" label="${tool.name} on ${on_string}: good.${fasta.datatype.file_ext}"/>
        <data name="bad_accnos" format="mothur.accnos" from_work_dir="fasta*.bad.accnos" label="${tool.name} on ${on_string}: bad.accnos"/>
        <data name="qfile_out" format_source="qfile" from_work_dir="qfile*.good.dat" label="${tool.name} on ${on_string}: qfile">
            <filter>qfile</filter>
        </data>
        <data name="names_out" format="mothur.names" from_work_dir="names*.good.dat" label="${tool.name} on ${on_string}: names">
            <filter>names</filter>
        </data>
        <data name="groups_out" format="mothur.groups" from_work_dir="groups*.good.dat" label="${tool.name} on ${on_string}: groups">
            <filter>groups</filter>
        </data>
        <data name="alignreport_out" format="mothur.align.report" from_work_dir="alignreport.good.align.report" label="${tool.name} on ${on_string}: align.report">
            <filter>alignrep.alignreport</filter>
        </data>
        <data name="contigsreport_out" format="tabular" from_work_dir="contigsreport.good.contigs.report" label="${tool.name} on ${on_string}: contigs.report">
            <filter>contigsrep.contigsreport</filter>
        </data>
        <data name="count_out" format="mothur.count_table" from_work_dir="count*.good.dat" label="${tool.name} on ${on_string}: count">
            <filter>count</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="fasta" value="Mock_S280_L001_R1_001_small.trim.contigs.fasta" ftype="fasta"/>
            <param name="maxambig" value="0"/>
            <param name="maxlength" value="275"/>
            <output name="fasta_out" file="Mock_S280_L001_R1_001_small.trim.contigs.good.fasta" ftype="fasta"/>
            <output name="bad_accnos" file="Mock_S280_L001_R1_001_small.trim.contigs.bad.accnos" ftype="mothur.accnos"/>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test with count table -->
            <param name="fasta" value="amazon.fasta" ftype="mothur.align"/>
            <param name="count" value="amazon1.count_table"/>
            <param name="maxambig" value="0"/>
            <param name="maxlength" value="500"/>
            <output name="fasta_out" ftype="mothur.align">
                <assert_contents>
                    <expand macro="test-fasta-format"/>
                    <has_text text="U68638"/>
                    <not_has_text text="U68589"/>
                </assert_contents>
            </output>
            <output name="count_out" ftype="mothur.count_table">
                <assert_contents>
                    <expand macro="test-count-format"/>
                    <has_text text="U68638"/>
                    <not_has_text text="U68589"/>
                </assert_contents>
            </output>
            <output name="bad_accnos" ftype="mothur.accnos">
                <assert_contents>
                    <expand macro="test-accnos-format"/>
                    <not_has_text text="U68638"/>
                    <has_text text="U68589"/>
                    <has_text text="ambig"/>
                    <has_text text="length"/>
                </assert_contents>
            </output>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test screening with contigsreport -->
            <param name="fasta" value="Mock_S280_L001_R1_001_small.trim.contigs.fasta" ftype="fasta"/>
            <param name="maxambig" value="0"/>
            <param name="maxlength" value="275"/>
            <param name="usecontigs" value="yes"/>
            <param name="contigsreport" value="Mock_S280_L001_R1_001_small.contigs.report"/>
            <param name="mismatches" value="18"/>
            <output name="fasta_out" file="Mock_S280_L001_R1_001_small.trim.contigs.good.fasta" ftype="fasta"/>
            <output name="bad_accnos" ftype="mothur.accnos">
                <assert_contents>
                    <expand macro="test-accnos-format"/>
                    <has_text text="mismatches"/>
                    <has_text text="ambig"/>
                </assert_contents>
            </output>
            <output name="contigsreport_out" ftype="tabular">
                <assert_contents>
                    <expand macro="test-contigsreport-format"/>
                    <not_has_text text="M00967_43_000000000-A3JHG_1_1101_22487_4260"/>
                    <has_text text="M00967_43_000000000-A3JHG_1_1101_15923_3823"/>
                </assert_contents>
            </output>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test screening with alignment report -->
            <param name="fasta" value="Mock_S280_L001_R1_001_small.trim.contigs.good.fasta" ftype="fasta"/>
            <param name="maxambig" value="0"/>
            <param name="maxlength" value="275"/>
            <param name="usealign" value="yes"/>
            <param name="alignreport" value="Mock_S280_L001_R1_001_small.trim.contigs.good.align.report"/>
            <param name="minscore" value="100"/>
            <output name="fasta_out" ftype="fasta">
                <assert_contents>
                    <expand macro="test-fasta-format"/>
                    <not_has_text text="M00967_43_000000000-A3JHG_1_1101_14010_4122"/>
                    <has_text text="M00967_43_000000000-A3JHG_1_1101_19936_3208"/>
                </assert_contents>
            </output>
            <output name="bad_accnos" ftype="mothur.accnos">
                <assert_contents>
                    <expand macro="test-accnos-format"/>
                    <has_text text="score"/>
                </assert_contents>
            </output>
            <output name="alignreport_out" ftype="mothur.align.report">
                <assert_contents>
                    <expand macro="test-alignreport-format"/>
                    <not_has_text text="M00967_43_000000000-A3JHG_1_1101_14010_4122"/>
                    <has_text text="M00967_43_000000000-A3JHG_1_1101_19936_3208"/>
                </assert_contents>
            </output>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
    </tests>
    <help><![CDATA[

@MOTHUR_OVERVIEW@

**Command Documentation**

The screen.seqs_ command enables you to keep sequences that fulfill certain user defined criteria. Furthermore, it enables you to cull those sequences not meeting the criteria from a name_, group_, or align.report_ file.

.. _name: https://www.mothur.org/wiki/Name_file
.. _group: https://www.mothur.org/wiki/Group_file
.. _align.report: https://www.mothur.org/wiki/Align.seqs
.. _screen.seqs: https://www.mothur.org/wiki/Screen.seqs

    ]]></help>
    <expand macro="citations"/>
</tool>