diff geneBody_coverage.xml @ 3:71ed55a3515a draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/rseqc commit 37fb1988971807c6a072e1afd98eeea02329ee83
author iuc
date Tue, 14 Mar 2017 10:22:57 -0400
parents f92b87abef3d
children caaa120457bc
line wrap: on
line diff
--- a/geneBody_coverage.xml	Thu Jul 18 11:01:08 2013 -0500
+++ b/geneBody_coverage.xml	Tue Mar 14 10:22:57 2017 -0400
@@ -1,63 +1,126 @@
-<tool id="geneBody_coverage" name="Gene Body Converage (BAM)">
-	<description>
-		Read coverage over gene body.
-	</description>
-	<requirements>
-		<requirement type="package" version="2.15.1">R</requirement>
-		<requirement type="package" version="2.3.7">rseqc</requirement>
-	</requirements>
-	<command interpreter="python">
-		geneBody_coverage.py -i $input -r $refgene -o output
-	</command>
-	<inputs>
-		<param name="input" type="data" label="Input .bam file" format="bam" />
-		<param name="refgene" type="data" label="Reference Genome" format="bed" />
-	</inputs>
-	<outputs>
-		<data name="outputpdf" format="pdf" from_work_dir="output.geneBodyCoverage.pdf" />
-		<data name="outputr" format="r" from_work_dir="output.geneBodyCoverage_plot.r" />
-		<data name="outputtxt" format="txt" from_work_dir="output.geneBodyCoverage.txt" />
-	</outputs>
-	<tests>
-		<test>
-			<param name="input" value="Pairend_nonStrandSpecific_36mer_Human_hg19.bam" />
-			<param name="refgene" value="hg19_RefSeq.bed" />
-			<output name="outputpdf" file="gbcout.geneBodyCoverage.pdf" />
-			<output name="outputr" file="gbcout.geneBodyCoverage_plot.r" />
-			<output name="outputtxt" file="gbcout.geneBodyCoverage.txt" />
-		</test>
-	</tests>
-	<help>
-.. image:: https://code.google.com/p/rseqc/logo?cct=1336721062
+<tool id="rseqc_geneBody_coverage" name="Gene Body Converage (BAM)" version="@WRAPPER_VERSION@">
+  <description>
+    Read coverage over gene body.
+  </description>
+
+  <macros>
+    <import>rseqc_macros.xml</import>
+  </macros>
+
+    <expand macro="requirements" />
+
+  <expand macro="stdio" />
+
+  <version_command><![CDATA[geneBody_coverage.py --version]]></version_command>
+
+  <command><![CDATA[
+    #import re
+    #set $input_list = []
+    #for $i, $input in enumerate($inputs):
+        #set $safename = re.sub('[^\w\-_]', '_', $input.element_identifier)
+        #if $safename in $input_list:
+            #set $safename = str($safename) + "." + str($i)
+        #end if
+        $input_list.append($safename)
+        ln -sf '${input}' '${safename}.bam' &&
+        ln -sf '${input.metadata.bam_index}' '${safename}.bam.bai' &&
+        echo '${safename}.bam' >> 'input_list.txt' &&
+    #end for
+    geneBody_coverage.py -i 'input_list.txt' -r '${refgene}' --minimum_length ${minimum_length} -o output
+    ]]>
+  </command>
+
+  <inputs>
+    <param name="inputs" type="data" label="Input .bam file(s)" format="bam" help="(--input-file)" multiple="true"/>
+    <expand macro="refgene_param" />
+    <param name="minimum_length" type="integer" value="100" label="Minimum mRNA length (default: 100)" help="Minimum mRNA length in bp, mRNA that are shorter than this value will be skipped (--minimum_length)." />
+    <expand macro="rscript_output_param" />
+  </inputs>
 
------
-
-About RSeQC
-+++++++++++
+  <outputs>
+    <data name="outputcurvespdf" format="pdf" from_work_dir="output.geneBodyCoverage.curves.pdf" label="${tool.name} on ${on_string} (Curves pdf)" />
+    <data name="outputheatmappdf" format="pdf" from_work_dir="output.geneBodyCoverage.heatMap.pdf" label="${tool.name} on ${on_string} (HeatMap pdf)">
+      <filter>len(inputs) >= 3</filter>
+    </data>
+    <expand macro="rscript_output_data" filename="output.geneBodyCoverage.r" />
+    <data name="outputtxt" format="txt" from_work_dir="output.geneBodyCoverage.txt" label="${tool.name} on ${on_string} (text)" />
+  </outputs>
 
