Hi, I was trying to use bedtools to align a bed file with a Fasta file.
The first line of bed look like this:
DN38.contig00001 654 2138
When I was checking the output of bedtools, the result sequence starts at 655, instead of 654.
I am wondering that is the result generated by bedtools always between the 'start' and 'end', instead of starting at the 'start' and ending at 'end'?
Thanks!
1 answer
This is because bedtools uses base-0 for start and base-1 for the end... that's not confusing at all.
BED starts are zero-based and BED ends are one-based.
bedtools users are sometimes confused by the way the start and end of BED features are represented. Specifically, bedtools uses the UCSC Genome Browser’s internal database convention of making the start position 0-based and the end position 1-based: (http://genome.ucsc.edu/FAQ/FAQtracks#tracks1) In other words, bedtools interprets the “start” column as being 1 basepair higher than what is represented in the file.
https://bedtools.readthedocs.io/en/latest/content/overview.html
I didn't know this! Thanks for asking :)
Log in to answer this question.
there is no tool to "align a bed with a fasta". which sub tool are you using ? what was the cmd line ? did you read Cheat Sheet For One-Based Vs Zero-Based Coordinate Systems ? and How To Ask Good Questions On Technical And Scientific Forums ?