0
|
1 <tool id="bedtools_closestbed" name="ClosestBed" version="@WRAPPER_VERSION@.0">
|
|
2 <description></description>
|
|
3 <macros>
|
|
4 <import>macros.xml</import>
|
|
5 </macros>
|
|
6 <expand macro="requirements" />
|
|
7 <expand macro="stdio" />
|
|
8 <command>
|
1
|
9 <![CDATA[
|
|
10 #set inputBs = ' '.join( [ str( $file ) for $file in $inputB ] )
|
|
11
|
0
|
12 closestBed
|
|
13 $strand
|
|
14 $addition
|
1
|
15 #if $addition2.addition2_select:
|
|
16 -D $addition2.addition2_select
|
|
17 $addition2.iu
|
|
18 $addition2.id
|
|
19 #end if
|
|
20 $io
|
|
21 -mdb $mdb
|
0
|
22 -t $ties
|
|
23 -a $inputA
|
1
|
24 -b $inputBs
|
|
25 > $output
|
|
26 ]]>
|
0
|
27 </command>
|
|
28 <inputs>
|
|
29 <param format="bed,vcf,gff,gff3" name="inputA" type="data" label="BED/VCF/GFF file"/>
|
1
|
30 <param format="bed,gff,vcf,gff3" name="inputB" type="data" multiple="True" label="overlap intervals in this BED/VCF/GFF file?"/>
|
0
|
31
|
1
|
32 <param name="ties" type="select"
|
|
33 label="How ties for closest feature should be handled"
|
|
34 help="This occurs when two features in B have exactly the same overlap with a feature in A.">
|
0
|
35 <option value="all" selected="True">all - Report all ties (default)</option>
|
|
36 <option value="first">first - Report the first tie that occurred in the B file</option>
|
|
37 <option value="last">last - Report the last tie that occurred in the B file</option>
|
|
38 </param>
|
|
39
|
1
|
40 <expand macro="strand2" />
|
|
41
|
|
42 <param name="addition" type="boolean" checked="false" truevalue="-d" falsevalue=""
|
|
43 label="In addition to the closest feature in B, report its distance to A as an extra column"
|
|
44 help="The reported distance for overlapping features will be 0. (-d)" />
|
|
45
|
|
46 <conditional name="addition2">
|
|
47 <param name="addition2_select" type="select" optional="True"
|
|
48 label="Add additional columns to report distance to upstream feature. Distance defintion"
|
|
49 help="Like -d, report the closest feature in B, and its distance to A as an extra column. However unlike -d, use negative distances to report upstream features. (-D)">
|
|
50 <option value="" selected="True">Do not report the distance et all.</option>
|
|
51 <option value="ref">Report distance with respect to the reference genome. B features with a lower (start, stop) are upstream. (-ref)</option>
|
|
52 <option value="a">Report distance with respect to A. When A is on the - strand, "upstream" means B has a higher (start,stop). (-a)</option>
|
|
53 <option value="b">Report distance with respect to B. When B is on the - strand, "upstream" means A has a higher (start,stop). (-b)</option>
|
|
54 </param>
|
|
55 <when value="ref">
|
|
56 <param name="iu" type="boolean" checked="false" truevalue="-iu" falsevalue=""
|
|
57 label="Ignore features in B that are upstream of features in A"
|
|
58 help="This option requires -D and follows its orientation rules for determining what is 'upstream'. (-iu)" />
|
|
59
|
|
60 <param name="id" type="boolean" checked="false" truevalue="-id" falsevalue=""
|
|
61 label="Ignore features in B that are downstream of features in A"
|
|
62 help="This option requires -D and follows its orientation rules for determining what is 'downstream'. (-id)" />
|
|
63 </when>
|
|
64 <when value="a">
|
|
65 <param name="iu" type="boolean" checked="false" truevalue="-iu" falsevalue=""
|
|
66 label="Ignore features in B that are upstream of features in A"
|
|
67 help="This option requires -D and follows its orientation rules for determining what is 'upstream'. (-iu)" />
|
|
68
|
|
69 <param name="id" type="boolean" checked="false" truevalue="-id" falsevalue=""
|
|
70 label="Ignore features in B that are downstream of features in A"
|
|
71 help="This option requires -D and follows its orientation rules for determining what is 'downstream'. (-id)" />
|
|
72 </when>
|
|
73 <when value="b">
|
|
74 <param name="iu" type="boolean" checked="false" truevalue="-iu" falsevalue=""
|
|
75 label="Ignore features in B that are upstream of features in A"
|
|
76 help="This option requires -D and follows its orientation rules for determining what is 'upstream'. (-iu)" />
|
|
77
|
|
78 <param name="id" type="boolean" checked="false" truevalue="-id" falsevalue=""
|
|
79 label="Ignore features in B that are downstream of features in A"
|
|
80 help="This option requires -D and follows its orientation rules for determining what is 'downstream'. (-id)" />
|
|
81 </when>
|
|
82 </conditional>
|
|
83
|
|
84 <param name="io" type="boolean" checked="false" truevalue="-io" falsevalue=""
|
|
85 label="Ignore features in B that overlap A"
|
|
86 help="That is, we want close, yet not touching features only. (-io)" />
|
|
87
|
|
88 <param name="mdb" type="select" optional="True"
|
|
89 label="How multiple databases are resolved"
|
|
90 help="(-mdb)">
|
|
91 <option value="each" selected="True">Report closest records for each database. (-each)</option>
|
|
92 <option value="all">Report closest records among all databases. (-all)</option>
|
|
93 </param>
|
0
|
94 </inputs>
|
|
95 <outputs>
|
1
|
96 <data format_source="inputA" name="output" metadata_source="inputA" label="Clostest region of ${inputA} in ${inputB}"/>
|
0
|
97 </outputs>
|
1
|
98 <tests>
|
|
99 <test>
|
|
100 <param name="inputA" value="closestBedA.bed" ftype="bed" />
|
|
101 <param name="inputB" value="closestBedB.bed" ftype="bed" />
|
|
102 <output name="output" file="closestBed_result1.bed" ftype="bed" />
|
|
103 </test>
|
|
104 <test>
|
|
105 <param name="inputA" value="closestBed_a.bed" ftype="bed" />
|
|
106 <param name="inputB" value="closestBed_b1.bed,closestBed_b2.bed" ftype="bed" />
|
|
107 <param name="addition" value="True" />
|
|
108 <output name="output" file="closestBed_result2.bed" ftype="bed" />
|
|
109 </test>
|
|
110 <test>
|
|
111 <param name="inputA" value="closestBed_a.bed" ftype="bed" />
|
|
112 <param name="inputB" value="closestBed_b1.bed,closestBed_b2.bed" ftype="bed" />
|
|
113 <param name="addition" value="True" />
|
|
114 <param name="mdb" value="all" />
|
|
115 <output name="output" file="closestBed_result3.bed" ftype="bed" />
|
|
116 </test>
|
|
117 <test>
|
|
118 <param name="inputA" value="closestBed_c.bed" ftype="bed" />
|
|
119 <param name="inputB" value="closestBed_d.bed" ftype="bed" />
|
|
120 <param name="addition2_select" value="ref" />
|
|
121 <output name="output" file="closestBed_result4.bed" ftype="bed" />
|
|
122 </test>
|
|
123 <test>
|
|
124 <param name="inputA" value="closestBed_c.bed" ftype="bed" />
|
|
125 <param name="inputB" value="closestBed_d.bed" ftype="bed" />
|
|
126 <param name="addition2_select" value="a" />
|
|
127 <output name="output" file="closestBed_result5.bed" ftype="bed" />
|
|
128 </test>
|
|
129 </tests>
|
0
|
130 <help>
|
1
|
131 <![CDATA[
|
0
|
132 **What it does**
|
|
133
|
|
134 Similar to intersectBed, closestBed searches for overlapping features in A and B. In the event that no feature in B overlaps the current feature in A, closestBed will report the closest (that is, least genomic distance from the start or end of A) feature in B. For example, one might want to find which is the closest gene to a significant GWAS polymorphism. Note that closestBed will report an overlapping feature as the closest—that is, it does not restrict to closest non-overlapping feature.
|
|
135
|
1
|
136 .. image:: $PATH_TO_IMAGES/closest-glyph.png
|
|
137
|
|
138
|
0
|
139 @REFERENCES@
|
1
|
140 ]]>
|
0
|
141 </help>
|
|
142 <expand macro="citations" />
|
|
143 </tool>
|