parsing BED coordinates

August 6, 2015

(This article was first published on YGC » R, and kindly contributed to R-bloggers)

In supplemental file of ChIPseeker paper. I compare distances to TSS reported by several ChIP annotation software, including ChIPseeker, ChIPpeakAnno, HOMER and PeakAnalyzer.

Although I found that the chromStart positions in HOMER output have a +1 shift compare to other software, I did not realize this issue since all other software are consistent.

Until recently, I found BAM, BCF, BED and PSL formats are using the 0-based coordinate system, while SAM, VCF, GFF and Wiggle formats are using the 1-based coordinate system.

For BED file format, we can refer to

In addition, the 0-based coordinate system is specified by a half-closed-half-open interval. For example, the first 100 bases of a chromosome are defined as [0, 100), that span the bases numbered 0-99. While the 1-based coordinate system is specified by a closed interval, for example the above region is [1, 100].

Most of the software for ChIP annotation doesn’t considered this issue when annotating peak (0-based) to transcript (1-based). To my knowledge, only HOMER consider this issue. After I figure this out, I have updated ChIPseeker (version >= 1.4.3) to fix the issue.

Please bare in mind that chromStart in ChIPseeker has +1bp shift compare to the number recorded in BED file.

Related Posts

To leave a comment for the author, please follow the link and comment on their blog: YGC » R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)