root/galaxy-central/tools/new_operations/flanking_features.xml

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

import galaxy-central

行番号 
1<tool id="flanking_features_1" name="Fetch closest feature" version="4.0.0">
2  <description>  for every interval</description>
3  <command interpreter="python">
4      flanking_features.py $input1 $input2 $out_file1 $direction
5     
6      #if isinstance( $input1.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
7          -1 1,4,5,7 --gff1
8      #else:
9          -1 ${input1.metadata.chromCol},${input1.metadata.startCol},${input1.metadata.endCol},${input1.metadata.strandCol}
10      #end if
11         
12      #if isinstance( $input2.datatype, $__app__.datatypes_registry.get_datatype_by_extension('gff').__class__):
13          -2 1,4,5,7 --gff2
14      #else:
15          -2 ${input2.metadata.chromCol},${input2.metadata.startCol},${input2.metadata.endCol},${input2.metadata.strandCol}
16      #end if
17  </command>
18  <inputs>
19    <param format="interval,gff" name="input1" type="data" label="For every interval in"/>
20    <param format="interval,gff" name="input2" type="data" label="Fetch closest feature(s) from"/>
21    <param name="direction" type="select" label="Located">
22      <option value="Either">Either Upstream or Downstream</option>
23      <option value="Both">Both Upstream and Downstream</option>
24      <option value="Upstream">Upstream</option>
25      <option value="Downstream">Downstream</option>
26    </param>
27  </inputs>
28  <outputs>
29    <data format="input" name="out_file1" metadata_source="input1"/>
30  </outputs>
31  <tests>
32    <test>
33      <param name="input1" value="4_windows.bed"/>
34      <param name="input2" value="4_windows_2.bed"/>
35      <param name="direction" value="Either"/>
36      <output name="out_file1" file="closest_features_either.interval"/>
37    </test>
38    <test>
39      <param name="input1" value="4_windows.bed"/>
40      <param name="input2" value="4_windows_2.bed"/>
41      <param name="direction" value="Both"/>
42      <output name="out_file1" file="closest_features.interval"/>
43    </test>
44    <test>
45      <param name="input1" value="4_windows.bed"/>
46      <param name="input2" value="4_windows_2.bed"/>
47      <param name="direction" value="Upstream"/>
48      <output name="out_file1" file="closest_features_up.interval"/>
49    </test>
50    <test>
51      <param name="input1" value="4_windows.bed"/>
52      <param name="input2" value="4_windows_2.bed"/>
53      <param name="direction" value="Downstream"/>
54      <output name="out_file1" file="closest_features_down.interval"/>
55    </test>
56   
57    <!-- Tests for GFF functionality. -->
58
59    <test>
60      <param name="input1" value="4_windows.bed"/>
61      <param name="input2" value="4_windows_2.gff"/>
62      <param name="direction" value="Either"/>
63      <output name="out_file1" file="closest_features_both.gff"/>
64    </test>
65    <test>
66      <param name="input1" value="4_windows.gff"/>
67      <param name="input2" value="4_windows_2.gff"/>
68      <param name="direction" value="Either"/>
69      <output name="out_file1" file="closest_features_both2.gff"/>
70    </test>
71   
72  </tests>
73 <help>
74
75.. class:: infomark
76
77**What it does**
78
79For every interval in the **interval** dataset, this tool fetches the **closest** upstream and / or downstream features from the **features** dataset.
80
81-----
82
83.. class:: warningmark
84
85**Note:**
86
87Every 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".
88
89If 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.
90
91For GFF files, features are added as a GTF-style attribute at the end of the line.
92
93-----
94
95**Example**
96
97If the **intervals** are::
98
99   chr1 10   100  Query1.1
100   chr1 500  1000 Query1.2
101   chr1 1100 1250 Query1.3
102
103and the **features** are::
104
105   chr1 120  180  Query2.1
106   chr1 140  200  Query2.2
107   chr1 580  1050 Query2.3
108   chr1 2000 2204 Query2.4
109   chr1 2500 3000 Query2.5
110
111Running this tool for **Both Upstream and Downstream** will return::
112
113   chr1 10   100  Query1.1 chr1 120  180  Query2.1
114   chr1 500  1000 Query1.2 chr1 140  200  Query2.2
115   chr1 500  1000 Query1.2 chr1 2000 2204 Query2.4
116   chr1 1100 1250 Query1.3 chr1 580  1050 Query2.3
117   chr1 1100 1250 Query1.3 chr1 2000 2204 Query2.4
118
119</help> 
120
121
122</tool>
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。