I am trying to annotate some peaks from a RIP seq experiment. They are supposed to overlap annotated genes.
My problem is that the assigned gene in ChIPSeeker for some of my peaks does not match the gene which is annotated in the annotation column of the returned csAnno object and which is actually overlapping the peak.
Here my example:
txdb <- makeTxDbFromBiomart(biomart="ENSEMBL_MART_ENSEMBL",
test_gene2 <- GRanges(c("3L"), IRanges(c(8597160), end=c(8597371)), strand=c("+"))
annotated <- annotatePeak(test_gene2, TxDb=txdb, level="transcript", tssRegion=c(-200,200))
seqnames start end width strand annotation geneChr geneStart geneEnd geneLength geneStrand geneId transcriptId distanceToTSS
1 3L 8597160 8597371 212 + Exon (FBtr0340707/FBgn0262508, exon 8 of 8) 3L 8601006 8602392 1387 + FBgn0017579 FBtr0076633 -3846
The gene which is below annotation is Exon (FBtr0340707/FBgn0262508, exon 8 of 8) but the gene reported is FBgn0017579 which is the gene with the nearest TSS but actually not the overlapping one. I did not find an option to change that and for me it would make sense to actually report the gene the peak is overlapping with instead of the nearest TSS gene. Especially if we are looking at marks which may be located on or near 3'UTRs of genes.
Is there a way to change this behaviour? Is this a feature or a bug?
Thank you very much for any comments.