-The RSeQC package provides a number of useful modules that can comprehensively evaluate high throughput sequence data especially RNA-seq data. “Basic modules” quickly inspect sequence quality, nucleotide composition bias, PCR bias and GC bias, while “RNA-seq specific modules” investigate sequencing saturation status of both splicing junction detection and expression estimation, mapped reads clipping profile, mapped reads distribution, coverage uniformity over gene body, reproducibility, strand specificity and splice junction annotation.
+  <!-- PDF Files contain R version, must avoid checking for diff -->
+  <tests>
+    <test>
+      <param name="inputs" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam" />
+      <param name="refgene" value="hg19_RefSeq_chr1_1-100000.bed" />
+      <param name="rscript_output" value="true" />
+      <output name="outputcurvespdf" file="output.geneBodyCoverage.curves.pdf" compare="sim_size" />
+      <output name="outputr" file="output.geneBodyCoverage.r" />
+      <output name="outputtxt" file="output.geneBodyCoverage.txt" />
+    </test>
+    <test>
+      <param name="inputs" value="pairend_strandspecific_51mer_hg19_chr1_1-100000.bam,pairend_strandspecific_51mer_hg19_chr1_1-100000.bam,pairend_strandspecific_51mer_hg19_chr1_1-100000.bam" />
+      <param name="refgene" value="hg19_RefSeq_chr1_1-100000.bed" />
+      <param name="rscript_output" value="true" />
+      <output name="outputcurvespdf" file="output2.geneBodyCoverage.curves.pdf" compare="sim_size" />
+      <output name="outputheatmappdf" file="output2.geneBodyCoverage.heatMap.pdf" compare="sim_size" />
+      <output name="outputr" file="output2.geneBodyCoverage.r" />
+      <output name="outputtxt" file="output2.geneBodyCoverage.txt" />
+    </test>
 
-The RSeQC package is licensed under the GNU GPL v3 license.
+  </tests>
+
+  <help><![CDATA[
+## geneBody_coverage.py
+
+Read coverage over gene body. This module is used to check if read coverage is uniform and if there is any 5\'/3\' bias. This module scales all transcripts to 100 nt and calculates the number of reads covering each nucleotide position. Finally, it generates plots illustrating the coverage profile along the gene body.
+
+If 3 or more BAM files were provided. This program generates a lineGraph and a heatmap. If fewer than 3 BAM files were provided, only lineGraph is generated. See below for examples.
 
-Inputs
-++++++++++++++
+When heatmap is generated, samples are ranked by the "skewness" of the coverage: Sample with best (worst) coverage will be displayed at the top (bottom) of the heatmap.
+Coverage skewness was measured by `Pearson’s skewness coefficients <http://en.wikipedia.org/wiki/Skewness#Pearson.27s_skewness_coefficients>`_
+
+.. image:: $PATH_TO_IMAGES/geneBody_workflow.png
+:width: 800 px
+:scale: 80 %
+
+
+## Inputs
 
 Input BAM/SAM file
-	Alignment file in BAM/SAM format.
+    Alignment file in BAM/SAM format.
 
 Reference gene model
-	Gene Model in BED format.
+    Gene Model in BED format.
 
+Minimum mRNA length
+    Minimum mRNA length (bp). mRNA that are shorter than this value will be skipped (default is 100).
+
+    ## Outputs
 
-Outputs
-++++++++++++++
+Text
+    Table that includes the data used to generate the plots
 
-Read coverage over gene body. This module is used to check if reads coverage is uniform and if there is any 5’/3’ bias. This module scales all transcripts to 100 nt and calculates the number of reads covering each nucleotide position. Finally, it generates a plot illustrating the coverage profile along the gene body. NOTE: this module requires lots of memory for large BAM files, because it load the entire BAM file into memory. We add another script "geneBody_coverage2.py" into v2.3.1 which takes bigwig (instead of BAM) as input. It only use 200M RAM, but users need to convert BAM into WIG, and then WIG into BigWig.
+R Script
+    R script file that reads the data and generates the plot
+
+PDF
+    The final plot, in PDF format
 
-Example output:
-	.. image:: http://dldcc-web.brc.bcm.edu/lilab/liguow/RSeQC/figure/geneBody_coverage.png
-
+Example plots:
+.. image:: $PATH_TO_IMAGES/Aug_26.geneBodyCoverage.curves.png
+:height: 600 px
+:width: 600 px
+:scale: 80 %
 
+.. image:: $PATH_TO_IMAGES/Aug_26.geneBodyCoverage.heatMap.png
+:height: 600 px
+:width: 600 px
+:scale: 80 %
 
-	</help>
-</tool>
\ No newline at end of file
+@ABOUT@
+
+    ]]>
+  </help>
+
+  <expand macro="citations" />
+
+</tool>