Repository 'collector_curve'
hg clone https://toolshed.g2.bx.psu.edu/repos/qfab/collector_curve

Changeset 0:f4d86766f766 (2014-05-30)
Next changeset 1:03ab673e45cb (2014-05-30)
Commit message:
Uploaded
added:
collectorcurve/README.txt
collectorcurve/collectorcurve.sh
collectorcurve/collectorcurve.xml
collectorcurve/repository_dependencies.xml
collectorcurve/test-data/collectorsummary.tabular
collectorcurve/test-data/reads2otu.rabund
collectorcurve/tool_dependencies.xml
b
diff -r 000000000000 -r f4d86766f766 collectorcurve/README.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/collectorcurve/README.txt Fri May 30 03:16:03 2014 -0400
b
@@ -0,0 +1,37 @@
+Galaxy wrappers for mothur's Collector Curve Tool (collect.single)
+=========================================================================
+
+The Collector Curve Tool generates collector's curves using calculators, 
+that describe the richness, diversity, and other features of individual 
+samples.
+
+
+Installation
+=========================================================================
+
+Galaxy will automatically install the required dependencies:
+- executable mothur (please note for OSX 64-bit mothur 1.30.2 will be 
+installed, due to issues with the required Readline library and compilers)
+- metagenomics datatypes
+
+
+Disclaimer
+=========================================================================
+
+This source code is provided by QFAB Bioinformatics "as is", in the hope 
+that it will be useful, and any express or implied warranties, including, 
+but not limited to, the implied warranties of merchantability and fitness 
+for a particular purpose are disclaimed.
+IN NO EVENT SHALL QFAB BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOURCE
+CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License
+=========================================================================
+
+This work by QFAB Bioinformatics (as part of the GVL project
+http://genome.edu.au)
+is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0
+International License.
b
diff -r 000000000000 -r f4d86766f766 collectorcurve/collectorcurve.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/collectorcurve/collectorcurve.sh Fri May 30 03:16:03 2014 -0400
[
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+echo $@
+
+command=''
+filetype=$1
+input=$2
+label=$3
+echo label is $label
+if [ $label != 'None' ]; then
+ labelformatted=${label//,/-}
+ command+=', 'label=$labelformatted
+fi
+output=$4
+outputid=$5
+outputpath=$6
+calc=$7
+advanced=$8
+if [ $advanced == True ]; then
+     cabund=$9
+     abund=${10}
+     if [ $cabund == True ]; then
+      command+=', 'abund=$abund
+     fi
+     csize=${11}
+     size=${12}
+     if [ $csize == True ]; then
+        if [ $size != 0 ]; then
+           command+=', 'size=$size
+       fi 
+     fi
+     cfreq=${13}
+     freq=${14}
+     if [ $cfreq == True ]; then
+        command+=', 'freq=$freq
+        echo $command
+     fi
+fi
+
+
+echo path: $outputpath id: $outputid
+## get filename only remove the extension
+file="${input%.*}"
+echo `cp $input $file'.'$filetype`
+inputfile=$file'.'$filetype
+calculator=${calc//,/-}
+IFS=',' read -a sum_calc <<< "$calc"
+for element in "${sum_calc[@]}"
+do
+    if [[ "$element" != "nseqs" ]] && [[ "$element" != "coverage" ]] && [[ "$element" != "sobs" ]]
+    then
+      sum_calculator+='-'$element
+    fi
+done
+#echo "collect.single($filetype=$inputfile, calc=$calc)"
+## use Mothur collect.single to calculate collector's curve - alpha diversity
+#mothur "#summary.single($filetype=$inputfile, calc=$calculator$command)"
+mothur "#summary.single($filetype=$inputfile, calc=nseqs-coverage-sobs$sum_calculator$command)"
+mothur "#collect.single($filetype=$inputfile, calc=$calculator$command)" 
+IFS=, read -a calcs <<< "${calc}"
+count=0
+##copy summary as main output
+echo `cp $file'.summary' $output`
+#copy calc files into directory
+for i in "${calcs[@]}"
+do
+   #if [ $count == 0 ]; then
+   #   echo `cp $file'.'$i $output`
+   #else
+      echo `cp $file'.'$i $outputpath'/primary_'$outputid'_'$i'_visible_tabular'`
+   #fi
+   let count+=1
+done
b
diff -r 000000000000 -r f4d86766f766 collectorcurve/collectorcurve.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/collectorcurve/collectorcurve.xml Fri May 30 03:16:03 2014 -0400
b
b'@@ -0,0 +1,262 @@\n+<tool id="mothur_collect_single" name="Collector Curve" version="1.0" force_history_refresh="True">\n+ <description>Calculate and plot collector\'s curves for OTUs</description>\n+ <requirements>\n+   <requirement type="binary">@BINARY@</requirement>\n+   <requirement type="package" version="1.30.2-1.33.3">mothur</requirement>\n+ </requirements>\n+ <command interpreter="bash">\n+  collectorcurve.sh   \n+  #if isinstance($otu.datatype, $__app__.datatypes_registry.get_datatype_by_extension(\'shared\').__class__):\n+   shared\n+  #elif isinstance($otu.datatype, $__app__.datatypes_registry.get_datatype_by_extension(\'rabund\').__class__):\n+   rabund\n+  #elif isinstance($otu.datatype, $__app__.datatypes_registry.get_datatype_by_extension(\'sabund\').__class__):\n+   sabund\n+  #elif isinstance($otu.datatype, $__app__.datatypes_registry.get_datatype_by_extension(\'list\').__class__):\n+   list\n+  #end if\n+  $otu\n+  $label\n+  $output\n+  $output.id \n+  $__new_file_path__\n+  #if $calc.__str__ != "None" and len($calc.__str__) > 0:\n+     $calc\n+  #end if\n+  $advancedoption.advanced\n+  #if $advancedoption.advanced:\n+    $advancedoption.abundoption.cabund\n+    #if $advancedoption.abundoption.cabund:\n+      $advancedoption.abundoption.abund\n+    #else\n+     \'\'\n+    #end if\n+    $advancedoption.sizeoption.csize\n+    #if $advancedoption.sizeoption.csize:\n+      $advancedoption.sizeoption.size\n+    #else\n+     \'\'\n+    #end if\n+    $advancedoption.freqoption.cfreq\n+    #if $advancedoption.freqoption.cfreq:\n+      $advancedoption.freqoption.freq\n+    #else\n+      \'\'\n+    #end if\n+  #end if\n+ </command>\n+ <inputs>\n+  <param name="otu" type="data" format="rabund,sabund,list,shared" label="OTU list (rabund, sabund, list or shared format)" help="The rabund output from the \'Map Reads to OTU\' tool"/>\n+  <param name="label" type="select" label="Labels - OTU labels" multiple="true" help="Select one or more labels to calculate the collector\'s curve for. By default all labels are selected" >\n+   <options>\n+    <filter type="data_meta" ref="otu" key="labels" />\n+   </options>\n+  </param>\n+  <param name="calc" type="select" label="Calculators" multiple="true" help="Select one or more calculators for collector\'s curve generation. By default chao, invsimpson and npshannon are selected. Please see the description for information on the calculators.">\n+   <option value="ace">ace</option>\n+   <option value="bootstrap">bootstrap</option>\n+   <option value="chao" selected="true">chao</option>\n+   <option value="jack">jack</option>\n+   <option value="sobs">sobs</option>\n+   <option value="simpsoneven">simpsoneven</option>\n+   <option value="shannoneven">shannoneven</option>\n+   <option value="heip">heip</option>\n+   <option value="smithwilson">smithwilson</option>\n+   <option value="bergerparker">bergerparker</option>\n+   <option value="coverage">coverage</option>\n+   <option value="goodscoverage">goodscoverage</option>\n+   <option value="simpson">simpson</option>\n+   <option value="invsimpson" selected="true">invsimpson</option>\n+   <option value="qstat">qstat</option>\n+   <option value="shannon">shannon</option>\n+   <option value="npshannon" selected="true">npshannon</option>\n+   <option value="boneh">boneh</option>\n+   <option value="efron">efron</option>\n+   <option value="shen">shen</option>\n+   <option value="solow">solow</option>\n+   <option value="logseries">logseries</option>\n+   <option value="geometric">geometric</option>\n+   <option value="bstick">bstick</option>\n+   <option value="nseqs">nseqs</option>\n+  </param>\n+  <conditional name="advancedoption">\n+    <param name="advanced" type="boolean" value="true" label="Please select to show and specify advanced option" help="Advanced options including specification of ACE Estimator threshold for abundant versus rare OTUs, sample size for OTU predicition and frequency for output."/>\n+    <when value="true">\n+  \t<conditional name="abundoption">\n+    \t   <param name="cabund" type="boolean" value="true" label="Se'..b"data follow the log series distribution       |\n+  +---------------+-----------------------------------------------------------------------------------------------+\n+  | geometric     | Statistical distribution tests whether observed data follow the geometric series distribution |\n+  +---------------+-----------------------------------------------------------------------------------------------+\n+  | bstick        | Statistical distribution tests whether observed data follow the broken stick distribution     |\n+  +---------------+-----------------------------------------------------------------------------------------------+\n+  | nseqs         | Utility the number of sequences in a sample                                                   |\n+  +---------------+-----------------------------------------------------------------------------------------------+\n+\n+\n+----------------------------\n+Optional advanced parameters\n+----------------------------\n+\n+ACE estimator threshold\n+  By default the ACE estimator uses 10 as the cutoff between OTUs that are rare and abundant. So if an OTU has more than 10 individuals in it, then it is considered abundant. This is really just an empirical decision and we are merely following the lead of Anne Chao and others who implement 10 in their software. If you would like to use a different cutoff, you can use the abund option.\n+\n+Size - Sample Size\n+  Within the suite of calculators available in mothur are a set that will predict the number of additional OTUs that will be observed for a given sample size. By default these calculators will base the prediction on a sample that is the same size as the initial sampling. If you would like to use a different sample size, use the size option.\n+  The value of size should be between 1 and the size of the initial sampling.   \n+\n+Frequency\n+  For larger datasets you might not be interested in obtaining all of the data for the number of sequences sampled. For instance, if you have 100,000 sequences, you may only want to output the data every 100 sequences. Alternatively, if you only have 100 sequences, you may only want to output all of the data. \n+  The default setting is to output data every 100 sequences.\n+\n+------\n+Output\n+------\n+\n+.. class:: warningmark\n+\n+Please note, the number of outputs is depending on the number of selected calculators. Each selected calculator will result in an extra output, which is indicated by the calculator name in brackets at the end of the output's filename. In case the outputs for the selected calculators are **not** showing in the History panel, refresh your history by clicking on the refresh icon.\n+\n+\n+(A) A summary file in table format containing the following fields, number of sequences, the sample coverage, the number of observed OTUs, the chao richness estimate, the invsimpson diversity estimate, and the npshannon non-parametric diversity estimate. The summary gives results for each of the listed fields when all available data is used.\n+\n+(B) Followed by a file for each calculator selected (indicated by the calculator's name in brackets at the end of the output's filename) which can be plotted as collector's curve and used to evaluate how the results of the calculator change with sampling effort.\n+\n+.. class:: infomark\n+\n+\n+Use Galaxy's integrated visualization tool to plot the collector's curve. The visualization tool is accessible via the 'Visualize' icon in the extended dataset information area. After having launched the integrated visualization tool select the 'Data Controls' tab. In the 'Data Controls' tab select column 1 (number sampled) as 'Data column for X' and use column 2 (minimum identity, according to select labels) as 'Data column for Y'.\n+\n+-----\n+\n+=========\n+Resources\n+=========\n+\n+mothur_\n+\n+.. _http://www.mothur.org\n+\n+**Author**\n+\n+Patrick D. Schloss (pschloss@umich.edu)\n+\n+**Wrapper Author**\n+\n+QFAB Bioinformatics (support@qfab.org)\n+based on jjohnson mothur_toolsuite wrapper\n+\n+ </help>\n+</tool>\n"
b
diff -r 000000000000 -r f4d86766f766 collectorcurve/repository_dependencies.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/collectorcurve/repository_dependencies.xml Fri May 30 03:16:03 2014 -0400
b
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<repositories description="This requires the metagenomics datatype definitions (e.g. the rabund format).">
+ <repository changeset_revision="ccba8612695e" name="metagenomics_datatypes" owner="qfab" toolshed="http://toolshed.g2.bx.psu.edu/" />
+</repositories> 
b
diff -r 000000000000 -r f4d86766f766 collectorcurve/test-data/collectorsummary.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/collectorcurve/test-data/collectorsummary.tabular Fri May 30 03:16:03 2014 -0400
b
@@ -0,0 +1,2 @@
+label nseqs coverage sobs chao chao_lci chao_hci invsimpson invsimpson_lci invsimpson_hci npshannon
+0.03 1339.000000 0.707244 537.000000 1956.185185 1555.232438 2515.022419 39.469114 32.778553 49.591415 5.683962
b
diff -r 000000000000 -r f4d86766f766 collectorcurve/test-data/reads2otu.rabund
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/collectorcurve/test-data/reads2otu.rabund Fri May 30 03:16:03 2014 -0400
b
@@ -0,0 +1,1 @@
+0.03 537 4 13 15 2 1 5 23 1 3 6 1 3 3 1 1 1 1 1 1 2 4 1 20 3 1 17 1 6 4 61 1 6 17 191 7 1 27 1 5 1 2 1 13 1 1 1 1 8 1 7 3 6 1 15 1 1 1 1 1 1 3 1 7 4 1 6 9 1 6 2 2 1 19 2 1 7 1 1 17 1 1 1 4 1 1 1 2 3 1 6 8 8 1 5 4 1 6 1 1 1 2 8 2 1 2 7 2 4 3 5 3 1 1 1 5 5 1 2 1 1 4 1 12 2 1 1 2 2 7 1 1 2 1 1 3 1 1 1 4 4 1 1 7 1 1 4 1 2 3 1 1 1 7 3 1 2 1 1 1 1 1 1 1 1 1 1 12 1 4 1 4 1 1 1 1 1 4 1 1 1 3 1 1 1 4 1 1 2 1 1 6 1 1 3 2 1 2 5 1 2 1 1 1 5 2 1 1 1 1 1 1 1 4 1 1 1 2 1 4 2 1 1 2 2 1 1 2 7 4 1 1 1 2 1 1 1 1 2 1 2 2 1 2 1 1 2 1 1 1 2 2 1 1 1 2 1 1 1 1 2 2 1 4 2 1 1 1 2 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 6 1 1 1 1 1 1 1 1 1 2 3 5 1 1 1 1 1 3 2 3 1 1 1 1 5 1 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 3 1 1 2 3 1 1 6 1 1 1 1 1 1 1 1 1 1 4 4 4 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
b
diff -r 000000000000 -r f4d86766f766 collectorcurve/tool_dependencies.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/collectorcurve/tool_dependencies.xml Fri May 30 03:16:03 2014 -0400
b
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<tool_dependency>
+  <package name="mothur" version="1.30.2-1.33.3">
+    <repository changeset_revision="150982d8fd53" name="package_mothur" owner="qfab" toolshed="http://toolshed.g2.bx.psu.edu/" />
+  </package>
+</tool_dependency>
+