Length of Bases in Overlapping Regions Calculated By BEDOPS
1
0
Entering edit mode
10.6 years ago
Apprentice ▴ 170

Hi, I have 2 bed files.

File 1: ref.bed

chr9    9383800    9493700    REGION

File 2: map.bed

chr9    9387448    9387482    PTPRD_EXON

I want to calculate a length of bases in an area overlapping between ref.bed and map.bed

So I used BEDOPS bedmap function as follows, and got the following result file.

$ bedmap --echo --bases  ref.bed map.bed > result.bed
$ cat result.bed
chr9    9383800    9493700    REGION|34

Thus, this result file indicates that the length of bases in an overlapping area is "34bp".

However, I think the length might be incorrect.

Because, in this case, the overlapping area is chr9:9387448..9387482.

So, the length of overlapping area is 9387482-9387448+1 = "35bp".

Could you tell me whether my opinion is right?

bed • 1.9k views
ADD COMMENT
2
Entering edit mode
10.6 years ago

BED files are zero-based. This means that the number of bases in a BED element is simply the difference of the stop and start coordinates. See: What Are The Advantages/Disadvantages Of One-Based Vs. Zero-Based Genome Coordinate Systems

ADD COMMENT
0
Entering edit mode

Thank you for your answer.

I could learn very important point about BED file.

BEDOPS is very useful tool. I want to continue utilizing that.

ADD REPLY

Login before adding your answer.

Traffic: 2537 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6