Forrest logo
back to context overview

bedtools

List of commands for bedtools:

  • bedtools:tldr:02091 bedtools: Convert bam-formatted file to a bed-formatted one.
    $ bedtools bamtobed -i ${filename}.bam > ${filename}.bed
    try on your machine
    explain this command
  • bedtools:tldr:7347d bedtools: 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).
    $ bedtools closest -a ${filename_1}.bed -b ${filename_2}.bed -d
    try on your machine
    explain this command
  • bedtools:tldr:77d8f bedtools: Intersect two files with a left outer join, i.e. report each feature from {{file_1}} and NULL if no overlap with {{file_2}}.
    $ bedtools intersect -a ${filename_1} -b ${filename_2} -lof > ${path-to-output_file}
    try on your machine
    explain this command
  • bedtools:tldr:8b38f bedtools: Intersect two files regarding the sequences' strand and save the result to the specified file.
    $ bedtools intersect -a ${filename_1} -b ${filename_2} -s > ${path-to-output_file}
    try on your machine
    explain this command
  • bedtools:tldr:b6f90 bedtools: Group file {{`path/to/file`}} based on the first three and the fifth column and summarize the sixth column by summing it up.
    $ bedtools groupby -i ${filename} -c 1-3,5 -g 6 -o sum
    try on your machine
    explain this command
  • bedtools:tldr:f5eee bedtools: Using more efficient algorithm to intersect two pre-sorted files.
    $ bedtools intersect -a ${filename_1} -b ${filename_2} -sorted > ${path-to-output_file}
    try on your machine
    explain this command
back to context overview