annotate tools/filters/cutWrapper.xml @ 0:9071e359b9a3

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:37:19 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
1 <tool id="Cut1" name="Cut" version="1.0.1">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 <description>columns from a table</description>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 <command interpreter="perl">cutWrapper.pl $input "$columnList" $delimiter $out_file1</command>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4 <inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5 <param name="columnList" size="10" type="text" value="c1,c2" label="Cut columns"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 <param name="delimiter" type="select" label="Delimited by">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7 <option value="T">Tab</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8 <option value="Sp">Whitespace</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9 <option value="Dt">Dot</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10 <option value="C">Comma</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11 <option value="D">Dash</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 <option value="U">Underscore</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
13 <option value="P">Pipe</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14 </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15 <param format="txt" name="input" type="data" label="From"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 </inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 <outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 <data format="tabular" name="out_file1" >
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19 <actions>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20 <conditional name="delimiter">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 <when value="T">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22 <conditional name="input">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23 <when datatype_isinstance="interval">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
24 <action type="format" default="tabular">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
25 <option type="from_param" name="columnList" column="0" offset="0"> <!-- chromCol is 1-->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
26
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
27 <filter type="insert_column" column="0" value="interval"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
28
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
29 <filter type="insert_column" ref="columnList" /> <!-- startCol -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
30
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
31 <filter type="insert_column" ref="columnList" /> <!-- endCol -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
32
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
33 <filter type="multiple_splitter" column="1" separator=","/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
34 <filter type="column_strip" column="1"/> <!-- get rid of all external whitespace -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
35 <filter type="string_function" column="1" name="lower" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
36 <filter type="param_value" column="1" value="^c\d{1,}$" compare="re_search" keep="True"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
37 <filter type="column_strip" column="1" strip="c"/> <!-- get rid of c's -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
38 <filter type="boolean" column="1" cast="int" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
39
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
40 <filter type="multiple_splitter" column="2" separator=","/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
41 <filter type="column_strip" column="2"/> <!-- get rid of all external whitespace -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
42 <filter type="string_function" column="2" name="lower" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
43 <filter type="param_value" column="2" value="^c\d{1,}$" compare="re_search" keep="True"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
44 <filter type="column_strip" column="2" strip="c"/> <!-- get rid of c's -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
45 <filter type="boolean" column="2" cast="int" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
46
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
47 <filter type="multiple_splitter" column="3" separator=","/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
48 <filter type="column_strip" column="3"/> <!-- get rid of all external whitespace -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
49 <filter type="string_function" column="3" name="lower" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
50 <filter type="param_value" column="3" value="^c\d{1,}$" compare="re_search" keep="True"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
51 <filter type="column_strip" column="3" strip="c"/> <!-- get rid of c's -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
52 <filter type="boolean" column="3" cast="int" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
53
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
54 <filter type="metadata_value" ref="input" name="chromCol" column="1" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
55 <filter type="metadata_value" ref="input" name="startCol" column="2" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
56 <filter type="metadata_value" ref="input" name="endCol" column="3" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
57
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
58 </option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
59 </action>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
60
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
61 <conditional name="out_file1">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
62 <when datatype_isinstance="interval">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
63 <action type="metadata" name="chromCol">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
64 <option type="from_param" name="columnList" column="0" offset="0"> <!-- chromCol is 0-->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
65 <filter type="multiple_splitter" column="0" separator=","/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
66 <filter type="column_strip" column="0"/> <!-- get rid of all external whitespace -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
67 <filter type="string_function" column="0" name="lower" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
68 <filter type="param_value" column="0" value="^c\d{1,}$" compare="re_search" keep="True"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
69 <filter type="column_strip" column="0" strip="c"/> <!-- get rid of c's -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
70 <filter type="insert_column" value="1" iterate="True" column="0"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
71 <filter type="boolean" column="1" cast="int" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
72 <filter type="metadata_value" ref="input" name="chromCol" column="1" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
73 </option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
74 </action>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
75
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
76 <action type="metadata" name="startCol">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
77 <option type="from_param" name="columnList" column="0" offset="0"> <!-- startCol is 0-->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
78 <filter type="multiple_splitter" column="0" separator=","/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
79 <filter type="column_strip" column="0"/> <!-- get rid of all external whitespace -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
80 <filter type="string_function" column="0" name="lower" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
81 <filter type="param_value" column="0" value="^c\d{1,}$" compare="re_search" keep="True"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
82 <filter type="column_strip" column="0" strip="c"/> <!-- get rid of c's -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
83 <filter type="insert_column" value="1" iterate="True" column="0"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
84 <filter type="boolean" column="1" cast="int" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
85 <filter type="metadata_value" ref="input" name="startCol" column="1" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
86 </option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
87 </action>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
88
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
89 <action type="metadata" name="endCol">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
90 <option type="from_param" name="columnList" column="0" offset="0"> <!-- endCol is 0-->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
91 <filter type="multiple_splitter" column="0" separator=","/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
92 <filter type="column_strip" column="0"/> <!-- get rid of all external whitespace -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
93 <filter type="string_function" column="0" name="lower" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
94 <filter type="param_value" column="0" value="^c\d{1,}$" compare="re_search" keep="True"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
95 <filter type="column_strip" column="0" strip="c"/> <!-- get rid of c's -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
96 <filter type="insert_column" value="1" iterate="True" column="0"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
97 <filter type="boolean" column="1" cast="int" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
98 <filter type="metadata_value" ref="input" name="endCol" column="1" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
99 </option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
100 </action>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
101
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
102 <action type="metadata" name="nameCol" default="0">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
103 <option type="from_param" name="columnList" column="0" offset="0"> <!-- nameCol is 0-->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
104 <filter type="multiple_splitter" column="0" separator=","/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
105 <filter type="column_strip" column="0"/> <!-- get rid of all external whitespace -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
106 <filter type="string_function" column="0" name="lower" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
107 <filter type="param_value" column="0" value="^c\d{1,}$" compare="re_search" keep="True"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
108 <filter type="column_strip" column="0" strip="c"/> <!-- get rid of c's -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
109 <filter type="insert_column" value="1" iterate="True" column="0"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
110 <filter type="boolean" column="1" cast="int" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
111 <filter type="metadata_value" ref="input" name="nameCol" column="1" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
112 </option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
113 </action>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
114
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
115 <action type="metadata" name="strandCol" default="0">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
116 <option type="from_param" name="columnList" column="0" offset="0"> <!-- strandCol is 0-->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
117 <filter type="multiple_splitter" column="0" separator=","/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
118 <filter type="column_strip" column="0"/> <!-- get rid of all external whitespace -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
119 <filter type="string_function" column="0" name="lower" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
120 <filter type="param_value" column="0" value="^c\d{1,}$" compare="re_search" keep="True"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
121 <filter type="column_strip" column="0" strip="c"/> <!-- get rid of c's -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
122 <filter type="insert_column" value="1" iterate="True" column="0"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
123 <filter type="boolean" column="1" cast="int" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
124 <filter type="metadata_value" ref="input" name="strandCol" column="1" />
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
125 </option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
126 </action>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
127 </when>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
128 </conditional>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
129
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
130 </when>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
131 </conditional>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
132 </when>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
133 </conditional>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
134 </actions>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
135 </data>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
136 </outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
137 <tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
138 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
139 <param name="columnList" value="c1,c4,c2,c3"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
140 <param name="delimiter" value="T"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
141 <param name="input" value="1.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
142 <output name="out_file1" file="eq-cut.dat"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
143 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
144 </tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
145 <help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
146
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
147 .. class:: warningmark
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
148
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
149 **WARNING: This tool breaks column assignments.** To re-establish column assignments run the tools and click on the pencil icon in the latest history item.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
150
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
151 .. class:: infomark
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
152
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
153 The output of this tool is always in tabular format (e.g., if your original delimiters are commas, they will be replaced with tabs). For example:
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
154
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
155 Cutting columns 1 and 3 from::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
156
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
157 apple,is,good
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
158 windows,is,bad
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
159
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
160 will give::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
161
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
162 apple good
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
163 windows bad
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
164
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
165 -----
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
166
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
167 **What it does**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
168
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
169 This tool selects (cuts out) specified columns from the dataset.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
170
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
171 - Columns are specified as **c1**, **c2**, and so on. Column count begins with **1**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
172 - Columns can be specified in any order (e.g., **c2,c1,c6**)
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
173 - If you specify more columns than actually present - empty spaces will be filled with dots
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
174
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
175 -----
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
176
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
177 **Example**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
178
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
179 Input dataset (six columns: c1, c2, c3, c4, c5, and c6)::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
180
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
181 chr1 10 1000 gene1 0 +
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
182 chr2 100 1500 gene2 0 +
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
183
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
184 **cut** on columns "**c1,c4,c6**" will return::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
185
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
186 chr1 gene1 +
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
187 chr2 gene2 +
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
188
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
189 **cut** on columns "**c6,c5,c4,c1**" will return::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
190
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
191 + 0 gene1 chr1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
192 + 0 gene2 chr2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
193
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
194
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
195 **cut** on columns "**c8,c7,c4**" will return::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
196
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
197 . . gene1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
198 . . gene2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
199
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
200
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
201 </help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
202 </tool>