view phyloseq_nmds.xml @ 1:e376a618eb9f draft

Updated phyloseq_nmds.R to allow for non standard BIOM files.
author simon-gladman
date Sat, 16 Jun 2018 05:03:43 -0400
parents b4606394e7ec
children 20adf95eb758
line wrap: on
line source

<tool id="phyloseq_nmds" name="Phyloseq NMDS" version="1.22.3.1" hidden="false">
    <description>Phyloseq NMDS plot</description>
    <requirements>
        <requirement type="package" version="1.22.3">bioconductor-phyloseq</requirement>
        <requirement type="package" version="1.20.0">r-getopt</requirement>
        <requirement type="package" version="9.18">ghostscript</requirement>
    </requirements>
    <version_command><![CDATA[
        echo $(R --version | grep version | grep -v GNU)", phyloseq version" $(R --vanilla --slave -e "library(DESeq2); cat(sessionInfo()\$otherPkgs\$DESeq2\$Version)" 2> /dev/null | grep -v -i "WARNING: ")
    ]]></version_command>
    <command detect_errors="exit_code"><![CDATA[
        Rscript '${__tool_directory__}/phyloseq_nmds.R'
        #if str($file_source.file_source_selector) == "set_biom":
            --biom='$file_source.input'
            --subset='$file_source.subsetColumn'
        #else:
            --otu_table='$OTU_TABLE'
            --tax_table='$TAX_TABLE'
            --meta_table='$META_TABLE'
            --category=$file_source.category
        #end if
        --method='$ord_method'
        --distance='$distance'
        --kingdom='$kingdom_field'
        --cutoff=$cutoff
        --keep=$keep
        --outdir='$htmlfile.files_path'
        --htmlfile='$htmlfile'
    ]]>
    </command>
    <inputs>
        <conditional name="file_source">
            <param name="file_source_selector" type="select" label="Choose a file type">
                <option value="set_biom" selected="True">BIOM File</option>
                <option value="set_table">TABULAR Files</option>
            </param>
            <when value="set_biom">
                <param format="biom1" name="input" type="data" label="Input File" help="A biom1 table of the data to be visualised"/>
                <param name="subsetColumn" size="10" type="integer" value="1" label="Select a subset column from metadata table"/>
            </when>
            <when value="set_table">
                <param format="tabular" name="OTU_TABLE" type="data" label="OTU table" help="A table of OTUs"/>
                <param format="tabular" name="TAX_TABLE" type="data" label="Taxonomy table" help="A table of the Taxonomys"/>
                <param format="tabular" name="META_TABLE" type="data" label="Metadata table" help="Table containing all the metadata"/>
                <param name="category" type="data_column" data_ref="META_TABLE" use_header_names="True" label="Select a subset column from metadata table"/>
            </when>
        </conditional>
        <param name="ord_method" type="select" display="radio" label="Select NMDS method">
            <option value="NMDS" selected="true">NMDS</option>
            <option value="DCA">DCA</option>
            <option value="CCA">CCA</option>
            <option value="RDA">RDA</option>
            <option value="DPCoA">DPCoA</option>
            <option value="MDS">MDS</option>
            <option value="PCoA">PCoA</option>
        </param>
        <param name="distance" type="select" display="radio" label="Select a distance for NMDS">
            <option value="bray" selected="true">bray</option>
            <option value="gower">gower</option>
            <option value="unifrac">unifrac</option>
        </param>
        <param name="kingdom_field" type="select" display="radio" label="Select a taxonomy rank">
            <option value="Kingdom">Kingdom</option>
            <option value="Phylum" selected="true">Phylum</option>
            <option value="Class">Class</option>
            <option value="Order">Order</option>
            <option value="Family">Family</option>
            <option value="Genus">Genus</option>
            <option value="Species">Species</option>
        </param>
        <param name="cutoff" size="10" type="integer" value="5" label="cutoff value for filtering OTU table" help="Remove OTUs that do not appear more than 5 times"/>
        <param name="keep" size="10" type="integer" value="5" label="number of most abundant phyla" help="provide the number of most abundancet phyla to display"/>
    </inputs>
    <outputs>
        <data format="html" name="htmlfile" label="${tool.name}.html"/>
    </outputs>
    <tests>
        <test> <!-- Test #1: Test BIOM format input -->
            <!-- Equivalent command (replace + with double dash): Rscript phyloseq_nmds.R +biom=test-data/GP.biom +subset=6 +method=NMDS
            +distance=bray +kingdom=Phylum +cutoff=5 +keep=5 +outdir=outputdir +htmlfile=biom_out.html -->
            <conditional name="file_source">
                <param name="file_source_selector" value="set_biom"/>
                <param name="input" value="GP.biom"/>
                <param name="subsetColumn" value="6" />
            </conditional>
            <output name="htmlfile" ftype="html" file="biom_out.html" />
        </test>
        <test><!-- Test #2: Test TABULAR format inputs -->
            <!-- Equivalent command (replace + with double dash): Rscript phyloseq_nmds.R +otu_table=test-data/GP_OTU_TABLE.txt
            +tax_table=test-data/GP_TAX_TABLE.txt +meta_table=test-data/GP_SAMPLE_TABLE.txt
            +method="bray" +kingdom=Phylum +cutoff=5 + keep=5 +category=6 +outdir=outputdir +htmlfile=test.html -->
            <conditional name="file_source">
                <param name="file_source_selector" value="set_table" />
                <param name="OTU_TABLE" value="GP_OTU_TABLE.txt" />
                <param name="TAX_TABLE" value="GP_TAX_TABLE.txt" />
                <param name="META_TABLE" value="GP_SAMPLE_TABLE.txt" />
                <param name="category" value="6" />
            </conditional>
            <output name="htmlfile" ftype="html" file="test.html" />
        </test>
    </tests>
    <help><![CDATA[
**What it does**
Creates NMDS plot using R package called phyloseq_.

.. _phyloseq: https://joey711.github.io/phyloseq/plot_ordination-examples.html

-----

**Input**

- **Choose a file type** - BIOM File or TABULAR file
- **Select a subset column from metadata table** - This column is used to extract unique value from the column of interest for NMDS plot
- **OTU TABLE** - this is a OTU matrix
- **Taxonomy TABLE** - this is a TAX matrix
- **Metadata TABLE** - this is a metadata file of the experiment design
- **Select NMDS method** - select a method for NMDS plot
- **Select a distance for NMDS** - select a distance option for NMDS plot
- **Select a taxonomy rank** - select a taxonomy for NMDS plot
- **cutoff value for filtering OTU table** - this cutoff value is used to fitler OTU table
- **number of most abundant phyla** - a number of most abundant phyla to be display in NMDS plot
    ]]>
    </help>
    <citations>
        <citation type="doi">10.18129/B9.bioc.phyloseq</citation>
    </citations>
</tool>