rtacklayer::import.bed silently adds 1 to the start coordinates
1
0
Entering edit mode
@mikhail-dozmorov-23744
Last seen 18 days ago
United States

When importing a BED file like:

 1 chr1         0   257700
 2 chr1   1125300  1182900

rtracklayer::import.bed() creates a GRanges object like:

             start       end     width
         <integer> <integer> <integer>
     [1]         1    257700    257700
     [2]   1125301   1182900     57600

Is this expected?

It may be something fundamentally basic but I couldn't find an answer. The starts.in.df.are.0based argument in makeGRangesFromDataFrame() is not recognized by rtracklayer::import.bed().

rtracklayer • 1.2k views
ADD COMMENT
0
Entering edit mode

Pretty much the same was asked at biostars the other day: https://www.biostars.org/p/9537845/#9537847

See also this "cheat sheet" towards 0- and 1-based formats: https://www.biostars.org/p/84686/

Actually, everything is 1-based that is human-readable, except BED. Some binary formats are 1-based as well but parsers will handle that internally if you use standard tools such as samtools (BAM for example is 1-based).

ADD REPLY
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 days ago
United States

It is expected. BED format is 0-based, half open, and all of Bioconductor uses 1-based, fully closed.

ADD COMMENT
1
Entering edit mode

For more info, UCSC has this post

ADD REPLY

Login before adding your answer.

Traffic: 608 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