Find for all features in {{file_1}}.bed the closest one in {{file_2}}.bed and write their distance in an extra column (input files must be sorted)


  • A swiss-army knife of tools for genomic-analysis tasks.
    Used to intersect, group, convert and count data in BAM, BED, GFF/GTF, VCF format.
    More information: <>.
  • Trick copyright: tl;dr; <>

bedtools closest -a {{path/to/file_1}}.bed -b {{path/to/file_2}}.bed -d

click the source code to copy install bedtools on any operating system with