annotate column_maker.xml @ 0:4dadd821722f draft

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