Getting length of every interval in a bed file
Hello everyone,
I want to get the length of every region present in my bed file. I went through the bedtools and bedops options but they don't have the command for that.
I don't want the combine length of all the regions of bed file, instead I need length of every interval.
Is there any way to do that?
Thanks in advance
• 2,965 views
•
link
1 answer
This should do it. awk '{print($3-$2)}' {YOUR_BEDFILE}
INPUT
chr1 213941196 213942363
chr1 213942363 213943535
chr1 213943530 213944677
OUTPUT
1167
1172
1147
• 0 views
•
link
Log in to answer this question.
You could do something like this: