Category

Genomic Interval Manipulation


Usage

bedtools flank [OPTIONS] -i <BED/GFF/VCF> -g <GENOME> [-b or (-l and -r)]


Manual

This tool is part of the bedtools suite and it's also known as flankBed.

bedtools flank will create two new flanking intervals for each interval in a BED/GFF/VCF file. Note that flank will restrict the created flanking intervals to the size of the chromosome (i.e. no start < 0 and no end > chromosome size). You may find bedtools slop helpful, if you want to expand the entire regions.

Input regions:           ====       

Output regions:       ===    ===
    (-b 3)

Output regions:       ===    
    (-l 3)

Output regions:      ====    ====
 (-b 1.0 -pct)  

Required arguments

  • -i <bed/gff/vcf>: Path to the input file (in bed/gff/vcf format) containing intervals to be manipulated.
  • -g <genome>: Chromosome size file. The file should tab delimited and structured as follows: <chromName> <chromSize>.  You can get this file for the genome release that you are working with by using fetchChromSizes.
  • Flanking arguments: you must specify either the symmetric or asymmetric flanking arguments.
    • Symmetric flanking:
      • -b <integer>: Increase the BED/GFF/VCF entry by the same number base pairs in each direction.
    • Asymmetric flanking: Both -l and -r parameters have to be specified.
      • -l <integer>: The number of base pairs to subtract from the start coordinate.
      • -r <integer>: The number of base pairs to add to the end coordinate.

Options

  • -s: Define -l and -r based on strand. For example. if used, -l 500 for a negative-stranded feature, it will add 500 bp to the end coordinate.
  • -pct <float>: Define -l and -r as a fraction of the feature's length. E.g. if used on a 1000bp feature, -l 0.50, will add 500 bp upstream. Default = false.

 

File formats this tool works with
BEDGFFGTFVCF

Share your experience or ask a question