Entering edit mode
I am trying to annotate ChIPseq/ATAC peaks with ChIPseeker (AnnotatePeak) however it only reports the nearest gene (either upstream or downstream of the peak whichever is the closest). Is there any way to allow AnnotatePeak to get nearest genes in both direction i.e. two genes assigned to each peak ?
Take a look at the
addFlankGeneInfo
parameter. If TRUE, ChIPseeker returns all genes that overlap a flanking region around the peak. I am not 100% sure how overlapping is precisely defined (I think is an overlap of any part of the gene, not just of the TSS).When you say that you are interested in the "two nearest genes", you do not specify if you are interested in the TSS, or just any part of a gene. For example, if a p[eak is close to the 3' UTR of one gene, and to the TSS of another - are you interested in both? If so, then addFlankGeneInfo might do the job.