root/galaxy-central/tools/plotting/boxplot.xml

リビジョン 2, 4.1 KB (コミッタ: hatakeyama, 14 年 前)

import galaxy-central

行番号 
1<tool id="qual_stats_boxplot" name="Boxplot" version="1.0.0">
2  <description>of quality statistics</description>
3  <command>gnuplot &lt; '$gnuplot_commands' 2&gt;&amp;1 || echo "Error running gnuplot." >&amp;2</command>
4  <requirements>
5    <requirement type="binary" version="gnuplot 4.2 patchlevel 2">gnuplot</requirement>
6  </requirements>
7  <inputs>
8    <param name="input_file" type="data" format="tabular" label="Quality Statistics File"/>
9    <param name="title" type="text" value="Box plot in Galaxy" label="Title for plot" size="50"/>
10    <param name="graph_size" type="text" value="2048,768" label="Dimensions of Graph"/>
11    <param name="xlabel" type="text" value="X Axis Label" label="X axis label" size="50"/>
12    <param name="ylabel" type="text" value="Score Value" label="Y axis label" size="50"/>
13    <param name="xcol" type="data_column" data_ref="input_file" label="Column for X axis position" default_value="1" help="A unique number"/>
14    <param name="q1col" type="data_column" data_ref="input_file" label="Column for Q1" default_value="7"/>
15    <param name="medcol" type="data_column" data_ref="input_file" label="Column for Median" default_value="8"/>
16    <param name="q3col" type="data_column" data_ref="input_file" label="Column for Q3" default_value="9"/>
17    <param name="lwcol" type="data_column" data_ref="input_file" label="Column for left whisker" default_value="11"/>
18    <param name="rwcol" type="data_column" data_ref="input_file" label="Column for right whisker" default_value="12"/>
19    <conditional name="use_outliers">
20      <param name="use_outliers_type" type="select" label="Plot Outliers">
21        <option value="use_outliers" selected="true">Plot Outliers</option>
22        <option value="dont_use_outliers">Don't Plot Outliers</option>
23      </param>
24      <when value="use_outliers">
25        <param name="outliercol" type="data_column" data_ref="input_file" label="Column for Outliers" default_value="13"/>
26      </when>
27      <when value="dont_use_outliers">
28      </when>
29    </conditional>
30  </inputs>
31  <configfiles>
32    <configfile name="gnuplot_commands">
33set output '$output_file'
34set term png size ${graph_size}
35set boxwidth 0.8
36set key right tmargin
37set xlabel "${xlabel}"
38set ylabel "${ylabel}"
39set title  "${title}"
40set xtics 1
41set ytics 1
42set grid ytics
43set offsets 1, 1, 1, 1
44plot '${input_file}' using ${xcol}:${q1col}:${lwcol}:${rwcol}:${q3col} with candlesticks lt 1  lw 1 title 'Quartiles' whiskerbars, \
45      ''         using ${xcol}:${medcol}:${medcol}:${medcol}:${medcol} with candlesticks lt -1 lw 2 title 'Medians'\
46#if str( $use_outliers['use_outliers_type'] ) == 'use_outliers':
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'
48#end if
49    </configfile>
50  </configfiles>
51  <outputs>
52    <data name="output_file" format="png" />
53  </outputs>
54  <tests>
55    <test>
56      <param name="input_file" value="fastq_stats_1_out.tabular" ftype="tabular" />
57      <param name="title" value="Boxplot of Summary Statistics for Sanger Reads" />
58      <param name="graph_size" value="2048,768" />
59      <param name="xlabel" value="Read Column" />
60      <param name="ylabel" value="Quality Score Value" />
61      <param name="xcol" value="1" />
62      <param name="q1col" value="7" />
63      <param name="medcol" value="8" />
64      <param name="q3col" value="9" />
65      <param name="lwcol" value="11" />
66      <param name="rwcol" value="12" />
67      <param name="use_outliers_type" value="use_outliers" />
68      <param name="outliercol" value="13" />
69      <output name="output_file" file="boxplot_summary_statistics_out.png" />
70    </test>
71  </tests>
72  <help>
73This tool creates a boxplot from a tabular file containing summary statistics.
74Outliers are optionally defined using a comma-separated list of values.
75  </help>
76</tool>
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。