changeset 3:5a2bda9b28c5 draft

New version 1.22.3.2.
author simon-gladman
date Mon, 30 Jul 2018 21:06:56 -0400
parents 20adf95eb758
children d06ddf67468f
files README.md phyloseq_nmds.xml
diffstat 2 files changed, 106 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.md	Mon Jul 30 21:06:56 2018 -0400
@@ -0,0 +1,51 @@
+# Phloseq_NMDS
+
+A Galaxy tool to produce NMDS plots using Phyloseq from either a BIOM1 file or 2 input tables.
+
+Currently produces the plots embedded in a html file for output with links to a PDF file.
+
+Requires:
+
+Phyloseq 1.22.3
+r-getopt 1.20.0
+ghostscript 9.18
+
+
+### Run phyloseq_nmds.R with three input files
+Rscript phyloseq_nmds.R --otu_table=GP_OTU_TABLE.txt --tax_table=GP_TAX_TABLE.txt --meta_table=GP_SAMPLE_TABLE.txt --method="bray" --kingdom=2 --cutoff=5 --category=6 --outdir=/outputdir --htmlfile=test.html
+
+### Run phyloseq_nmds.R with biom file
+Rscript phyloseq_nmds.R --biom=GP.biom --subset=6 --method=NMDS --distance=bray --kingdom=Phylum --cutoff=5 --keep=5 --outdir=/outputdir --htmlfile=biom_out.html
+
+## Version history:
+
+**XML Wrapper:**
+
+Alpha version by Michael Thang of QFAB, Australia.
+
+1.22.3.1: Simon Gladman Melbourne Bioinformatics
+
+* Incorporated tests
+* Requirements
+* Version statement
+* Citations
+
+1.22.3.2: Michael Thang QFAB, Simon Gladman Melbourne Bioinformatics
+
+* Uses new version of BIOM1 datatype to get metadata
+* Output label changed as per user requirements
+
+
+**R Script: phyloseq_nmds.R**
+
+0.1.0: Michael Thang QFAB
+
+* Original version
+
+0.1.1: Michael Thang QFAB
+
+* Added extra BIOM import functionality so it doesn't solely rely on phyloseq's internal importer.
+
+0.1.2: Michael Thang QFAB
+
+* BIOM functionality now requires the column header name in text.
--- a/phyloseq_nmds.xml	Fri Jul 20 00:23:53 2018 -0400
+++ b/phyloseq_nmds.xml	Mon Jul 30 21:06:56 2018 -0400
@@ -1,5 +1,5 @@
-<tool id="phyloseq_nmds" name="Phyloseq NMDS" version="1.22.3.1" hidden="false">
-    <description>Phyloseq NMDS plot</description>
+<tool id="phyloseq_nmds" name="Phyloseq Ordination Plot" version="1.22.3.2" hidden="false">
+    <description>Ordination Plotting</description>
     <requirements>
         <requirement type="package" version="1.22.3">bioconductor-phyloseq</requirement>
         <requirement type="package" version="1.20.0">r-getopt</requirement>
@@ -32,16 +32,14 @@
     </command>
 
     <inputs>
-
         <conditional name="file_source">
-            <param name="file_source_selector" type="select" label="Choose a file type">
+            <param name="file_source_selector" type="select" label="Choose an input file type">
                 <option value="set_biom" selected="True">BIOM File</option>
                 <option value="set_table">TABULAR File</option>
             </param>
             <when value="set_biom">
                 <param format="biom1" name="input" type="data" label="Input File"/>
-                <!--<param format="tabular" name="META_COLUMN" type="data" label="Column File"/>-->
-                <param name="subsetColumn" type="select" label="Select a column">
+                <param name="subsetColumn" type="select" label="Select variable for ordination">
                     <options>
                         <filter type="data_meta" ref="input" key="table_column_metadata_headers" />
                     </options>
@@ -51,28 +49,26 @@
                 <param format="tabular" name="OTU_TABLE" type="data" label="OTU table"/>
                 <param format="tabular" name="TAX_TABLE" type="data" label="Taxonomy table"/>
                 <param format="tabular" name="META_TABLE" type="data" label="Metadata table"/>
-                <param name="category" type="data_column" data_ref="META_TABLE" use_header_names="True" label="Select a column"/>
+                <param name="category" type="data_column" data_ref="META_TABLE" use_header_names="True" label="Select variable for ordination"/>
             </when>
         </conditional>
