diff heatmapr.xml @ 0:4e52505adaa6

Imported from capsule None
author jjohnson
date Wed, 17 Sep 2014 15:03:26 -0400
parents
children 0476ee45d253
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/heatmapr.xml	Wed Sep 17 15:03:26 2014 -0400
@@ -0,0 +1,205 @@
+<tool name="Heatmap" id="ceas_heatmapr" version="0.1.0">
+  <description>Draw the scores heatmap near a given interval set and use k-means to cluster the intervals</description>
+  <macros>
+    <import>ceas_macros.xml</import>
+  </macros>
+  <expand macro="requirements_bx" />
+  <command>
+#set $tmp = str($wfile)
+#set $ttitle = "\""+str($title)+"\""
+#set $txlabel = "\""+str($xlabel)+"\""
+#set $tylabel = "\""+str($ylabel)+"\""
+#for $m in $more
+#set $tmp = $tmp + "," + str($m.wfile)
+###set $ttitle = $ttitle + ",\"" + str($m.title)+"\""
+#set $txlabel = $txlabel + ",\"" + str($m.xlabel)+"\""
+#set $tylabel = $tylabel + ",\"" + str($m.ylabel)+"\""
+#end for
+#set $advparam = " --title="+str($ttitle)+" --subtitle="+str($txlabel)+" --y_label="+str($tylabel)
+
+#if $methodadvopt.methodadvopt_select == "kmeans"
+#set $methodopt = " --method="+str($methodadvopt.methodadvopt_select)+" -k "+str($methodadvopt.kmeans)+" --k_wigindex="+str($methodadvopt.k_wigindex)
+#else if $methodadvopt.methodadvopt_select == "none"
+#set $methodopt = " --method="+str($methodadvopt.methodadvopt_select)
+#else
+#set $methodopt = " --method="+str($methodadvopt.methodadvopt_select)+" --s_wigindex="+str($methodadvopt.s_wigindex)
+#end if
+
+#if $advopt.advopt_select == "yes"
+#set $advparam = $advparam+" -s "+str($advopt.saturation)+" --upstream="+str($advopt.upstrm)+" --downstream="+str($advopt.dnstrm)+" --pf-res="+str($advopt.step)+" --fontsize="+str($advopt.fontsize)+" --col="+str($advopt.colors)+" --pic_width="+str($advopt.pic_width)+" --pic_height="+str($advopt.pic_height)+" "+str($advopt.horizontal_line)+" "+str($advopt.vertical_line)+" "+str($advopt.dir)+" "+str($advopt.set_seed)
+
+#if $advopt.zmax.value
+#set $advparam = $advparam+" --zmax="+str($advopt.zmax)
+#end if
+#if $advopt.zmin.value
+#set $advparam = $advparam+" --zmin="+str($advopt.zmin)
+#end if
+#else
+#set $advparam = " "
+#end if
+##
+heatmapr -b $bfile -w $wfile 
+#if $wfile.extension == "wig"
+--wig_format="wig"
+#elif $wfile.extension == "bigwig"
+--wig_format="bigwig"
+#end if
+ --name=$name $methodopt $advparam &amp;> $log &amp;&amp;
+Rscript output_kmeans.r 
+  </command>
+  <inputs>
+    <param name="name" type="hidden" value="output"/>
+    <param format="bed" name="bfile" type="data" label="BED file(center will be aligned, 100,000 lines max)" />
+    <param format="wig,bigwig" name="wfile" type="data" label="wig / bigwig file" />
+    <param name="title" type="text" label="Title for the whole heatmap plot" value="Heatmap" />
+    <param name="xlabel" type="text" label="Subtitle for heatmap plot" value="subtitle" />
+    <param name="ylabel" type="text" label="Y-label for heatmap plot" value="Y-label" />
+    <repeat name="more" title="More wig / bigwig files">
+      <param format="wig,bigwig" name="wfile" type="data" label="WIGGLE file" />
+      <param name="xlabel" type="text" label="Subtitle for heatmap plot" value="subtitle" />
+      <param name="ylabel" type="text" label="Y-label for heatmap plot" value="Y-label" />
+    </repeat>
+    <conditional name="methodadvopt">
+      <param name="methodadvopt_select" type="select" label="choose sort/clustering method">
+        <option value="kmeans">cluster - kmeans</option>
+        <option value="median">only sort - median</option>
+        <option value="maximum">only sort - maximun</option>
+        <option value="mean">only sort - mean</option>
+        <option value="none">none - keep original order of bed.</option>
+      </param>
+      <when value="kmeans">
+        <param name="kmeans" type="integer" label="K-means number" value="5">
+          <validator type="in_range" max="10" min="3" message="K-means is out of range, K-means has to be between 3 to 10" /></param>      
+        <param name="k_wigindex" type="text" label="use which wigs to calc kmeans. input 'all' or sth like '1,2,4' (use the 1st, 2nd and 4th wig.)" value="all" />
+      </when>
+      <when value="median">
+        <param name="s_wigindex" type="integer" label="key wig file for sorting" value="1" />
+      </when>
+      <when value="maximum">
+        <param name="s_wigindex" type="integer" label="key wig file for sorting" value="1" />
+      </when>
+      <when value="mean">
+        <param name="s_wigindex" type="integer" label="key wig file for sorting" value="1" />
+      </when>
+    </conditional>
+    <conditional name="advopt">
+      <param name="advopt_select" type="select" label="Advanced Options">
+        <option value="no">No</option>
+        <option value="yes">Yes</option>
+      </param>
+      <when value="yes">
+        <param name="step" type="integer" label="Step" value="10">
+          <validator type="in_range" max="1000" min="5" message="step is out of range, step has to be between 5 to 1000" />
+        </param>
+        <param name="saturation" type="float" label="Saturation" value="0.01" />
+        <param name="upstrm" type="integer" label="Upstream" value="500">
+          <validator type="in_range" max="10000" min="100" message="Upstream is out of range, Upstream has to be between 100 to 10000" />
+        </param>
+        <param name="dnstrm" type="integer" label="Downstream" value="500">
+          <validator type="in_range" max="10000" min="100" message="Downstream is out of range, Downstream has to be between 100 to 10000" />
+        </param>
+        <param name="fontsize" type="integer" label="Image fontsize. (better not change)" value="1" />
+        <param name="colors" type="text" size="100" label="colorRamp for the legend of heatmap, from low value to high, use ','to split" value="053061,2166AC,4393C3,92C5DE,D1E5F0,F7F7F7,FDDBC7,F4A582,D6604D,B2182B,67001F" />
+        <param name="pic_width" type="integer" label="Heatmap width" value="1920">
+        <validator type="in_range" max="16000" min="1600" message="Heatmap wodth is out of range, width has to be between 1600 to 16000" />
+        </param>
+        <param name="pic_height" type="integer" label="Heatmap height" value="1440">
+          <validator type="in_range" max="12000" min="1200" message="Heatmap height is out of range, height has to be between 1200 to 12000" />
+        </param>
+        <param name="zmin" type="text" label="minimum value in image" />
+        <param name="zmax" type="text" label="maximum value in image" />
+        <param name="horizontal_line" type="boolean" label="Plot classified lines?" checked="no" truevalue="-z" falsevalue=" " />
+        <param name="vertical_line" type="boolean" label="Plot vertical line?" checked="no" truevalue="-v" falsevalue=" " />
+        <param name="dir" type="boolean" label="consider the direction (+/-) while profiling" checked="no" truevalue="--dir" falsevalue=" " />
+        <param name="set_seed" type="boolean" label="Set seed to make result reproducible (for developers)" checked="no" truevalue="--set-seed" falsevalue=" " />
+      </when>
+      <when value="no" />
+    </conditional>
+  </inputs>
+  <outputs>
+    <data format="png" name="outputpng" label="Heatmap image" from_work_dir="output_r.heatmap.png"/>
+    <data format="txt" name="outputr" label="Heatmapr R script" from_work_dir="output_kmeans.r"/>
+    <data format="tabular" name="outputbed" label="Heatmap k-means classified regions" from_work_dir="output_peak_classid"/>
+    <data format="txt" name="log" label="Heatmap log" />
+  </outputs>
+  <expand macro="stdio" />
+  <tests>
+    <test>
+      <param name="wfile" value="treatment.wig" />
+      <param name="bfile" value="peak.bed" />
+      <param name="title" value="title" />
+      <param name="xlabel" value="xlabel" />
+      <param name="ylabel" value="ylabel" />
+      <param name="methodadvopt_select" value="kmeans" />
+      <param name="kmeans" value="5" />
+      <param name="advopt_select" value="yes" />
+      <param name="k_wigindex" value="1" />
+      <param name="step" value="10" />
+      <param name="upstrm" value="500" />
+      <param name="dnstrm" value="400" />
+      <param name="fontsize" value="2" />
+      <param name="colors" value="053061,2166AC,4393C3,92C5DE,D1E5F0,F7F7F7,FDDBC7,F4A582,D6604D,B2182B,67001F" />
+      <param name="zmin" value="" />
+      <param name="zmax" value="" />
+      <param name="pic_width" value="1600" />
+      <param name="pic_height" value="1200" />
+      <param name="horizontal_line" value="-z" />
+      <param name="vertical_line" value="-v" />
+      <param name="dir" value=" " />
+      <param name="set_seed" value="--set-seed" />
+      <output name="outputbed">
+        <assert_contents>
+          <has_text_matching expression="1\tchr19\t58470227\t58470701\tMACS_peak_9625\t113.34" />
+        </assert_contents>
+      </output>
+    </test>
+  </tests>
+  <help>
+This tool draws the scores heatmap near a given interval set..It's
+based on sitrpro script in Hyunjin Shin's library. Original code is
+written by Jian Ma. It uses
+R module for kmeans clustering and draw the heatmap.
+
+.. class:: warningmark
+
+**NEED IMPROVEMENT**
+
+-----
+
+**Parameters**
+
+- **BED file** contains the regions to extract the scores from WIGGLE
+- **K-means (Advanced)** defines the number of classes in k-means
+  clustering.
+  files.
+- **WIGGLE file** contains the scores for heatmap.
+- **More WIGGLE file** click the *Add new More WIGGLE files* to add
+  more. All the heatmap for the WIGGLE files will be aligned and
+  clutered together. 
+- **Advanced Options** to turn on advanced settings. You will lose
+  advanced settings and go back to default parameters when you choose
+  'No'.
+- **Upstream/Downstream (Advanced)** size around regions in BED file.
+- **Step (Advanced)** is the profiling resolution in bps.
+- **Saturation** before the script use the score data to draw heatmap, 
+  it will saturate the data to a narrow scale. For example, if you set 
+  the option to 0.1, The data smaller than 10% of the data or bigger 
+  than 90% of the data will be saturated to 10% or 90% of the data.
+- **col_low/col_high** is the color of legend for images.
+- **pic_width/pic_height** is the size of heatmap image.
+- **zmin/zmax** is the max value and min value for the legend bar.
+- **horizontal_line** lines in black to separate the clusters.
+
+-----
+
+**Outputs**
+
+- *PNG file* is the heatmap image
+- *clustering result file* Contain the clustering results from the
+  tool. The 'Score' column (5th column) contains the cluster indices.
+- *Log* for job log. If you see errors, please attached this in
+  the bug report
+
+  </help>
+
+</tool>