annotate intersectBed.xml @ 29:6bb3cd018203 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 69394918e7a50dad3ae578e932cbac27b96e0d3b
author iuc
date Tue, 24 Jul 2018 11:49:55 -0400
parents 6283d16e40ed
children 4f7a5ccd2ae9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28
6283d16e40ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 393e1fef41cfb7e28005a98fd5043a3f42347686
iuc
parents: 26
diff changeset
1 <tool id="bedtools_intersectbed" name="Intersect intervals" version="@WRAPPER_VERSION@.2">
4
607c0576c6ab planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 6692e3a4fa1bf6e9a407735afdbb2454ed32b316
iuc
parents: 1
diff changeset
2 <description>find overlapping intervals in various ways</description>
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
3 <macros>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
4 <import>macros.xml</import>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
5 </macros>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
6 <expand macro="requirements" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
7 <expand macro="stdio" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
8 <command>
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
9 <![CDATA[
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
10 #set modes = ' '.join( str($overlap_mode).split(',') )
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
11
28
6283d16e40ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 393e1fef41cfb7e28005a98fd5043a3f42347686
iuc
parents: 26
diff changeset
12 #if $modes == "None":
6283d16e40ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 393e1fef41cfb7e28005a98fd5043a3f42347686
iuc
parents: 26
diff changeset
13 #set modes = ''
6283d16e40ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 393e1fef41cfb7e28005a98fd5043a3f42347686
iuc
parents: 26
diff changeset
14 #end if
6283d16e40ed planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 393e1fef41cfb7e28005a98fd5043a3f42347686
iuc
parents: 26
diff changeset
15
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
16 bedtools intersect
13
fadebae7e69b planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 391d2d41095edb2badf70924d3636238453ee377
iuc
parents: 4
diff changeset
17 #if $inputA.is_of_type('bam'):
20
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
18 -abam '${inputA}'
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
19 #else:
20
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
20 -a '${inputA}'
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
21 #end if
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
22
20
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
23 #if str($reduce_or_iterate.reduce_or_iterate_selector) == 'iterate':
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
24 -b '$reduce_or_iterate.inputB'
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
25 #else:
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
26 #set inputBs = "' '".join([str($file) for $file in $reduce_or_iterate.inputB])
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
27 -b '$inputBs'
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
28 #end if
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
29 $split
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
30 $strand
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
31 #if str($fraction) != "None" and str($fraction):
20
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
32 -f '${fraction}'
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
33 #end if
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
34 $reciprocal
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
35 $invert
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
36 $once
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
37 $header
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
38 $modes
4
607c0576c6ab planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 6692e3a4fa1bf6e9a407735afdbb2454ed32b316
iuc
parents: 1
diff changeset
39 $count
20
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
40 > '${output}'
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
41 ]]>
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
42 </command>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
43 <inputs>
26
95a3b2c25bd1 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit b75b9e79cf3186a22dc2e1e9d27c1a080b891b59
iuc
parents: 20
diff changeset
44 <param format="bam,@STD_BEDTOOLS_INPUTS@" name="inputA" type="data" label="File A to intersect with B" help="BAM/@STD_BEDTOOLS_INPUT_LABEL@ format" />
20
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
45 <conditional name="reduce_or_iterate">
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
46 <param name='reduce_or_iterate_selector' type='select' label='Combined or separate output files'>
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
47 <option value='iterate' selected='true'>One output file per 'input B' file</option>
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
48 <option value='reduce'>Single output containing intersections of any 'input B' lines with A </option>
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
49 </param>
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
50 <when value='iterate'>
26
95a3b2c25bd1 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit b75b9e79cf3186a22dc2e1e9d27c1a080b891b59
iuc
parents: 20
diff changeset
51 <param format="bam,@STD_BEDTOOLS_INPUTS@" name="inputB" type="data"
95a3b2c25bd1 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit b75b9e79cf3186a22dc2e1e9d27c1a080b891b59
iuc
parents: 20
diff changeset
52 label="File(s) B to intersect with A" help="BAM/@STD_BEDTOOLS_INPUT_LABEL@ format"/>
20
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
53 </when>
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
54 <when value='reduce'>
26
95a3b2c25bd1 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit b75b9e79cf3186a22dc2e1e9d27c1a080b891b59
iuc
parents: 20
diff changeset
55 <param format="bam,@STD_BEDTOOLS_INPUTS@" name="inputB" type="data" multiple="true"
95a3b2c25bd1 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit b75b9e79cf3186a22dc2e1e9d27c1a080b891b59
iuc
parents: 20
diff changeset
56 label="File(s) B to intersect with A" help="BAM/@STD_BEDTOOLS_INPUT_LABEL@ format"/>
20
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
57 </when>
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
58 </conditional>
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
59 <expand macro="strand2" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
60 <param name="overlap_mode" type="select" multiple="True" label="What should be written to the output file?">
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
61 <option value="-wa" selected="True">Write the original entry in A for each overlap (-wa)</option>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
62 <option value="-wb">Write the original entry in B for each overlap. Useful for knowing what A overlaps. Restricted by the fraction- and reciprocal option (-wb)</option>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
63 <option value="-wo">Write the original A and B entries plus the number of base pairs of overlap between the two features. Only A features with overlap are reported. Restricted by the fraction- and reciprocal option (-wo)</option>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
64 <option value="-wao">Write the original A and B entries plus the number of base pairs of overlap between the two features. However, A features w/o overlap are also reported with a NULL B feature and overlap = 0. Restricted by the fraction- and reciprocal option (-wao)</option>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
65 <option value="-loj">Perform a "left outer join". That is, for each feature in A report each overlap with B. If no overlaps are found, report a NULL feature for B (-loj)</option>
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
66 </param>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
67
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
68 <expand macro="split" />
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
69 <!-- -f -->
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
70 <param name="fraction" type="text"
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
71 label="Minimum overlap required as a fraction of the BAM alignment"
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
72 help="Alignments are only retained if the overlap with the an interval in the BED file comprises at least this fraction of the BAM alignment's length. For example, to require that the overlap affects 50% of the BAM alignment, use 0.50. (-f)"/>
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
73 <!-- -r -->
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
74 <expand macro="reciprocal" />
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
75 <!-- -v -->
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
76 <param name="invert" type="boolean" checked="false" truevalue="-v" falsevalue=""
20
df56e1b12d0c planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit 9f7b029951fa0f854c9c6a5f241ce9a20ae4f22a
iuc
parents: 13
diff changeset
77 label="Report only those alignments that **do not** overlap with file(s) B"
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
78 help="(-v)"/>
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
79 <!-- -u -->
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
80 <param name="once" type="boolean" checked="false" truevalue="-u" falsevalue=""
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
81 label="Write the original A entry _once_ if _any_ overlaps found in B."
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
82 help="Just report the fact >=1 hit was found. (-u)" />
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
83 <!-- -c -->
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
84 <param name="count" type="boolean" checked="false" truevalue="-c" falsevalue=""
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
85 label="For each entry in A, report the number of overlaps with B."
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
86 help="Reports 0 for A entries that have no overlap with B. (-c)" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
87 <expand macro="print_header" />
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
88 </inputs>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
89 <outputs>
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
90 <data format_source="inputA" name="output" metadata_source="inputA"/>
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
91 </outputs>
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
92 <tests>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
93 <test>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
94 <param name="inputA" value="intersectBed1.bed" ftype="bed" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
95 <param name="inputB" value="intersectBed2.bed" ftype="bed" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
96 <param name="overlap_mode" value="-wa" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
97 <param name="split" value="False" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
98 <output name="output" file="intersectBed_result1.bed" ftype="bed" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
99 </test>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
100 <test>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
101 <param name="inputA" value="intersectBed1.bed" ftype="bed" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
102 <param name="inputB" value="intersectBed2.bed" ftype="bed" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
103 <param name="overlap_mode" value="-wa,-wb" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
104 <param name="split" value="False" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
105 <output name="output" file="intersectBed_result2.bed" ftype="bed" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
106 </test>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
107 <test>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
108 <param name="inputA" value="intersectBed1.bed" ftype="bed" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
109 <param name="inputB" value="intersectBed2.bed" ftype="bed" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
110 <param name="invert" value="True" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
111 <param name="split" value="False" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
112 <output name="output" file="intersectBed_result3.bed" ftype="bed" />
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
113 </test>
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
114 </tests>
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
115 <help>
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
116 <![CDATA[
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
117 **What it does**
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
118
26
95a3b2c25bd1 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/bedtools commit b75b9e79cf3186a22dc2e1e9d27c1a080b891b59
iuc
parents: 20
diff changeset
119 By far, the most common question asked of two sets of genomic features is whether or not any of the features in the two sets “overlap” with one another. This is known as feature intersection. bedtools intersect allows one to screen for overlaps between two sets of genomic features. Moreover, it allows one to have fine control as to how the intersections are reported. bedtools intersect works with both @STD_BEDTOOLS_INPUT_LABEL@ and BAM files as input.
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
120
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
121 .. image:: $PATH_TO_IMAGES/intersect-glyph.png
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
122
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
123 .. class:: infomark
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
124
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
125 Note that each BAM alignment is treated individually. Therefore, if one end of a paired-end alignment overlaps an interval in the BED file, yet the other end does not, the output file will only include the overlapping end.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
126
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
127 .. class:: infomark
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
128
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
129 Note that a BAM alignment will be sent to the output file **once** even if it overlaps more than one interval in the BED file.
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
130
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
131 @REFERENCES@
1
82aac94b06c3 Uploaded
iuc
parents: 0
diff changeset
132 ]]>
0
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
133 </help>
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
134 <expand macro="citations" />
b8348686a0b9 Imported from capsule None
iuc
parents:
diff changeset
135 </tool>