Skip to content

How distanceToTSS was calculated

Guangchuang Yu edited this page Jan 10, 2016 · 2 revisions

peak is strandless that without orientation information. ChIPseeker calculate peak to gene start from both end (start(peak) end(peak)), that is:

## for genes in positive strand
min(start(peak) - start(gene), end(peak) - start(gene))

If start(gene) is inside [start(peak), end(peak)], the distance will be reported as 0.

peak is in upstream when distanceToTSS < 0 and peak in downstream when distanceToTSS > 0.

Please bare in mind that genes in negative strand encode their positions using coordination of positive strand. For genes in negative strand, end(gene) is the start position of the gene while start(gene) is the end position of the gene. And the orientation also changed so ChIPseeker calculates:

## for genes in negative strand
min(end(gene) - start(peak), end(gene) - end(peak))

The blog post, http://guangchuangyu.github.io/2014/01/bug-of-r-package-chippeakanno/, discuss how distance to TSS should be calculated.

We also compare distance to TSS reported by ChIPseeker, ChIPpeakAnno, Homer and peakAnalyzer in the Supplemental Data of ChIPseeker paper.

Clone this wiki locally