view rarefaction.shared.xml @ 6:50312cd2fc7a draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/mothur commit debdcdbb89f9bf3e2c3eed05cb078eddb27d4684"
author iuc
date Mon, 02 Dec 2019 05:54:48 -0500
parents 419266a5e29e
children 64c70653e86d
line wrap: on
line source

<tool profile="16.07" id="mothur_rarefaction_shared" name="Rarefaction.shared" version="@WRAPPER_VERSION@.0">
    <description>Generate inter-sample rarefaction curves for OTUs</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 '$otu' otu.dat &&
#if $designc.usedesign == "yes":
    ln -s '$designc.design' designc.design.dat &&
#end if

echo 'rarefaction.shared(
    shared=otu.dat,
    #if $label:
        label=${ str($label).replace(",","-") },
    #end if
    #if $groups
        groups=${ str($groups).replace(",","-") },
    #end if
    #if $designc.usedesign == "yes":
        design=designc.design.dat,
        #if $designc.sets:
            sets=${ str($designc.sets).replace(",","-") },
        #end if
    #end if
    #if $subsample.usess == "yes":
        #if $subsample.subsamplesize:
            subsample=$subsample.subsamplesize,
        #else
            subsample=T,
        #end if
        #if $subsample.subsampleiters:
            subsampleiters=$subsample.subsampleiters,
        #end if
    #end if
    calc=${ str($calc).replace(",","-") },
    iters=$iters
    $jumble
)'
| sed 's/ //g'  ## mothur trips over whitespace
| mothur
| tee mothur.out.log
    ]]></command>
    <inputs>
        <param name="otu" type="data" format="mothur.shared" label="shared - OTU Shared"/>
        <param name="label" type="select" label="label - OTU Labels" multiple="true">
            <expand macro="labeloptions"/>
        </param>
        <param name="groups" type="select" label="groups - Groups to analyze" multiple="true"
            help="All groups will be analyzed by default if none are selected">
            <options>
                <filter type="data_meta" ref="otu" key="groups"/>
            </options>
        </param>
        <conditional name="designc">
            <param name="usedesign" type="select" label="run on a per set basis using a design file?">
                <option value="no" selected="true">no</option>
                <option value="yes">yes</option>
            </param>
            <when value="yes">
                <param name="design" type="data" format="mothur.design" label="design - assigns groups to sets"
                    help="design has 2 columns: group(col 1) and grouping(col 2) (separated by a TAB character) use make.design"/>
                <param name="sets" type="select" multiple="true" label="sets - group sets to analyze">
                    <options>
                        <filter type="data_meta" ref="design" key="groups"/>
                    </options>
                </param>
            </when>
            <when value="no"/>
        </conditional>
        <param name="iters" type="integer" value="1000" min="0" label="iters - Number of randomizations"/>
        <param name="jumble" type="boolean" truevalue=",jumble=true" falsevalue="" checked="false" label="jumble?"
            help="Obviously, the goal of rarefaction is to randomize across the samples; however, if you just want a
            collector's curve across the samples you can use the jumble option"/>
        <param name="calc" type="select" label="calc - Calculators " multiple="true">
            <option value="sharedobserved" selected="true">sharedobserved - the number of sequences in two samples</option>
            <option value="sharednseqs">sharednseqs - the number of sequences in two samples</option>
        </param>
        <conditional name="subsample">
            <param name="usess" type="select" label="produce subsample rarefactions?">
                <option value="no" selected="true">no</option>
                <option value="yes">yes</option>
            </param>
            <when value="yes">
                <param name="subsamplesize" type="integer" value="" optional="true" label="subsample - size pergroup of the sample"
                    help="Leave blank to use the size of your smallest group"/>
                <param name="subsampleiters" type="integer" value="0" optional="true" label="subsampleiters - Number of times to run the subsample"/>
            </when>
            <when value="no"/>
        </conditional>
        <expand macro="param-savelog"/>
    </inputs>
    <outputs>
        <expand macro="logfile-output"/>
        <data name="rarefaction" format="tabular" from_work_dir="otu.shared.rarefaction" label="${tool.name} on ${on_string}: shared.rarefaction">
            <filter>designc['usedesign'] == 'no' and 'sharedobserved' in calc</filter>
        </data>
        <data name="rarefaction2" format="tabular" from_work_dir="otu.shared.r_nseqs" label="${tool.name} on ${on_string}: shared.r_nseqs">
            <filter>designc['usedesign'] == 'no' and 'sharednseqs' in calc</filter>
        </data>
        <data name="group_rarefaction" format="tabular" from_work_dir="otu.groups.rarefaction" label="${tool.name} on ${on_string}: groups.rarefaction">
            <filter>designc['usedesign'] == 'yes'</filter>
        </data>
        <collection name="rarefaction_subsample_sharedobserved" type="list" label="${tool.name} on ${on_string}: shared.rarefaction">
            <filter>subsample['usess'] == 'yes' and 'sharedobserved' in calc</filter>
            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.shared\.rarefaction" format="tabular"/>
        </collection>
        <collection name="rarefaction_subsample_sharednseqs" type="list" label="${tool.name} on ${on_string}: shared.r_nseqs">
            <filter>subsample['usess'] == 'yes' and 'sharednseqs' in calc</filter>
            <discover_datasets pattern=".*?\.(?P&lt;designation&gt;.*)\.shared\.r_nseqs" format="tabular"/>
        </collection>
    </outputs>
    <tests>
        <test><!-- test with default values -->
            <param name="otu" value="amazon.an.shared" ftype="mothur.shared"/>
            <output name="rarefaction">
                <assert_contents>
                    <has_text text="numsampled"/>
                    <has_text text="lci"/>
                    <has_text text="hci"/>
                    <has_text text="unique"/>
                    <has_text text="0.22"/>
                    <has_text text="0.33"/>
                    <has_text text="0.55"/>
                </assert_contents>
            </output>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test with label, group and calc select -->
            <param name="otu" value="amazon.an.shared" ftype="mothur.shared"/>
            <param name="groups" value="forest,pasture"/>
            <param name="label" value="0.22,0.55"/>
            <param name="calc" value="sharedobserved,sharednseqs"/>
            <output name="rarefaction">
                <assert_contents>
                    <has_text text="numsampled"/>
                    <has_text text="lci"/>
                    <has_text text="hci"/>
                    <not_has_text text="unique"/>
                    <has_text text="0.22"/>
                    <not_has_text text="0.33"/>
                    <has_text text="0.55"/>
                </assert_contents>
            </output>
            <output name="rarefaction2">
                <assert_contents>
                    <has_text text="numsampled"/>
                    <has_text text="lci"/>
                    <has_text text="hci"/>
                    <not_has_text text="unique"/>
                    <has_text text="0.22"/>
                    <not_has_text text="0.33"/>
                    <has_text text="0.55"/>
                </assert_contents>
            </output>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
        <test><!-- test with design file -->
            <param name="otu" value="amazon.an.shared" ftype="mothur.shared"/>
            <param name="usedesign" value="yes"/>
            <param name="design" value="toymothur.design2" ftype="mothur.design"/>
            <param name="sets" value="tardis,dalek"/>
            <output name="group_rarefaction">
                <assert_contents>
                    <has_text text="numsampled"/>
                    <has_text text="lci"/>
                    <has_text text="hci"/>
                    <has_text text="unique"/>
                    <has_text text="0.22"/>
                    <has_text text="0.33"/>
                    <has_text text="0.55"/>
                </assert_contents>
            </output>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>
        <!-- segfaults when subsampling on some files, known bug, devs promise to fix in next release
        <test><!- - test with subsampling - ->
            <param name="otu" value="esophagus.fn.shared" ftype="mothur.shared"/>
            <param name="usess" value="yes"/>
            <param name="subsampleiters" value="42"/>
            <param name="calc" value="sharedobserved,sharednseqs"/>
            <output name="rarefaction">
                <assert_contents>
                    <has_text text="numsampled"/>
                    <has_text text="lci"/>
                    <has_text text="hci"/>
                    <has_text text="unique"/>
                    <has_text text="0.22"/>
                    <has_text text="0.33"/>
                    <has_text text="0.55"/>
                </assert_contents>
            </output>
            <output_collection name="rarefaction_subsample_sharedobserved" count="36">
                <element name="ave-std.0.14" ftype="tabular">
                    <assert_contents>
                        <has_text text="numsampled"/>
                        <has_text text="lci"/>
                        <has_text text="hci"/>
                        <has_text text="ave"/>
                        <has_text text="std"/>
                        <has_text text="0.14"/>
                    </assert_contents>
                </element>
            </output_collection>
            <output_collection name="rarefaction_subsample_sharednseqs" count="36">
                <element name="ave-std.0.14" ftype="tabular">
                    <assert_contents>
                        <has_text text="numsampled"/>
                        <has_text text="lci"/>
                        <has_text text="hci"/>
                        <has_text text="ave"/>
                        <has_text text="std"/>
                        <has_text text="0.14"/>
                    </assert_contents>
                </element>
            </output_collection>
            <param name="savelog" value="true"/>
            <expand macro="logfile-test"/>
        </test>-->
    </tests>
    <help><![CDATA[

@MOTHUR_OVERVIEW@

**Command Documentation**

The rarefaction.shared_ command generates inter-sample rarefaction curves using a re-sampling without replacement approach. The traditional way that ecologists use rarefaction is not to randomize the sampling order within a sample, rather between samples. For instance, if we wanted to know the number of OTUs in the human colon, we might sample from various sites within the colon, and sequence a bunch of 16S rRNA genes. By determining the number of OTUs in each sample and comparing the composition of those samples it is possible to determine how well you have sampled the biodiversity within the individual.  For calc parameter choices see: https://www.mothur.org/wiki/Calculators

.. _rarefaction.shared: https://www.mothur.org/wiki/Rarefaction.shared

    ]]></help>
    <expand macro="citations">
        <citation type="bibtex"><![CDATA[
@book{magurran2013measuring,
  title={Measuring biological diversity},
  author={Magurran, Anne E},
  year={2013},
  publisher={John Wiley \& Sons}
}
        ]]></citation>
    </expand>
</tool>