root/galaxy-central/tools/stats/column_maker.xml

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

import galaxy-central

行番号 
1<tool id="Add_a_column1" name="Compute" version="1.1.0">
2  <description>an expression on every row</description>
3  <command interpreter="python">
4    column_maker.py $input $out_file1 "$cond" $round ${input.metadata.columns} "${input.metadata.column_types}"
5  </command>
6  <inputs>
7    <param name="cond" size="40" type="text" value="c3-c2" label="Add expression"/>
8    <param format="tabular" name="input" type="data" label="as a new column to" help="Query missing? See TIP below"/>
9    <param name="round" type="select" label="Round result?">
10      <option value="no">NO</option>
11      <option value="yes">YES</option>
12    </param>   
13  </inputs>
14  <outputs>
15    <data format="input" name="out_file1" metadata_source="input"/>
16  </outputs>
17  <tests>
18    <test>
19      <param name="cond" value="c3-c2"/>
20      <param name="input" value="1.bed"/>
21      <param name="round" value="no"/>
22      <output name="out_file1" file="column_maker_out1.interval"/>
23    </test>
24    <test>
25      <param name="cond" value="c4*1"/>
26      <param name="input" value="1.interval"/>
27      <param name="round" value="no"/>
28      <output name="out_file1" file="column_maker_out2.interval"/>
29    </test>
30    <test>
31      <param name="cond" value="c4*1"/>
32      <param name="input" value="1.interval"/>
33      <param name="round" value="yes"/>
34      <output name="out_file1" file="column_maker_out3.interval"/>
35    </test>
36  </tests>
37  <help>
38
39 .. class:: infomark
40
41**TIP:** If your data is not TAB delimited, use *Text Manipulation-&gt;Convert*
42
43-----
44
45**What it does**
46
47This tool computes an expression for every row of a query and appends the result as a new column (field).
48
49- Columns are referenced with **c** and a **number**. For example, **c1** refers to the first column of a tab-delimited file
50
51- **c3-c2** will add a length column to the query if **c2** and **c3** are start and end position
52
53-----
54
55**Example**
56
57If this is your input::
58
59   chr1  151077881  151077918  2  200  -
60   chr1  151081985  151082078  3  500  +
61
62computing "c4*c5" will produce::
63
64   chr1  151077881  151077918  2  200  -   400.0
65   chr1  151081985  151082078  3  500  +  1500.0
66   
67if, at the same time, "Round result?" is set to **YES** results will look like this::
68
69   chr1  151077881  151077918  2  200  -   400
70   chr1  151081985  151082078  3  500  +  1500
71
72You can also use this tool to evaluate expressions. For example, computing "c3>=c2" for Input will result in the following::
73
74   chr1  151077881  151077918  2  200  -  True
75   chr1  151081985  151082078  3  500  +  True
76
77or computing "type(c2)==type('') for Input will return::
78
79   chr1  151077881  151077918  2  200  -  False
80   chr1  151081985  151082078  3  500  +  False
81
82</help>
83</tool>
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。