Mercurial > repos > iuc > bedtools
comparison intersectBed.xml @ 1:82aac94b06c3 draft
Uploaded
author | iuc |
---|---|
date | Thu, 08 Jan 2015 14:25:51 -0500 |
parents | b8348686a0b9 |
children | 607c0576c6ab |
comparison
equal
deleted
inserted
replaced
0:b8348686a0b9 | 1:82aac94b06c3 |
---|---|
4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
5 </macros> | 5 </macros> |
6 <expand macro="requirements" /> | 6 <expand macro="requirements" /> |
7 <expand macro="stdio" /> | 7 <expand macro="stdio" /> |
8 <command> | 8 <command> |
9 intersectBed | 9 <![CDATA[ |
10 #if $inputA.ext == "bam": | 10 #set inputBs = '" "'.join( [ str( $file ) for $file in $inputB ] ) |
11 -abam $inputA | 11 #set modes = ' '.join( str($overlap_mode).split(',') ) |
12 #else: | |
13 -a $inputA | |
14 #end if | |
15 | 12 |
16 -b $inputB | 13 bedtools intersect |
17 $split | 14 #if $inputA.ext == "bam": |
18 $strand | 15 -abam "${inputA}" |
19 #if str($fraction): | 16 #else: |
20 -f $fraction | 17 -a "${inputA}" |
21 #end if | 18 #end if |
22 $reciprocal | 19 |
23 $invert | 20 -b "${inputBs}" |
24 $once | 21 $split |
25 $header | 22 $strand |
26 $overlap_mode | 23 #if str($fraction) != "None" and str($fraction): |
27 > $output | 24 -f "${fraction}" |
25 #end if | |
26 $reciprocal | |
27 $invert | |
28 $once | |
29 $header | |
30 $modes | |
31 > "${output}" | |
32 ]]> | |
28 </command> | 33 </command> |
29 <inputs> | 34 <inputs> |
30 <param format="bed,bam,vcf,gff,gff3" name="inputA" type="data" label="BED/VCF/GFF/BAM file"/> | 35 <param format="bed,bam,vcf,gff,gff3" name="inputA" type="data" label="BED/VCF/GFF/BAM file"/> |
31 <param format="bed,gff,vcf,gff3" name="inputB" type="data" label="overlap intervals in this BED file?"/> | 36 <param format="bed,bam,gff,vcf,gff3" name="inputB" type="data" multiple="True" label="One or more BAM/BED/GFF/VCF file(s)"/> |
32 | 37 <expand macro="strand2" /> |
33 <param name="strand" type="select" label="Calculate the intersection based on strandedness?"> | 38 <param name="overlap_mode" type="select" multiple="True" label="What should be written to the output file?"> |
34 <option value="" selected="True">Overlaps on either strand</option> | 39 <option value="-wa" selected="True">Write the original entry in A for each overlap (-wa)</option> |
35 <option value="-s">Only overlaps occurring on the **same** strand.</option> | 40 <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> |
36 <option value="-S">Only overlaps occurring on the **opposite** strand.</option> | 41 <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> |
42 <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> | |
43 <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> | |
37 </param> | 44 </param> |
38 | 45 |
39 <param name="overlap_mode" type="select" label="What should be written to the output file?"> | 46 <expand macro="split" /> |
40 <option value="-wa" selected="True">Write the original entry in A for each overlap.</option> | |
41 <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.</option> | |
42 <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.</option> | |
43 <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.</option> | |
44 <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.</option> | |
45 </param> | |
46 | |
47 <param name="split" type="boolean" checked="true" truevalue="-split" falsevalue="" label="Treat split/spliced BAM or BED12 entries as distinct BED intervals when computing coverage." help="If set, the coverage will be calculated based the spliced intervals only. For BAM files, this inspects the CIGAR N operation to infer the blocks for computing coverage. For BED12 files, this inspects the BlockCount, BlockStarts, and BlockEnds fields (i.e., columns 10,11,12). If this option is not set, coverage will be calculated based on the interval's START/END coordinates, and would include introns in the case of RNAseq data." /> | |
48 <!-- -f --> | 47 <!-- -f --> |
49 <param name="fraction" type="text" optional="true" label="Minimum overlap required as a fraction of the BAM alignment" 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)"/> | 48 <param name="fraction" type="text" |
49 label="Minimum overlap required as a fraction of the BAM alignment" | |
50 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)"/> | |
50 <!-- -r --> | 51 <!-- -r --> |
51 <param name="reciprocal" type="boolean" checked="false" truevalue="-r" falsevalue="" label="Require reciprocal overlap." help="If set, the overlap between the BAM alignment and the BED interval must affect the above fraction of both the alignment and the BED interval. (-r)" /> | 52 <expand macro="reciprocal" /> |
52 <!-- -v --> | 53 <!-- -v --> |
53 <param name="invert" type="boolean" checked="false" truevalue="-v" falsevalue="" label="Report only those alignments that **do not** overlap the BED file. (-v)"/> | 54 <param name="invert" type="boolean" checked="false" truevalue="-v" falsevalue="" |
55 label="Report only those alignments that **do not** overlap the BED file" | |
56 help="(-v)"/> | |
54 <!-- -u --> | 57 <!-- -u --> |
55 <param name="once" type="boolean" checked="false" truevalue="-u" falsevalue="" label="Write the original A entry _once_ if _any_ overlaps found in B." help="Just report the fact >=1 hit was found. (-u)" /> | 58 <param name="once" type="boolean" checked="false" truevalue="-u" falsevalue="" |
59 label="Write the original A entry _once_ if _any_ overlaps found in B." | |
60 help="Just report the fact >=1 hit was found. (-u)" /> | |
56 <!-- -c --> | 61 <!-- -c --> |
57 <param name="count" type="boolean" checked="false" truevalue="-c" falsevalue="" label="For each entry in A, report the number of overlaps with B." help="Reports 0 for A entries that have no overlap with B. (-c)" /> | 62 <param name="count" type="boolean" checked="false" truevalue="-c" falsevalue="" |
58 <!-- header --> | 63 label="For each entry in A, report the number of overlaps with B." |
59 <param name="header" type="boolean" checked="false" truevalue="-header" falsevalue="" label="Print the header from the A file prior to results." /> | 64 help="Reports 0 for A entries that have no overlap with B. (-c)" /> |
60 <!-- header --> | 65 <expand macro="print_header" /> |
61 <param name="header" type="boolean" checked="false" truevalue="-header" falsevalue="" label="Print the header from the A file prior to results." /> | |
62 </inputs> | 66 </inputs> |
63 <outputs> | 67 <outputs> |
64 <data format_source="inputA" name="output" metadata_source="inputA" label="Intersection of ${inputA.name} and ${inputB.name}"/> | 68 <data format_source="inputA" name="output" metadata_source="inputA"/> |
65 </outputs> | 69 </outputs> |
70 <tests> | |
71 <test> | |
72 <param name="inputA" value="intersectBed1.bed" ftype="bed" /> | |
73 <param name="inputB" value="intersectBed2.bed" ftype="bed" /> | |
74 <param name="overlap_mode" value="-wa" /> | |
75 <param name="split" value="False" /> | |
76 <output name="output" file="intersectBed_result1.bed" ftype="bed" /> | |
77 </test> | |
78 <test> | |
79 <param name="inputA" value="intersectBed1.bed" ftype="bed" /> | |
80 <param name="inputB" value="intersectBed2.bed" ftype="bed" /> | |
81 <param name="overlap_mode" value="-wa,-wb" /> | |
82 <param name="split" value="False" /> | |
83 <output name="output" file="intersectBed_result2.bed" ftype="bed" /> | |
84 </test> | |
85 <test> | |
86 <param name="inputA" value="intersectBed1.bed" ftype="bed" /> | |
87 <param name="inputB" value="intersectBed2.bed" ftype="bed" /> | |
88 <param name="invert" value="True" /> | |
89 <param name="split" value="False" /> | |
90 <output name="output" file="intersectBed_result3.bed" ftype="bed" /> | |
91 </test> | |
92 </tests> | |
66 <help> | 93 <help> |
67 | 94 <![CDATA[ |
68 **What it does** | 95 **What it does** |
69 | 96 |
70 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 BED/GFF/VCF and BAM files as input. | 97 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 BED/GFF/VCF and BAM files as input. |
71 | 98 |
72 .. image:: $PATH_TO_IMAGES/intersect-glyph.png | 99 .. image:: $PATH_TO_IMAGES/intersect-glyph.png |
78 .. class:: infomark | 105 .. class:: infomark |
79 | 106 |
80 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. | 107 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. |
81 | 108 |
82 @REFERENCES@ | 109 @REFERENCES@ |
83 | 110 ]]> |
84 </help> | 111 </help> |
85 <expand macro="citations" /> | 112 <expand macro="citations" /> |
86 </tool> | 113 </tool> |