diff wiggle_correlation_in_bed.xml @ 0:3d1097835b2f draft default tip

Imported from capsule None
author jjohnson
date Mon, 22 Sep 2014 11:54:41 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wiggle_correlation_in_bed.xml	Mon Sep 22 11:54:41 2014 -0400
@@ -0,0 +1,154 @@
+<tool name="Multiple wiggle files correlation in given regions" id="correlation_dataset_bed" version="0.1.0">
+  <description>Calculate the correlation coefficient on the genome scale using one bed file and multiple wiggle / bigwig files</description>
+  <macros>
+    <import>corr_macros.xml</import>
+  </macros>
+  <expand macro="requirements" />
+  <command>
+#if $maxscore and $minscore and ( $minscore > $maxscore ):
+ echo "maxscore has to be greater than minscore!" 
+ exit 1;
+#end if
+#if $wfile1.extension == "wig"
+ wig_correlation_in_bed_file.py -d $wfile1.metadata.dbkey -m $method
+#elif $wfile1.extension == "bigwig"
+ bigwig_correlation_in_bed_file.py 
+#end if
+#if $maxscore.value
+ --max-score $maxscore
+#end if
+#if $minscore.value
+ --min-score $minscore
+#end if
+ $heatmap -z $size -f PDF -r tmp.r 
+ -b $bfile 
+ -w $wfile1 -l '$wlabel1' -w $wfile2 -l '$wlabel2' 
+#for $m in $more
+ -w $m.wig -l "$m.label"
+#end for
+ &amp;> $log &amp;&amp;
+ cp tmp.r $rscript &amp;&amp;
+#if $imagetype.__str__ == "PNG":
+ convert tmp.r.pdf tmp.r.png &amp;&amp; 
+ cp tmp.r.png $output
+#else
+ cp tmp.r.pdf $output
+#end if
+  </command>
+  <inputs>
+    <param name="bfile" type="data" format="bed" label="BED file(100,000 lines max)" >
+      <validator type="unspecified_build" />
+    </param>
+    <param format="wig,bigwig" name="wfile1" type="data" label="Wiggle / bigwig file 1">
+      <validator type="unspecified_build" />
+    </param>
+    <param name="wlabel1" type="text" label="Wiggle / bigwig label 1" optional="false">
+      <validator type="length" message="must be between 1 and 255 characters" min="1" max="255"/>
+    </param>
+    <param format="wig,bigwig" name="wfile2" type="data" label="Wiggle / bigwig file 2">
+      <validator type="unspecified_build" />
+    </param>
+    <param name="wlabel2" type="text" label="Wiggle / bigwig label 2" optional="false">
+      <validator type="length" message="must be between 1 and 255 characters" min="1" max="255"/>
+    </param>
+    <repeat name="more" title="wiggle / bigwig file">
+      <param format="wig,bigwig" name="wig" type="data" label="Select another wiggle / bigwig file"/>
+      <param name="label" type="text" label="Wiggle / bigwig label" optional="false">
+        <validator type="length" message="must be between 1 and 255 characters" min="1" max="255"/>
+      </param>
+    </repeat>
+    <param name="method" type="select" label="method:" help="method to process the paired two sets of data in the sampling step." >
+      <option value="mean" selected="true">mean</option>
+      <option value="median">median</option>
+      <option value="sample">sample</option>
+    </param>
+    <param name="maxscore" type="float" label="Max Score" help="Maximum score in the calculation (optional)" value="10000" optional="true"/>
+    <param name="minscore" type="float" label="Min Score" help="Minimum score in the calculation (optional)" value="-10000" optional="true"/>
+    <param name="heatmap" type="boolean" label="Draw Heatmap instead?" checked="no"
+	   truevalue="-H" falsevalue=" " />
+    <param name="size" type="integer" label="image Size" value="10" help="Image size in inch. It must be ge 5 and le 20. Default: 10">
+      <validator type="in_range" max="20" min="5" message="image Size is out of range, image Size has to be between 5 to 20" />
+    </param>
+    <param type="select" name="imagetype" display="radio" label="Image Type">
+      <option value="PDF">PDF format</option>
+      <option value="PNG">PNG format</option>
+    </param>
+  </inputs>
+  <outputs>
+    <data format="png" name="output">
+      <change_format>
+	    <when input="imagetype" value="PDF" format="pdf" />
+      </change_format>
+    </data>
+    <data format="txt" name="log" label="correlation job log" />
+    <data format="txt" name="rscript" label="correlation job rscript" />
+  </outputs>
+  <expand macro="stdio"/>
+  <tests>
+    <test>
+      <param name="bfile" value="peaks.bed" />
+      <param name="wfile1" value="control.wig" />
+      <param name="wlabel1" value="control" />
+      <param name="wfile2" value="treatment.wig" />
+      <param name="wlabel2" value="treatment" />
+      <param name="step" value="100" />
+      <param name="method" value="mean" />
+      <param name="maxscore" value="10000" />
+      <param name="minscore" value="-10000" />
+      <param name="size" value="10" />
+      <param name="imagetype" value="PDF" />
+      <output name="log">
+        <assert_contents>
+            <has_text_matching expression="Please check tmp.r" />
+        </assert_contents>
+      </output>
+    </test>
+  </tests>
+  <help>
+This tool calculates the correlation coefficient values on the genome
+scale using many scores datasets (many wiggle files) within the
+regions given by a BED file. The tool is written by Tao Liu. It calls
+R for plotting.
+
+.. class:: infomark
+
+**TIP:** This can be used to evaluate the correlation between
+biological replicates at union peak regions.
+
+.. class:: warningmark
+
+**NEED IMPROVEMENT**
+
+-----
+
+**Parameters**
+
+- **BED file** contains the regions to extract scores.
+- **Wiggle file 1 and 2** are the first two wiggle files to be
+  included. These two are required.
+- **Wiggle label 1 and 2** are the first two wiggle labels to be
+  plotted in the correlation plot.
+- **wiggle files** click *Add new wiggle file* to add more wiggle
+  files and labels. 
+- **Genome/Assembly** Genome assembly to be used. The tool will
+  download the chromosome information from UCSC database.
+- **Method** When scores are extracted for a region in BED file, a
+  method will be applied to calculate a value to represent this
+  region. Options are *median* to use the median value or *mean* to
+  use the average value.
+- **Max Score** is the maximum score in the calculation. It's
+  optional.
+- **Min Score** is the minimum score in the calculation. It's
+  optional.
+
+-----
+
+**Outputs**
+
+- **PNG file** is the correlation plot
+- **LOG file** for job log. If you see errors, please attached this in
+  the bug report
+
+  </help>
+
+</tool>