annotate tools/plotting/boxplot.xml @ 2:c2a356708570

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:45:42 -0500
parents 9071e359b9a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 <tool id="qual_stats_boxplot" name="Boxplot" version="1.0.0">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 <description>of quality statistics</description>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 <command>gnuplot &lt; '$gnuplot_commands' 2&gt;&amp;1 || echo "Error running gnuplot." >&amp;2</command>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4 <requirements>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5 <requirement type="binary" version="gnuplot 4.2 patchlevel 2">gnuplot</requirement>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 </requirements>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7 <inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8 <param name="input_file" type="data" format="tabular" label="Quality Statistics File"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9 <param name="title" type="text" value="Box plot in Galaxy" label="Title for plot" size="50"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10 <param name="graph_size" type="text" value="2048,768" label="Dimensions of Graph"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11 <param name="xlabel" type="text" value="X Axis Label" label="X axis label" size="50"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 <param name="ylabel" type="text" value="Score Value" label="Y axis label" size="50"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
13 <param name="xcol" type="data_column" data_ref="input_file" label="Column for X axis position" default_value="1" help="A unique number; c1 if plotting output of FASTQ summary"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14 <param name="q1col" type="data_column" data_ref="input_file" label="Column for Q1" default_value="7" help="c7 if plotting output of FASTQ summary"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15 <param name="medcol" type="data_column" data_ref="input_file" label="Column for Median" default_value="8" help="c8 if plotting output of FASTQ summary"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 <param name="q3col" type="data_column" data_ref="input_file" label="Column for Q3" default_value="9" help="c9 if plotting output of FASTQ summary"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 <param name="lwcol" type="data_column" data_ref="input_file" label="Column for left whisker" default_value="11" help="c11 if plotting output of FASTQ summary"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 <param name="rwcol" type="data_column" data_ref="input_file" label="Column for right whisker" default_value="12" help="c12 if plotting output of FASTQ summary"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19 <conditional name="use_outliers">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20 <param name="use_outliers_type" type="select" label="Plot Outliers">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 <option value="use_outliers" selected="true">Plot Outliers</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22 <option value="dont_use_outliers">Don't Plot Outliers</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23 </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
24 <when value="use_outliers">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
25 <param name="outliercol" type="data_column" data_ref="input_file" label="Column for Outliers" default_value="13" help="c13 if plotting output of FASTQ summary"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
26 </when>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
27 <when value="dont_use_outliers">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
28 </when>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
29 </conditional>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
30 </inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
31 <configfiles>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
32 <configfile name="gnuplot_commands">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
33 set output '$output_file'
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
34 set term png size ${graph_size}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
35 set boxwidth 0.8
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
36 set key right tmargin
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
37 set xlabel "${xlabel}"
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
38 set ylabel "${ylabel}"
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
39 set title "${title}"
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
40 set xtics 1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
41 set ytics 1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
42 set grid ytics
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
43 set offsets 1, 1, 1, 1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
44 plot '${input_file}' using ${xcol}:${q1col}:${lwcol}:${rwcol}:${q3col} with candlesticks lt 1 lw 1 title 'Quartiles' whiskerbars, \
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
45 '' using ${xcol}:${medcol}:${medcol}:${medcol}:${medcol} with candlesticks lt -1 lw 2 title 'Medians'\
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
46 #if str( $use_outliers['use_outliers_type'] ) == 'use_outliers':
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
47 , "&lt; python -c \"for xval, yvals in [ ( fields[${xcol} - 1], fields[${use_outliers['outliercol']} - 1].split( ',' ) ) for fields in [ line.rstrip( '\\n\\r' ).split( '\\t' ) for line in open( '${input_file}' ) if not line.startswith( '#' ) ] if len( fields ) &gt; max( ${xcol} - 1, ${use_outliers['outliercol']} - 1 ) ]: print '\\n'.join( [ '%s\\t%s' % ( xval, yval ) for yval in yvals if yval ] )\"" using 1:2 with points pt 29 title 'Outliers'
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
48 #end if
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
49 </configfile>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
50 </configfiles>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
51 <outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
52 <data name="output_file" format="png" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
53 </outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
54 <tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
55 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
56 <param name="input_file" value="fastq_stats_1_out.tabular" ftype="tabular" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
57 <param name="title" value="Boxplot of Summary Statistics for Sanger Reads" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
58 <param name="graph_size" value="2048,768" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
59 <param name="xlabel" value="Read Column" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
60 <param name="ylabel" value="Quality Score Value" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
61 <param name="xcol" value="1" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
62 <param name="q1col" value="7" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
63 <param name="medcol" value="8" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
64 <param name="q3col" value="9" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
65 <param name="lwcol" value="11" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
66 <param name="rwcol" value="12" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
67 <param name="use_outliers_type" value="use_outliers" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
68 <param name="outliercol" value="13" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
69 <output name="output_file" file="boxplot_summary_statistics_out.png" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
70 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
71 </tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
72 <help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
73
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
74 **What it does**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
75
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
76 Creates a boxplot graph. Its main purpose is to display a distribution of quality scores produced by *NGS: QC and maniupulation -> FASTQ Summary Statistics* tool.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
77
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
78 .. class:: warningmark
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
79
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
80 **TIP:** If you want to display a distribution of quality scores produced by *NGS: QC and maniupulation -> FASTQ Summary Statistics* and the column assignments within the tool's interface are not automatically set (they will all read "c1" in that case) set columns manually to the following values::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
81
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
82 Column for X axis c1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
83 Column for Q1 c7
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
84 Column for Median c8
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
85 Column for Q3 c9
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
86 Column for left whisker c11
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
87 Column for right whisker c12
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
88 Column for Outliers c13
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
89
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
90 -----
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
91
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
92 **Output Example**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
93
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
94 * Black horizontal lines are medians
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
95 * Rectangular red boxes show the Inter-quartile Range (IQR) (top value is Q3, bottom value is Q1)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
96 * Whiskers show outliers at max. 1.5*IQR
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
97
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
98 .. image:: ./static/images/solid_qual.png
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
99
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
100
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
101 </help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
102 </tool>