annotate tools/new_operations/flanking_features.xml @ 1:cdcb0ce84a1b

Uploaded
author xuebing
date Fri, 09 Mar 2012 19:45:15 -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="flanking_features_1" name="Fetch closest non-overlapping feature" version="4.0.1">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
2 <description> for every interval</description>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
3 <command interpreter="python">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
4 flanking_features.py $input1 $input2 $out_file1 $direction
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
5
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
6 #if isinstance( $input1.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
7 -1 1,4,5,7 --gff1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
8 #else:
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
9 -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
10 #end if
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
11
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
12 #if isinstance( $input2.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
13 -2 1,4,5,7 --gff2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
14 #else:
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
15 -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol}
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
16 #end if
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
17 </command>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
18 <inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
19 <param format="interval,gff" name="input1" type="data" label="For every interval in"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
20 <param format="interval,gff" name="input2" type="data" label="Fetch closest feature(s) from"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
21 <param name="direction" type="select" label="Located">
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
22 <option value="Either">Either Upstream or Downstream</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
23 <option value="Both">Both Upstream and Downstream</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
24 <option value="Upstream">Upstream</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
25 <option value="Downstream">Downstream</option>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
26 </param>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
27 </inputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
28 <outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
29 <data format="input" name="out_file1" metadata_source="input1"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
30 </outputs>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
31 <tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
32 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
33 <param name="input1" value="4_windows.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
34 <param name="input2" value="4_windows_2.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
35 <param name="direction" value="Either"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
36 <output name="out_file1" file="closest_features_either.interval"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
37 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
38 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
39 <param name="input1" value="4_windows.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
40 <param name="input2" value="4_windows_2.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
41 <param name="direction" value="Both"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
42 <output name="out_file1" file="closest_features.interval"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
43 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
44 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
45 <param name="input1" value="4_windows.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
46 <param name="input2" value="4_windows_2.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
47 <param name="direction" value="Upstream"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
48 <output name="out_file1" file="closest_features_up.interval"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
49 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
50 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
51 <param name="input1" value="4_windows.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
52 <param name="input2" value="4_windows_2.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
53 <param name="direction" value="Downstream"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
54 <output name="out_file1" file="closest_features_down.interval"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
55 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
56 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
57 <param name="input1" value="4_windows.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
58 <param name="input2" value="4_windows_3.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
59 <param name="direction" value="Both"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
60 <output name="out_file1" file="closest_features_both.interval"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
61 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
62 <!-- Tests for GFF functionality. -->
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
63
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
64 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
65 <param name="input1" value="4_windows.bed"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
66 <param name="input2" value="4_windows_2.gff"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
67 <param name="direction" value="Either"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
68 <output name="out_file1" file="closest_features_both.gff"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
69 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
70 <test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
71 <param name="input1" value="4_windows.gff"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
72 <param name="input2" value="4_windows_2.gff"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
73 <param name="direction" value="Either"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
74 <output name="out_file1" file="closest_features_both2.gff"/>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
75 </test>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
76
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
77 </tests>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
78 <help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
79
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
80 .. class:: infomark
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
81
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
82 **What it does**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
83
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
84 For every interval in the **interval** dataset, this tool fetches the **closest non-overlapping** upstream and / or downstream features from the **features** dataset.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
85
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
86 -----
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
87
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
88 .. class:: warningmark
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
89
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
90 **Note:**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
91
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
92 Every line should contain at least 3 columns: chromosome number, start and stop coordinates. If any of these columns is missing or if start and stop coordinates are not numerical, the lines will be treated as invalid and skipped. The number of skipped lines is documented in the resulting history item as a "data issue".
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
93
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
94 If the strand column is missing from your input interval dataset, the intervals will be considered to be on positive strand. You can add a strand column to your input dataset by using the *Text Manipulation->Add column* tool.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
95
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
96 For GFF files, features are added as a GTF-style attribute at the end of the line.
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
97
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
98 -----
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
99
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
100 **Example**
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
101
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
102 If the **intervals** are::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
103
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
104 chr1 10 100 Query1.1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
105 chr1 500 1000 Query1.2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
106 chr1 1100 1250 Query1.3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
107
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
108 and the **features** are::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
109
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
110 chr1 120 180 Query2.1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
111 chr1 140 200 Query2.2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
112 chr1 580 1050 Query2.3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
113 chr1 2000 2204 Query2.4
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
114 chr1 2500 3000 Query2.5
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
115
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
116 Running this tool for **Both Upstream and Downstream** will return::
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
117
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
118 chr1 10 100 Query1.1 chr1 120 180 Query2.1
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
119 chr1 500 1000 Query1.2 chr1 140 200 Query2.2
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
120 chr1 500 1000 Query1.2 chr1 2000 2204 Query2.4
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
121 chr1 1100 1250 Query1.3 chr1 580 1050 Query2.3
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
122 chr1 1100 1250 Query1.3 chr1 2000 2204 Query2.4
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
123
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
124 </help>
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
125
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
126
9071e359b9a3 Uploaded
xuebing
parents:
diff changeset
127 </tool>