changeset 0:f5fa293605ca draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/intervene commit 9b67be72f7330b1b9af7944aa695c9f5d6d20a15
author iuc
date Wed, 12 Sep 2018 13:22:43 -0400
parents
children 08780101bc36
files intervene_pairwise.xml intervene_upset.xml macros.xml static/images/pairwise.png static/images/upset.png test-data/a.bed test-data/a.txt test-data/b.bed test-data/b.txt test-data/bed_pairwise.pdf test-data/bed_upset.pdf test-data/c.bed test-data/c.txt test-data/upset.pdf
diffstat 14 files changed, 252 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/intervene_pairwise.xml	Wed Sep 12 13:22:43 2018 -0400
@@ -0,0 +1,96 @@
+<tool id="intervene_pairwise" name="Pairwise intersection" version="@TOOL_VERSION@">
+    <description>and heatmap for genomic intervals</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <requirements>
+        <requirement type="package" version="@TOOL_VERSION@">intervene</requirement>
+    </requirements>
+    <command detect_errors="exit_code"><![CDATA[
+#import re
+#set $labels = ",".join(["'%s'" % @ESCAPE_IDENTIFIER@ for file in $input])
+#set $type = 'genomic 'if $input[0].is_of_type('interval') else 'list'
+intervene pairwise
+--type $type
+--input #echo " ".join(["'%s'" % file for file in $input])
+--names $labels
+--compute $compute
+#if str($corrtype) != 'None'
+    --corr
+    --corrtype $corrtype
+#end if
+--htype $htype
+$diagonal
+--output results
+--barcolor '$barcolor'
+--fontsize '$fontsize'
+--title '$title'
+--figtype $figtype
+--figsize $figsize_width $figsize_height
+--dpi $dpi &&
+mv results/Intervene_pairwise_*.${figtype} results/Intervene_pairwise.plot
+    ]]></command>
+    <inputs>
+        <param argument="--input" type="data" format="interval" multiple="true" label="Select input files for which to produce intersections"/>
+        <param argument="--compute" type="select" label="Use this metric for the heatmap">
+            <option value="count">count: calculates the number of overlaps</option>
+            <option value="frac" selected="true">frac: calculates the fraction of overlap</option>
+            <option value="jaccard">jaccard: calculate the Jaccard statistic</option>
+            <option value="reldist">reldist: calculate the distribution of relative distances</option>
+            <!-- fisher option needs additional genome assembly, probably triggers on demand download
+            <option value="fisher">fisher: calculate Fisher`s statistic</option>
+            -->
+        </param>
+        <param argument="--corrtype" type="select" label="Select the type of correlation">
+            <option value="None">Don't calculate correlation</option>
+            <option value="pearson">Pearson correlation</option>
+            <option value="kendall">Kendall correlation</option>
+            <option value="spearman">Spearman correlation</option>
+        </param>
+        <param argument="--htype" type="select" label="Heatmap plot type">
+            <option value="tribar">tribar</option>
+            <option value="dendrogram">dendrogram</option>
+            <option value="color">color</option>
+            <option value="pie">pie</option>
+            <option value="circle">circle</option>
+            <option value="square">square</option>
+            <option value="ellipse">ellipse</option>
+            <option value="number">number</option>
+            <option value="shade">shade</option>
+        </param>
+        <param argument="--diagonal" type="boolean" truevalue="--diagonal" falsevalue="" label="Show the diagonal values in the heatmap ?"/>
+        <!-- the argparse action is wrong for showsize, check this when upgrading tool in future -->
+        <param argument="--barcolor" type="color" label="Boxplot color" value="#53cfff">
+            <expand macro="color_sanitizer"/>
+        </param>
+        <param argument="--fontsize" type="integer" value="8" label="Label font size"/>
+        <param argument="--title" type="text" label="Heatmap main title" value="Pairwise intersection">
+            <expand macro="quote_sanitizer"/>
+        </param>
+        <expand macro="figure_params"/>
+    </inputs>
+    <outputs>
+        <data name="plot" format="pdf" label="Pairwise plot on ${on_string}" from_work_dir="results/Intervene_pairwise.plot">
+            <actions>
+                <action type="format">
+                    <option type="from_param" name="figtype"/>
+                </action>
+            </actions>
+        </data>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input" value="a.bed,b.bed,c.bed"/>
+            <output name="plot" value="bed_pairwise.pdf" compare="sim_size"/>
+        </test>
+    </tests>
+    <help><![CDATA[
+**What it does**
+
+Plots the pairwise intersections of multiple interval files.
+
+.. image:: $PATH_TO_IMAGES/pairwise.png
+
+    ]]></help>
+    <expand macro="citations"/>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/intervene_upset.xml	Wed Sep 12 13:22:43 2018 -0400
@@ -0,0 +1,84 @@
+<tool id="intervene_upset" name="UpSet diagram" version="@TOOL_VERSION@">
+    <description>of intersection of genomic regions or list sets</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <requirements>
+        <requirement type="package" version="@TOOL_VERSION@">intervene</requirement>
+    </requirements>
+    <command detect_errors="exit_code"><![CDATA[
+#import re
+#set $labels = ",".join(["'%s'" % @ESCAPE_IDENTIFIER@ for file in $input])
+#set $type = 'genomic 'if $input[0].is_of_type('interval') else 'list'
+intervene upset
+--type $type
+--input #echo " ".join(["'%s'" % file for file in $input])
+--names $labels
+--output results
+--order $order
+--ninter $ninter
+$showzero
+$showsize
+--mbcolor '$mbcolor'
+--sbcolor '$sbcolor'
+--mblabel '$mblabel'
+--sxlabel '$sxlabel'
+--figtype $figtype
+--figsize $figsize_width $figsize_height
+--dpi $dpi &&
+mv results/Intervene_upset.${figtype} results/Intervene_upset.plot
+    ]]></command>
+    <inputs>
+        <param argument="--input" type="data" format="txt" multiple="true" label="Select input files for which to produce intersections"/>
+        <param argument="--order" type="select" label="Select the order of intersections of sets">
+            <option value="freq">Frequency</option>
+            <option value="degree">Degree</option>
+        </param>
+        <param argument="--ninter" type="integer" value="30" min="1" label="Number of top intersections to show in plot"/>
+        <param argument="--showzero" type="boolean" truevalue="--showzero" falsevalue="" label="Show empty intersections in plot?"/>
+        <!-- the argparse action is wrong for showsize, check this when upgrading tool in future -->
+        <param argument="--showsize" type="boolean" truevalue="" falsevalue="--showsize" checked="true" label="Show intersection sizes above bars ?"/>
+        <param argument="--mbcolor" type="color" label="Color of the main bar plot" value="#ea5d4e">
+            <expand macro="color_sanitizer"/>
+        </param>
+        <param argument="--sbcolor" type="color" label="Color of the set size bar plot" value="#317eab">
+            <expand macro="color_sanitizer"/>
+        </param>
+        <param argument="--mblabel" type="text" label="The y-axis label of the intersection size bars" value="No. of Intersections">
+            <expand macro="quote_sanitizer"/>
+        </param>
+        <param argument="--sxlabel" type="text" label="The x-axis label of the set size bars" value="Set size">
+            <expand macro="quote_sanitizer"/>
+        </param>
+        <expand macro="figure_params"/>
+    </inputs>
+    <outputs>
+        <data name="plot" format="pdf" label="UpSet plot on ${on_string}" from_work_dir="results/Intervene_upset.plot">
+            <actions>
+                <action type="format">
+                    <option type="from_param" name="figtype"/>
+                </action>
+            </actions>
+        </data>
+    </outputs>
+    <tests>
+        <test>
+            <param name="input" value="a.txt,b.txt,c.txt"/>
+            <output name="plot" value="upset.pdf" compare="sim_size"/>
+        </test>
+        <test>
+            <param name="input" value="a.bed,b.bed,c.bed"/>
+            <output name="plot" value="bed_upset.pdf" compare="sim_size"/>
+        </test>
+    </tests>
+    <help><![CDATA[
+**What it does**
+
+This tool produces an upset plot for the intersection of sets from different datasets. 
+These can be regular lists or BED/GFF/interval files which will be processed using bedtools intersect.
+
+.. image:: $PATH_TO_IMAGES/upset.png
+
+    ]]></help>
+    <expand macro="citations"/>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macros.xml	Wed Sep 12 13:22:43 2018 -0400
@@ -0,0 +1,35 @@
+<macros>
+    <xml name="color_sanitizer">
+        <sanitizer>
+          <valid initial="string.ascii_letters,string.digits">
+            <add value="#" />
+          </valid>
+        </sanitizer>
+    </xml>
+    <xml name="quote_sanitizer">
+        <sanitizer>
+          <valid initial="string.printable">
+            <remove value="'" />
+          </valid>
+        </sanitizer>
+    </xml>
+    <xml name="figure_params">
+        <param argument="--figtype" type="select" label="Select figure type for plot">
+            <option value="pdf">pdf</option>
+            <option value="svg">svg</option>
+            <option value="ps">ps</option>
+            <option value="tiff">tiff</option>
+            <option value="png">png</option>
+        </param>
+        <param name="figsize_width" type="integer" value="14" min="2" label="Width of the output plot"/>
+        <param name="figsize_height" type="integer" value="8" min="2" label="Height of the output plot"/>
+        <param argument="--dpi" type="integer" value="300" min="60" max="1200" label="Dots-per-inch (DPI) for the output"/>
+    </xml>
+    <xml name="citations">
+        <citations>
+            <citation type="doi">10.1186/s12859-017-1708-7</citation>
+        </citations>
+    </xml>
+    <token name="@TOOL_VERSION@">0.6.4</token>
+    <token name="@ESCAPE_IDENTIFIER@"><![CDATA[re.sub('[^\s\w\-\.]', '_', str($file.element_identifier))]]></token>
+</macros>
Binary file static/images/pairwise.png has changed
Binary file static/images/upset.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/a.bed	Wed Sep 12 13:22:43 2018 -0400
@@ -0,0 +1,8 @@
+chr1	0	1000
+chr1	1000	1500
+chr1	1500	1980
+chr1	1980	2000
+chr1	2000	2070
+chr1	2070	2090
+chr1	2090	2100
+chr1	2100	5000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/a.txt	Wed Sep 12 13:22:43 2018 -0400
@@ -0,0 +1,5 @@
+A
+B
+C
+D
+E
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/b.bed	Wed Sep 12 13:22:43 2018 -0400
@@ -0,0 +1,6 @@
+chr1	0	1000
+chr1	1000	1500
+chr1	1500	1980
+chr1	2070	2090
+chr1	2090	2100
+chr1	2100	5000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/b.txt	Wed Sep 12 13:22:43 2018 -0400
@@ -0,0 +1,8 @@
+A
+B
+C
+D
+E
+F
+G
+H
Binary file test-data/bed_pairwise.pdf has changed
Binary file test-data/bed_upset.pdf has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/c.bed	Wed Sep 12 13:22:43 2018 -0400
@@ -0,0 +1,7 @@
+chr1	0	1000
+chr1	1500	1980
+chr1	1980	2000
+chr1	2000	2070
+chr1	2070	2090
+chr1	2090	2100
+chr1	2100	5000
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/c.txt	Wed Sep 12 13:22:43 2018 -0400
@@ -0,0 +1,3 @@
+A
+B
+C
Binary file test-data/upset.pdf has changed