# HG changeset patch # User iuc # Date 1415083504 18000 # Node ID b8348686a0b9531178bdf7e44eb4a74fe16fa57f Imported from capsule None diff -r 000000000000 -r b8348686a0b9 Bed12ToBed6.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bed12ToBed6.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,28 @@ + + + + macros.xml + + + + + bed12ToBed16 + -i '$input' + > '$output' + + + + + + + + + +**What it does** + +bed12ToBed6 is a convenience tool that converts BED features in BED12 (a.k.a. “blocked” BED features such as genes) to discrete BED6 features. For example, in the case of a gene with six exons, bed12ToBed6 would create six separate BED6 features (i.e., one for each exon). + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 BedToBam.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BedToBam.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,34 @@ + + + + macros.xml + + + + + bedtools bedtobam + $ubam + $bed12 + -mapq $mapq + -i '$input' + > '$output' + + + + + + + + + + + + +**What it does** + +bedToBam converts features in a feature file to BAM format. This is useful as an efficient means of storing large genome annotations in a compact, indexed format for visualization purposes. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 annotateBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/annotateBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,66 @@ + + + + macros.xml + + + + + bedtools annotate + -i $inputA + -files + #for $bed in $names.beds: + $bed.input + #end for + + #if $names.names_select == 'yes': + -names + #for $bed in $names.beds: + $bed.inputName + #end for + #end if + $strand + $counts + $both + > $output + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +bedtools annotate, well, annotates one BED/VCF/GFF file with the coverage and number of overlaps observed from multiple other BED/VCF/GFF files. In this way, it allows one to ask to what degree one feature coincides with multiple other feature types with a single command. + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 bamToBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bamToBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,55 @@ + + + + macros.xml + + + + + bedtools bamtobed + $option + $ed_score + -i '$input' + > '$output' + #if str($tag): + -tag $tag + #end if + + + + + + + + + + + + + + + + + +**What it does** + +bedtools bamtobed is a conversion utility that converts sequence alignments in BAM format into BED, BED12, and/or BEDPE records. + +.. class:: infomark + +The "Report spliced BAM alignment..." option breaks BAM alignments with the "N" (splice) operator into distinct BED entries. For example, using this option on a CIGAR such as 50M1000N50M would, by default, produce a single BED record that spans 1100bp. However, using this option, it would create two separate BED records that are each 50bp in size and are separated by 1000bp (the size of the N operation). This is important for RNA-seq and structural variation experiments. + + +.. class:: warningmark + +If using a custom BAM alignment TAG as the BED score, note that this must be a numeric tag (e.g., type "i" as in NM:i:0). + +.. class:: warningmark + +If creating a BEDPE output (see output formatting options), the BAM file should be sorted by query name. + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 bamToFastq.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bamToFastq.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,33 @@ + + + + macros.xml + + + + + bedtools bamtofastq + $tags + $fq2 + -i '$input' + -fq '$output' + + + + + + + + + + + +**What it does** + +bedtools bamtofastq is a conversion utility for extracting FASTQ records from sequence alignments in BAM format. + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 bedpeToBam.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bedpeToBam.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,38 @@ + + + + macros.xml + + + + + bedtools bedpetobam + $ubam + -mapq $mapq + -i '$input' + -g $genome + > '$output' + + + + + + + + + + + + +**What it does** + +Converts feature records to BAM format. + +.. class:: warningmark + +BED files must be at least BED4 to create BAM (needs name field). + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 closestBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/closestBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,42 @@ + + + + macros.xml + + + + + closestBed + $strand + $addition + -t $ties + -a $inputA + -b $inputB + > $output + + + + + + + + + + + + + + + + + + + +**What it does** + +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. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 clusterBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clusterBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,41 @@ + + + + macros.xml + + + + + bedtools cluster + $strand + -d $distance + -i $inputA + > $output + + + + + + + + + + + +**What it does** + +Similar to merge, cluster report each set of overlapping or “book-ended” features in an interval file. In contrast to merge, cluster does not flatten the cluster of intervals into a new meta-interval; instead, it assigns an unique cluster ID to each record in each cluster. This is useful for having fine control over how sets of overlapping intervals in a single interval file are combined. + +.. image:: $PATH_TO_IMAGES/cluster-glyph.png + +.. class:: warningmark + +bedtools cluster requires that you presort your data by chromosome and then by start position (e.g., sort -k1,1 -k2,2n in.bed > in.sorted.bed for BED files). + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 complementBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/complementBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,32 @@ + + + + macros.xml + + + + + complementBed + -d $distance + -g genome + > $output + + + + + + + + + + +**What it does** + +bedtools complement returns all intervals in a genome that are not covered by at least one interval in the input BED/GFF/VCF file. + +.. image:: $PATH_TO_IMAGES/complement-glyph.png + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 coverageBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coverageBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,64 @@ + + of features in file A across the features in file B (coverageBed) + + macros.xml + + + + + coverageBed + #if $inputA.ext == "bam" + -abam '$inputA' + #else + -a '$inputA' + #end if + -b '$inputB' + $d + $hist + $split + $strandedness + | sort -k1,1 -k2,2n + > '$output' + + + + + + + + + + + + + + + + + + + +**What it does** + +coverageBed_ computes both the depth and breadth of coverage of features in +file A across the features in file B. For example, coverageBed can compute the coverage of sequence alignments +(file A) across 1 kilobase (arbitrary) windows (file B) tiling a genome of interest. +One advantage that coverageBed offers is that it not only counts the number of features that +overlap an interval in file B, it also computes the fraction of bases in B interval that were overlapped by one or more features. +Thus, coverageBed also computes the breadth of coverage for each interval in B. + +.. _coverageBed: http://bedtools.readthedocs.org/en/latest/content/tools/coverage.html + +.. class:: infomark + +The output file will be comprised of each interval from your original target BED file, plus an additional column indicating the number of intervals in your source file that overlapped that target interval. + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 expandBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/expandBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,30 @@ + + + + macros.xml + + + + + bedtools expand + -c $cols + -i $inputA + > $output + + + + + + + + + + +**What it does** + +Replicate lines in a file based on columns of comma-separated values. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 flankbed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flankbed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,49 @@ + + + + macros.xml + + + + + flankBed + $pct + $strand + -g $genome + -i $inputA + + #if $addition.addition_select == 'b': + -b $addition.b + #else: + -l $addition.l + -r $addition.r + #end if + + > $output + + + + + + + + + + + + + +**What it does** + +bedtools flank will optionally create flanking intervals whose size is user-specified fraction of the original interval. + +.. image:: $PATH_TO_IMAGES/flank-glyph.png + +.. class:: warningmark + +In order to prevent creating intervals that violate chromosome boundaries, bedtools flank requires a genome file defining the length of each chromosome or contig. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 genomeCoverageBed_bedgraph.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genomeCoverageBed_bedgraph.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,106 @@ + + + + + macros.xml + + + + + genomeCoverageBed + #if $input.ext == "bam" + -ibam '$input' + #else + -i '$input' + -g ${chromInfo} + #end if + + #if str($scale): + -scale $scale + #end if + + -bg + $zero_regions + $split + $strand + > '$output' + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool calculates the genome-wide coverage of intervals defined in a BAM or BED file and reports them in BedGraph format. + +.. class:: warningmark + +The input BED or BAM file must be sorted by chromosome name (but doesn't necessarily have to be sorted by start position). + +----- + +**Example 1** + +Input (BED format)- +Overlapping, un-sorted intervals:: + + chr1 140 176 + chr1 100 130 + chr1 120 147 + + +Output (BedGraph format)- +Sorted, non-overlapping intervals, with coverage value on the 4th column:: + + chr1 100 120 1 + chr1 120 130 2 + chr1 130 140 1 + chr1 140 147 2 + chr1 147 176 1 + +----- + +**Example 2 - with ZERO-Regions selected (assuming hg19)** + +Input (BED format)- +Overlapping, un-sorted intervals:: + + chr1 140 176 + chr1 100 130 + chr1 120 147 + + +Output (BedGraph format)- +Sorted, non-overlapping intervals, with coverage value on the 4th column:: + + chr1 0 100 0 + chr1 100 120 1 + chr1 120 130 2 + chr1 130 140 1 + chr1 140 147 2 + chr1 147 176 1 + chr1 176 249250621 0 + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 genomeCoverageBed_histogram.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/genomeCoverageBed_histogram.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,68 @@ + + + + + macros.xml + + + + + genomeCoverageBed + #if $input.ext == "bam" + -ibam '$input' + #else + -i '$input' + -g ${chromInfo} + #end if + #if str($max): + -max $max + #end if + > '$output' + + + + + + + + + + + + +**What it does** + +This tool calculates a histogram of genome coverage depth based on mapped reads in BAM format or intervals in BED format. + + +------ + + +.. class:: infomark + +The output file will contain five columns: + + * 1. Chromosome name (or 'genome' for whole-genome coverage) + * 2. Coverage depth + * 3. The number of bases on chromosome (or genome) with depth equal to column 2. + * 4. The size of chromosome (or entire genome) in base pairs + * 5. The fraction of bases on chromosome (or entire genome) with depth equal to column 2. + +**Example Output**:: + + chr2L 0 1379895 23011544 0.0599653 + chr2L 1 837250 23011544 0.0363839 + chr2L 2 904442 23011544 0.0393038 + chr2L 3 913723 23011544 0.0397072 + chr2L 4 952166 23011544 0.0413778 + chr2L 5 967763 23011544 0.0420555 + chr2L 6 986331 23011544 0.0428624 + chr2L 7 998244 23011544 0.0433801 + chr2L 8 995791 23011544 0.0432735 + chr2L 9 996398 23011544 0.0432999 + + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 getfastaBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/getfastaBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,45 @@ + + + + macros.xml + + + + + bedtools getfasta + $name + $tab + $strand + $split + -fi $fasta + -bed $inputA + -fo $output + + + + + + + + + + + + + +**What it does** + +bedtools getfasta will extract the sequence defined by the coordinates in a BED interval and create a new FASTA entry in the output file for each extracted sequence. By default, the FASTA header for each extracted sequence will be formatted as follows: “<chrom>:<start>-<end>”. + +.. image:: $PATH_TO_IMAGES/getfasta-glyph.png + +.. class:: warningmark + +1. The headers in the input FASTA file must exactly match the chromosome column in the BED file. + +2. You can use the UNIX fold command to set the line width of the FASTA output. For example, fold -w 60 will make each line of the FASTA file have at most 60 nucleotides for easy viewing. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 groupbyBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/groupbyBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,44 @@ + + + + macros.xml + + + + + bedtools groupby + -c $cols + -g $group + -o $operation + -i $inputA + > $output + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +Replicate lines in a file based on columns of comma-separated values. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 intersectBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/intersectBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,86 @@ + + + + macros.xml + + + + + intersectBed + #if $inputA.ext == "bam": + -abam $inputA + #else: + -a $inputA + #end if + + -b $inputB + $split + $strand + #if str($fraction): + -f $fraction + #end if + $reciprocal + $invert + $once + $header + $overlap_mode + > $output + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +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. + +.. image:: $PATH_TO_IMAGES/intersect-glyph.png + +.. class:: infomark + +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. + +.. class:: infomark + +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. + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 jaccardBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jaccardBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,48 @@ + + + + macros.xml + + + + + bedtools jaccard + + $reciprocal + $strand + $split + -f $overlap + -a $inputA + -b $inputB + > $output + + + + + + + + + + + + + + + + +**What it does** + +By default, bedtools jaccard reports the length of the intersection, the length of the union (minus the intersection), the final Jaccard statistic reflecting the similarity of the two sets, as well as the number of intersections. +Whereas the bedtools intersect tool enumerates each an every intersection between two sets of genomic intervals, one often needs a single statistic reflecting the similarity of the two sets based on the intersections between them. The Jaccard statistic is used in set theory to represent the ratio of the intersection of two sets to the union of the two sets. Similarly, Favorov et al [1] reported the use of the Jaccard statistic for genome intervals: specifically, it measures the ratio of the number of intersecting base pairs between two sets to the number of base pairs in the union of the two sets. The bedtools jaccard tool implements this statistic, yet modifies the statistic such that the length of the intersection is subtracted from the length of the union. As a result, the final statistic ranges from 0.0 to 1.0, where 0.0 represents no overlap and 1.0 represent complete overlap. + +.. image:: $PATH_TO_IMAGES/jaccard-glyph.png + +.. class:: warningmark + +The jaccard tool requires that your data is pre-sorted by chromosome and then by start position (e.g., sort -k1,1 -k2,2n in.bed > in.sorted.bed for BED files). + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 linksBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linksBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,34 @@ + + + + macros.xml + + + + + linksBed + -base $basename + -org $org + -db $db + -i $inputA + > $output + + + + + + + + + + + + +**What it does** + +Creates an HTML file with links to an instance of the UCSC Genome Browser for all features / intervals in a file. This is useful for cases when one wants to manually inspect through a large set of annotations or features. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 macros.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,90 @@ + + + + bedtools + + bedtools --version + + 2.19 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +------ + +This tool is part of the `bedtools package`_ from the `Quinlan laboratory`_. + +.. _bedtools package: https://github.com/arq5x/bedtools2 +.. _Quinlan laboratory: http://cphg.virginia.edu/quinlan/ + + + + + 10.1093/bioinformatics/btq033 + + + diff -r 000000000000 -r b8348686a0b9 makewindowsBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makewindowsBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,79 @@ + + + + macros.xml + + + + + bedtools makewindows + #if $type.type_select == 'genome': + -g $type.genome + #else: + -i $type.inputA + #end if + #if $action.action_select == 'windowsize': + -w $action.windowsize + #if $action.step_size.step_size_select == 'yes': + -s $action.step_size.step_size + #end if + #else: + -n $action.number + #end if + $sourcename + > $output + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +Makes adjacent or sliding windows across a genome or BED file. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 mapBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mapBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,70 @@ + + + + macros.xml + + + + + bedtools map + -a $inputA + -b $inputB + $strand + -o $operation + -c $col + -f $overlap + $reciprocal + $split + $header + #if $genome.genome_choose == "-g" : + -g $genome.genome + #end if + > $output + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +bedtools map allows one to map overlapping features in a B file onto features in an A file and apply statistics and/or summary operations on those features. + +.. image:: $PATH_TO_IMAGES/map-glyph.png + +.. class:: infomark + +bedtools map requires each input file to be sorted by genome coordinate. For BED files, this can be done with sort -k1,1 -k2,2n. Other sorting criteria are allowed if a genome file (-g) is provides that specifies the expected chromosome order. + +.. class:: infomark + +The map tool is substantially faster in versions 2.19.0 and later. The plot below demonstrates the increased speed when, for example, counting the number of exome alignments that align to each exon. The bedtools times are compared to the bedops bedmap utility as a point of reference. + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 maskFastaBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/maskFastaBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,37 @@ + + + + macros.xml + + + + + bedtools maskfasta + $soft + -mc $mc + -fi $fasta + -bed $inputA + -fo $output + + + + + + + + + + + + + +**What it does** + +bedtools maskfasta masks sequences in a FASTA file based on intervals defined in a feature file. The headers in the input FASTA file must exactly match the chromosome column in the feature file. This may be useful fro creating your own masked genome file based on custom annotations or for masking all but your target regions when aligning sequence data from a targeted capture experiment. + +.. image:: $PATH_TO_IMAGES/maskfasta-glyph.png + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 mergeBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mergeBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,204 @@ + + (mergeBed) + + macros.xml + + + + + mergeBed + -i $input + $strandedness + $report_number + -d $distance + $nms + #if str($scores) != 'none' + -scores $scores + #end if + > $output + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +bedtools merge combines overlapping or "book-ended" features in an interval file into a single feature which spans all of the combined features. + + +.. image:: $PATH_TO_IMAGES/merge-glyph.png + + +.. class:: warningmark + +bedtools merge requires that you presort your data by chromosome and then by start position. + + +========================================================================== +Default behavior +========================================================================== +By default, ``bedtools merge`` combines overlapping (by at least 1 bp) and/or +bookended intervals into a single, "flattened" or "merged" interval. + +:: + + $ cat A.bed + chr1 100 200 + chr1 180 250 + chr1 250 500 + chr1 501 1000 + + $ bedtools merge -i A.bed + chr1 100 500 + chr1 501 1000 + + +========================================================================== +*-s* Enforcing "strandedness" +========================================================================== +The ``-s`` option will only merge intervals that are overlapping/bookended +*and* are on the same strand. + +:: + + $ cat A.bed + chr1 100 200 a1 1 + + chr1 180 250 a2 2 + + chr1 250 500 a3 3 - + chr1 501 1000 a4 4 + + + $ bedtools merge -i A.bed -s + chr1 100 250 + + chr1 501 1000 + + chr1 250 500 - + + +========================================================================== +*-n* Reporting the number of features that were merged +========================================================================== +The -n option will report the number of features that were combined from the +original file in order to make the newly merged feature. If a feature in the +original file was not merged with any other features, a "1" is reported. + +:: + + $ cat A.bed + chr1 100 200 + chr1 180 250 + chr1 250 500 + chr1 501 1000 + + $ bedtools merge -i A.bed -n + chr1 100 500 3 + chr1 501 1000 1 + + +========================================================================== +*-d* Controlling how close two features must be in order to merge +========================================================================== +By default, only overlapping or book-ended features are combined into a new +feature. However, one can force ``merge`` to combine more distant features +with the ``-d`` option. For example, were one to set ``-d`` to 1000, any +features that overlap or are within 1000 base pairs of one another will be +combined. + +:: + + $ cat A.bed + chr1 100 200 + chr1 501 1000 + + $ bedtools merge -i A.bed + chr1 100 200 + chr1 501 1000 + + $ bedtools merge -i A.bed -d 1000 + chr1 100 200 1000 + + +============================================================= +*-nms* Reporting the names of the features that were merged +============================================================= +Occasionally, one might like to know that names of the features that were +merged into a new feature. The ``-nms`` option will add an extra column to the +``merge`` output which lists (separated by semicolons) the names of the +merged features. + +:: + + $ cat A.bed + chr1 100 200 A1 + chr1 150 300 A2 + chr1 250 500 A3 + + $ bedtools merge -i A.bed -nms + chr1 100 500 A1,A2,A3 + + +=============================================================== +*-scores* Reporting the scores of the features that were merged +=============================================================== +Similarly, we might like to know that scores of the features that were +merged into a new feature. Enter the ``-scores`` option. One can specify +how the scores from each overlapping interval should be reported. + +:: + + $ cat A.bed + chr1 100 200 A1 1 + chr1 150 300 A2 2 + chr1 250 500 A3 3 + + $ bedtools merge -i A.bed -scores mean + chr1 100 500 2 + + $ bedtools merge -i A.bed -scores max + chr1 100 500 3 + + $ bedtools merge -i A.bed -scores collapse + chr1 100 500 1,2,3 + + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 multiCov.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiCov.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,58 @@ + + + + macros.xml + + + + + bedtools multicov + -bed $input1 + -bam + #for $bam in $bams: + $bam.input + #end for + $strand + -f $overlap + $reciprocal + $split + -q $mapq + $duplicate + $failed + $proper + > $output + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +bedtools multicov, reports the count of alignments from multiple position-sorted and indexed BAM files that overlap intervals in a BED file. Specifically, for each BED interval provided, it reports a separate count of overlapping alignments from each BAM file. + +.. class:: infomark + +bedtools multicov depends upon index BAM files in order to count the number of overlaps in each BAM file. As such, each BAM file should be position sorted (samtool sort aln.bam aln.sort) and indexed (samtools index aln.sort.bam) with either samtools or bamtools. + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 multiIntersectBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiIntersectBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,196 @@ + + + + macros.xml + + + + + multiIntersectBed + $header + #if $zero.value == True: + -empty + -g ${chromInfo} + #end if + + -i '$input1' + '$input2' + #for $q in $beds + '${q.input}' + #end for + + -names + #if $name1.choice == "tag": + '${input1.name}' + #else + '${name1.custom_name}' + #end if + + #if $name2.choice == "tag": + '${input2.name}' + #else + '${name2.custom_name}' + #end if + + #for $q in $beds + #if $q.name.choice == "tag": + '${q.input.name}' + #else + '${q.input.custom_name}' + #end if + #end for + > '$output' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool identifies common intervals among multiple, sorted BED files. Intervals can be common among 0 to N of the N input BED files. The pictorial and raw data examples below illustrate the behavior of this tool more clearly. + + +.. image:: http://people.virginia.edu/~arq5x/files/bedtools-galaxy/mbi.png + + +.. class:: warningmark + +This tool requires that each BED file is reference-sorted (chrom, then start). + + +.. class:: infomark + +The output file will contain five fixed columns, plus additional columns for each BED file: + + * 1. Chromosome name (or 'genome' for whole-genome coverage). + * 2. The zero-based start position of the interval. + * 3. The one-based end position of the interval. + * 4. The number of input files that had at least one feature overlapping this interval. + * 5. A list of input files or labels that had at least one feature overlapping this interval. + * 6. For each input file, an indication (1 = Yes, 0 = No) of whether or not the file had at least one feature overlapping this interval. + +------ + +**Example input**:: + + # a.bed + chr1 6 12 + chr1 10 20 + chr1 22 27 + chr1 24 30 + + # b.bed + chr1 12 32 + chr1 14 30 + + # c.bed + chr1 8 15 + chr1 10 14 + chr1 32 34 + + +------ + +**Example without a header and without reporting intervals with zero coverage**:: + + + chr1 6 8 1 1 1 0 0 + chr1 8 12 2 1,3 1 0 1 + chr1 12 15 3 1,2,3 1 1 1 + chr1 15 20 2 1,2 1 1 0 + chr1 20 22 1 2 0 1 0 + chr1 22 30 2 1,2 1 1 0 + chr1 30 32 1 2 0 1 0 + chr1 32 34 1 3 0 0 1 + + +**Example adding a header line**:: + + + chrom start end num list a.bed b.bed c.bed + chr1 6 8 1 1 1 0 0 + chr1 8 12 2 1,3 1 0 1 + chr1 12 15 3 1,2,3 1 1 1 + chr1 15 20 2 1,2 1 1 0 + chr1 20 22 1 2 0 1 0 + chr1 22 30 2 1,2 1 1 0 + chr1 30 32 1 2 0 1 0 + chr1 32 34 1 3 0 0 1 + + +**Example adding a header line and custom file labels**:: + + + chrom start end num list joe bob sue + chr1 6 8 1 joe 1 0 0 + chr1 8 12 2 joe,sue 1 0 1 + chr1 12 15 3 joe,bob,sue 1 1 1 + chr1 15 20 2 joe,bob 1 1 0 + chr1 20 22 1 bob 0 1 0 + chr1 22 30 2 joe,bob 1 1 0 + chr1 30 32 1 bob 0 1 0 + chr1 32 34 1 sue 0 0 1 + + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 nucBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nucBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,39 @@ + + + + macros.xml + + + + + bedtools nuc + $strand + $seq + $pattern + $case + -fi $fasta + -bed $inputA + > $output + + + + + + + + + + + + + + + +**What it does** + +Profiles the nucleotide content of intervals in a fasta file. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 overlapBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/overlapBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,30 @@ + + + + macros.xml + + + + + overlap + -i $inputA + -cols $cols + > $output + + + + + + + + + + +**What it does** + +overlap computes the amount of overlap (in the case of positive values) or distance (in the case of negative values) between feature coordinates occurring on the same input line and reports the result at the end of the same line. In this way, it is a useful method for computing custom overlap scores from the output of other BEDTools. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 randomBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/randomBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,35 @@ + + + + macros.xml + + + + + bedtools random + -g $genome + -l $length + -n $intervals + #if $seed.choose: + -seed $seed.seed + #end if + + + + + + + + + + + + +**What it does** + +bedtools random will generate a random set of intervals in BED6 format. One can specify both the number (-n) and the size (-l) of the intervals that should be generated. + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 reldist.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/reldist.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,36 @@ + + + + macros.xml + + + + + bedtools reldist + -a $inputA + -b $inputB + $detail + + + + + + + + + + + +**What it does** + +Traditional approaches to summarizing the similarity between two sets of genomic intervals are based upon the number or proportion of intersecting intervals. However, such measures are largely blind to spatial correlations between the two sets where, dpesite consistent spacing or proximity, intersections are rare (for example, enhancers and transcription start sites rarely overlap, yet they are much closer to one another than two sets of random intervals). Favorov et al [1] proposed a relative distance metric that describes distribution of relative distances between each interval in one set nd the two closest intervals in another set (see figure above). If there is no spatial correlation between the two sets, one would expect the relative distances to be uniformaly distributed among the relative distances ranging from 0 to 0.5. If, however, the intervals tend to be much closer than expected by chance, the distribution of observed relative distances would be shifted towards low relative distance values (e.g., the figure below). + +.. image:: $PATH_TO_IMAGES/reldist-glyph.png + +.. class:: infomark + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 shuffleBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/shuffleBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,68 @@ + + + + macros.xml + + + + + bedtools shuffle + -g $genome + -i $inputA + $bedpe + #if $seed.choose: + -seed $seed.seed + #end if + #if $excl.choose: + -excl $excl.excl + -f $overlap + #end if + #if $incl.choose: + -incl $incl.incl + #end if + $chrom + $chromfirst + $nooverlap + $allowBeyond + -maxTries $maxtries + > $output + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +bedtools shuffle will randomly permute the genomic locations of a feature file among a genome defined in a genome file. One can also provide an “exclusions” BED/GFF/VCF file that lists regions where you do not want the permuted features to be placed. For example, one might want to prevent features from being placed in known genome gaps. shuffle is useful as a null basis against which to test the significance of associations of one feature with another. +.. image:: $PATH_TO_IMAGES/shuffle-glyph.png +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 slopBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/slopBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,49 @@ + + + + macros.xml + + + + + bedtools slop + $pct + $strand + -g $genome + -i $inputA + #if $addition.addition_select == 'b': + -b $addition.b + #else: + -l $addition.l + -r $addition.r + #end if + $header + + > $output + + + + + + + + + + + + + + +**What it does** + +bedtools slop will increase the size of each feature in a feature file by a user-defined number of bases. While something like this could be done with an awk '{OFS="\t" print $1,$2-<slop>,$3+<slop>}', bedtools slop will restrict the resizing to the size of the chromosome (i.e. no start < 0 and no end > chromosome size). + +.. image:: $PATH_TO_IMAGES/slop-glyph.png + +.. class:: warningmark + +In order to prevent the extension of intervals beyond chromosome boundaries, bedtools slop requires a genome file defining the length of each chromosome or contig. +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 sortBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sortBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,46 @@ + + + + macros.xml + + + + + sortBed -i $input $option > $output + + + + + + + + + + + + + + + + + + + + + +**What it does** + +Sorts a feature file by chromosome and other criteria. + + +.. class:: warningmark + +It should be noted that sortBed is merely a convenience utility, as the UNIX sort utility +will sort BED files more quickly while using less memory. For example, UNIX sort will sort a BED file +by chromosome then by start position in the following manner: sort -k 1,1 -k2,2 -n a.bed + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 static/images/cluster-glyph.png Binary file static/images/cluster-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/complement-glyph.png Binary file static/images/complement-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/flank-glyph.png Binary file static/images/flank-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/genomecov-glyph.png Binary file static/images/genomecov-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/getfasta-glyph.png Binary file static/images/getfasta-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/intersect-glyph.png Binary file static/images/intersect-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/jaccard-glyph.png Binary file static/images/jaccard-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/map-glyph.png Binary file static/images/map-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/maskfasta-glyph.png Binary file static/images/maskfasta-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/merge-glyph.png Binary file static/images/merge-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/reldist-glyph.png Binary file static/images/reldist-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/reldist-plot.png Binary file static/images/reldist-plot.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/shuffle-glyph.png Binary file static/images/shuffle-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/slop-glyph.png Binary file static/images/slop-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/subtract-glyph.png Binary file static/images/subtract-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 static/images/window-glyph.png Binary file static/images/window-glyph.png has changed diff -r 000000000000 -r b8348686a0b9 subtractBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/subtractBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,49 @@ + + + + macros.xml + + + + + bedtools subtract + $strand + -a $inputA + -b $inputB + -f $overlap + $removeIfOverlap + > $output + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +bedtools subtract searches for features in B that overlap A. If an overlapping feature is found in B, the overlapping portion is removed from A and the remaining portion of A is reported. If a feature in B overlaps all of a feature in A, the A feature will not be reported. + +.. image:: $PATH_TO_IMAGES/subtract-glyph.png + +@REFERENCES@ + + + diff -r 000000000000 -r b8348686a0b9 tagBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tagBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,51 @@ + + + + macros.xml + + + + + bedtools tag + -i $inputA + -files + #for $bed in beds: + $bed.input + #end for + -f $overlap + $strand + -tag $tag + $field + > $output + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +Annotates a BAM file based on overlaps with multiple BED/GFF/VCF files on the intervals in an input bam file + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 test-data/0.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/0.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,4 @@ +chr1 100 200 +chr1 180 250 +chr1 250 500 +chr1 501 1000 diff -r 000000000000 -r b8348686a0b9 test-data/0_result.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/0_result.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,2 @@ +chr1 100 500 +chr1 501 1000 diff -r 000000000000 -r b8348686a0b9 test-data/1.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/1.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,4 @@ +chr1 100 200 a1 1 + +chr1 180 250 a2 2 + +chr1 250 500 a3 3 - +chr1 501 1000 a4 4 + diff -r 000000000000 -r b8348686a0b9 test-data/1_result.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/1_result.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,3 @@ +chr1 100 250 + +chr1 501 1000 + +chr1 250 500 - diff -r 000000000000 -r b8348686a0b9 test-data/2.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/2.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,4 @@ +chr1 100 200 +chr1 180 250 +chr1 250 500 +chr1 501 1000 diff -r 000000000000 -r b8348686a0b9 test-data/2_result.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/2_result.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,2 @@ +chr1 100 500 3 +chr1 501 1000 1 diff -r 000000000000 -r b8348686a0b9 test-data/3.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/3.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,2 @@ +chr1 100 200 +chr1 501 1000 diff -r 000000000000 -r b8348686a0b9 test-data/3_result_1000.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/3_result_1000.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,1 @@ +chr1 100 200 1000 diff -r 000000000000 -r b8348686a0b9 test-data/A.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/A.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,5 @@ +chr1 100 200 +chr1 180 250 +chr1 250 500 +chr1 501 1000 + diff -r 000000000000 -r b8348686a0b9 test-data/annotateBed1.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/annotateBed1.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,4 @@ +chr1 100 200 nasty 1 - +chr2 500 1000 ugly 2 + +chr3 1000 5000 big 3 - + diff -r 000000000000 -r b8348686a0b9 test-data/annotateBed2.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/annotateBed2.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,3 @@ +chr1 150 200 geneA 1 + +chr1 175 250 geneB 2 + +chr3 0 10000 geneC 3 - diff -r 000000000000 -r b8348686a0b9 test-data/annotateBed3.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/annotateBed3.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,3 @@ +chr1 0 10000 cons1 1 + +chr2 700 10000 cons2 2 - +chr3 4000 10000 cons3 3 + diff -r 000000000000 -r b8348686a0b9 test-data/annotateBed4.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/annotateBed4.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,4 @@ +chr1 0 120 known1 - +chr1 150 160 known2 - +chr2 0 10000 known3 + + diff -r 000000000000 -r b8348686a0b9 test-data/closestBedA.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/closestBedA.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,1 @@ +chr1 100 200 diff -r 000000000000 -r b8348686a0b9 test-data/closestBedB.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/closestBedB.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,2 @@ +chr1 500 1000 +chr1 1300 2000 diff -r 000000000000 -r b8348686a0b9 test-data/expandInput.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/expandInput.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,2 @@ +chr1 10 20 1,2,3 10,20,30 +chr1 40 50 4,5,6 40,50,60 diff -r 000000000000 -r b8348686a0b9 test-data/groupbyBed.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/groupbyBed.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,14 @@ +chr21 9719758 9729320 variant1 chr21 9719768 9721892 ALR/Alpha 1004 + +chr21 9719758 9729320 variant1 chr21 9721905 9725582 ALR/Alpha 1010 + +chr21 9719758 9729320 variant1 chr21 9725582 9725977 L1PA3 3288 + +chr21 9719758 9729320 variant1 chr21 9726021 9729309 ALR/Alpha 1051 + +chr21 9729310 9757478 variant2 chr21 9729320 9729809 L1PA3 3897 - +chr21 9729310 9757478 variant2 chr21 9729809 9730866 L1P1 8367 + +chr21 9729310 9757478 variant2 chr21 9730866 9734026 ALR/Alpha 1036 - +chr21 9729310 9757478 variant2 chr21 9734037 9757471 ALR/Alpha 1182 - +chr21 9795588 9796685 variant3 chr21 9795589 9795713 (GAATG)n 308 + +chr21 9795588 9796685 variant3 chr21 9795736 9795894 (GAATG)n 683 + +chr21 9795588 9796685 variant3 chr21 9795911 9796007 (GAATG)n 345 + +chr21 9795588 9796685 variant3 chr21 9796028 9796187 (GAATG)n 756 + +chr21 9795588 9796685 variant3 chr21 9796202 9796615 (GAATG)n 891 + +chr21 9795588 9796685 variant3 chr21 9796637 9796824 (GAATG)n 621 + diff -r 000000000000 -r b8348686a0b9 test-data/groupbyinput.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/groupbyinput.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,14 @@ +chr21 9719758 9729320 variant1 chr21 9719768 9721892 ALR/Alpha 1004 + +chr21 9719758 9729320 variant1 chr21 9721905 9725582 ALR/Alpha 1010 + +chr21 9719758 9729320 variant1 chr21 9725582 9725977 L1PA3 3288 + +chr21 9719758 9729320 variant1 chr21 9726021 9729309 ALR/Alpha 1051 + +chr21 9729310 9757478 variant2 chr21 9729320 9729809 L1PA3 3897 - +chr21 9729310 9757478 variant2 chr21 9729809 9730866 L1P1 8367 + +chr21 9729310 9757478 variant2 chr21 9730866 9734026 ALR/Alpha 1036 - +chr21 9729310 9757478 variant2 chr21 9734037 9757471 ALR/Alpha 1182 - +chr21 9795588 9796685 variant3 chr21 9795589 9795713 (GAATG)n 308 + +chr21 9795588 9796685 variant3 chr21 9795736 9795894 (GAATG)n 683 + +chr21 9795588 9796685 variant3 chr21 9795911 9796007 (GAATG)n 345 + +chr21 9795588 9796685 variant3 chr21 9796028 9796187 (GAATG)n 756 + +chr21 9795588 9796685 variant3 chr21 9796202 9796615 (GAATG)n 891 + +chr21 9795588 9796685 variant3 chr21 9796637 9796824 (GAATG)n 621 + diff -r 000000000000 -r b8348686a0b9 test-data/mapBedA.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/mapBedA.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,4 @@ +chr1 10 20 a1 1 + +chr1 50 60 a2 2 - +chr1 80 90 a3 3 - + diff -r 000000000000 -r b8348686a0b9 test-data/mapBedB.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/mapBedB.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,5 @@ +chr1 12 14 b1 2 + +chr1 13 15 b2 5 - +chr1 16 18 b3 5 + +chr1 82 85 b4 2 - +chr1 85 87 b5 3 + diff -r 000000000000 -r b8348686a0b9 test-data/mygenome.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/mygenome.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,2 @@ +chr1 1000 +chr2 800 diff -r 000000000000 -r b8348686a0b9 test-data/shuffleBedA.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/shuffleBedA.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,2 @@ +chr1 0 100 a1 1 + +chr1 0 1000 a2 2 - diff -r 000000000000 -r b8348686a0b9 test-data/shuffleBedGenome.genome --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/shuffleBedGenome.genome Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,5 @@ +chr1 10000 +chr2 8000 +chr3 5000 +chr4 2000 + diff -r 000000000000 -r b8348686a0b9 test-data/t --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/t Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,4 @@ +chr1 100 200 nasty 1 - +chr2 500 1000 ugly 2 + +chr3 1000 5000 big 3 - + diff -r 000000000000 -r b8348686a0b9 test-data/windowBedA.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/windowBedA.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,1 @@ +chr1 100 200 diff -r 000000000000 -r b8348686a0b9 test-data/windowBedB.bed --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/windowBedB.bed Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,2 @@ +chr1 500 1000 +chr1 1300 2000 diff -r 000000000000 -r b8348686a0b9 tool_dependencies.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r b8348686a0b9 unionBedGraphs.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/unionBedGraphs.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,232 @@ + + + + macros.xml + + + + unionBedGraphs + $header + -filler '$filler' + #if $zero.value == True: + -empty + -g ${chromInfo} + #end if + + -i '$input1' + '$input2' + #for $q in $bedgraphs + '${q.input}' + #end for + + -names + #if $name1.choice == "tag": + '${input1.name}' + #else + '${name1.custom_name}' + #end if + + #if $name2.choice == "tag": + '${input2.name}' + #else + '${name2.custom_name}' + #end if + + #for $q in $bedgraphs + #if $q.name.choice == "tag": + '${q.input.name}' + #else + '${q.input.custom_name}' + #end if + #end for + > '$output' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +This tool merges multiple BedGraph files, allowing direct and fine-scale coverage comparisons among many samples/files. The BedGraph files need not represent the same intervals; the tool will identify both common and file-specific intervals. In addition, the BedGraph values need not be numeric: one can use any text as the BedGraph value and the tool will compare the values from multiple files. + +.. image:: http://people.virginia.edu/~arq5x/files/bedtools-galaxy/ubg.png + + +.. class:: warningmark + +This tool requires that each BedGraph file is reference-sorted (chrom, then start) and contains non-overlapping intervals (within a given file). + + +------ + +**Example input**:: + + # 1.bedgraph + chr1 1000 1500 10 + chr1 2000 2100 20 + + # 2.bedgraph + chr1 900 1600 60 + chr1 1700 2050 50 + + # 3.bedgraph + chr1 1980 2070 80 + chr1 2090 2100 20 + + +------ + +**Examples using the Zero Coverage checkbox** + +Output example (*without* checking "Report regions with zero coverage"):: + + chr1 900 1000 0 60 0 + chr1 1000 1500 10 60 0 + chr1 1500 1600 0 60 0 + chr1 1700 1980 0 50 0 + chr1 1980 2000 0 50 80 + chr1 2000 2050 20 50 80 + chr1 2050 2070 20 0 80 + chr1 2070 2090 20 0 0 + chr1 2090 2100 20 0 20 + + +Output example (*with* checking "Report regions with zero coverage"). The lines marked with (*) are not covered in any input file, but are still reported (The asterisk marking does not appear in the file).:: + + chr1 0 900 0 0 0 (*) + chr1 900 1000 0 60 0 + chr1 1000 1500 10 60 0 + chr1 1500 1600 0 60 0 + chr1 1600 1700 0 0 0 (*) + chr1 1700 1980 0 50 0 + chr1 1980 2000 0 50 80 + chr1 2000 2050 20 50 80 + chr1 2050 2070 20 0 80 + chr1 2070 2090 20 0 0 + chr1 2090 2100 20 0 20 + chr1 2100 247249719 0 0 0 (*) + + +------ + +**Examples adjusting the "Filler value" for no-covered intervals** + +The default value is '0', but you can use any other value. + +Output example with **filler = N/A**:: + + chr1 900 1000 N/A 60 N/A + chr1 1000 1500 10 60 N/A + chr1 1500 1600 N/A 60 N/A + chr1 1600 1700 N/A N/A N/A + chr1 1700 1980 N/A 50 N/A + chr1 1980 2000 N/A 50 80 + chr1 2000 2050 20 50 80 + chr1 2050 2070 20 N/A 80 + chr1 2070 2090 20 N/A N/A + chr1 2090 2100 20 N/A 20 + + +------ + +**Examples using the "sample name" labels**:: + + chrom start end WT-1 WT-2 KO-1 + chr1 900 1000 N/A 60 N/A + chr1 1000 1500 10 60 N/A + chr1 1500 1600 N/A 60 N/A + chr1 1600 1700 N/A N/A N/A + chr1 1700 1980 N/A 50 N/A + chr1 1980 2000 N/A 50 80 + chr1 2000 2050 20 50 80 + chr1 2050 2070 20 N/A 80 + chr1 2070 2090 20 N/A N/A + chr1 2090 2100 20 N/A 20 + + +------ + +**Non-numeric values** + +The input BedGraph files can contain any kind of value in the fourth column, not necessarily a numeric value. + +Input Example:: + + File-1 File-2 + chr1 200 300 Sample1 chr1 100 240 0.75 + chr1 400 450 Sample1 chr1 250 700 0.43 + chr1 530 600 Sample2 + +Output Example:: + + chr1 100 200 0 0.75 + chr1 200 240 Sample1 0.75 + chr1 240 250 Sample1 0 + chr1 250 300 Sample1 0.43 + chr1 300 400 0 0.43 + chr1 400 450 Sample1 0.43 + chr1 450 530 0 0.43 + chr1 530 600 Sample2 0.43 + chr1 600 700 0 0.43 + +@REFERENCES@ + + + + diff -r 000000000000 -r b8348686a0b9 windowBed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/windowBed.xml Tue Nov 04 01:45:04 2014 -0500 @@ -0,0 +1,75 @@ + + + + macros.xml + + + + + bedtools window + #if $inputA.ext == "bam": + -abam $inputA + #else: + -a $inputA + #end if + -b $inputB + $ubam + $bed + $strandB + #if $addition.addition_select == 'b': + -w $addition.b + #elif $addition.addition_select == 'lr': + -l $addition.l + -r $addition.r + #end if + $original + $number + $nooverlaps + $header + > $output + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +**What it does** + +Similar to bedtools intersect, window searches for overlapping features in A and B. However, window adds a specified number (1000, by default) of base pairs upstream and downstream of each feature in A. In effect, this allows features in B that are “near” features in A to be detected. + +.. image:: $PATH_TO_IMAGES/window-glyph.png + +@REFERENCES@ + + +