-        <param name="plot_type" type="select" label="Type of Plot" help="NMDS plot by type (e.g., OTU, SAMPLE)">
-            <option value="1">OTU</option>
-            <option value="2">SAMPLE</option>
+        <param name="ord_method" type="select" display="radio" label="Select Ordination method">
+            <option value="NMDS" selected="true">NMDS(Non-metric Multidimensional Scalling)</option>
+            <option value="DCA">DCA (Detrended Correspondence Analysis)</option>
+            <option value="CCA">CCA (Constrained Correspondence Analysis)</option>
+            <option value="RDA">RDA (Redundancy Analysis)</option>
+            <option value="DPCoA">DPCoA (Double Principle Coordinate Analysis)</option>
+            <option value="MDS">MDS (Multidimensional Scaling)</option>
+            <option value="PCoA">PCoA (Principal Coordinate Analysis)</option>
         </param>
-        <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 name="distance" type="select" display="radio" label="Select Distance method">
+            <option value="bray" selected="true">bray (Bray-Curtis distance)</option>
+            <option value="gower">gower (Gower's distance)</option>
+            <option value="jsd">jds (Jensen-Shannon Divergence)</option>
+            <option value="unifrac">unifrac (unweighted UniFrac distance)</option>
+            <option value="wunifrac">wunifrac (weighted-UniFrac distance)</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">
+        <param name="kingdom_field" type="select" display="radio" label="Select a taxonomic rank for the analysis">
             <option value="Kingdom">Kingdom</option>
             <option value="Phylum" selected="true">Phylum</option>
             <option value="Class">Class</option>
@@ -81,30 +77,34 @@
             <option value="Genus">Genus</option>
             <option value="Species">Species</option>
         </param>
-            <param name="nsample" size="10" type="float" value="0.5" label="Number of samples to keep" help="The percentage of sample number to keep for analysis (e.g., 0.5 is equivalent to half of the samples to keep for analysis)"/>
-            <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"/>
+        <param name="plot_type" type="select" label="Type of Plot" help="Ordination plot type (Plot OTUs, Plot SAMPLE, Biplot graphic, Split plot graphic)">
+            <option value="1">OTU</option>
+            <option value="2">SAMPLE</option>
+        </param>
+        <param name="nsample" size="10" type="float" value="0.5" label="Specify the number of samples to discard" help="i.e. remove OTUs from the analysis that do not appear more than X times in more than Y% of the samples (where 1.0 = 100%)"/>
+        <param name="cutoff" size="10" type="integer" value="5" label="specify value of X" help="Remove OTUs that do not appear more than X times (e.g., 5 times)"/>
+        <param name="keep" size="10" type="integer" value="5" label="Number of the most abundant taxonomic rank units to keep" help="e.g. Phyla, Class and etc"/>
     </inputs>
 
     <outputs>
-       <data format="html" name="htmlfile" label="${tool.name}.html"/>
+        <data format="html" name="htmlfile" label="${tool.name} - ${ord_method.value_label}_${distance.value_label}.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 -->
+        <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" format="biom1"/>
+                <param name="input" value="GP.biom" />
                 <param name="subsetColumn" value="Primer" />
             </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 -->
+        <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" />
@@ -126,17 +126,28 @@
 
 **Input**
 
-- **Choose a file type** - BIOM File or TABULAR file
-- **Select a column** - This column is used to extract unique value from the column of interest for NMDS plot
+- **Choose an input file type** - BIOM File or TABULAR file
+- **Select variable for ordination** - This column is used to extract unique value from the column of interest for ordination 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
-- **Number of samples to keep** - Number of samples to keep for analysis
-- **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
+- **Select Ordination method** - select ordination method
+- **Select Distance method** - select distance method for ordination plot
+- **Select a taxonomic rank for the analysis** - select a taxonomy for NMDS plot
+- **Specify the number of samples to discard** - Y% of samples to discard (where 1.0 = 100%)
+- **specify value of X** - Remove OTUs that do not appear more than X times (e.g., 5 times)
+- **Number of the most abundant taxonomic rank units** - taxonomic rank units (e.g. Phyla, Class etc) to keep
+
+-----
+
+=========
+Resources
+=========
+
+**Wrapper Authors**
+
+QFAB Bioinformatics (support@qfab.org)
+Melbourne Bioinformatics
     </help>
     <citations>
         <citation type="doi">10.18129/B9.bioc.phyloseq</citation>