Question: How to use EnsDb in annotatePeak from package "ChIPseeker"
1
gravatar for foehn
10 months ago by
foehn60
foehn60 wrote:

Hello,

I'm trying to use EnsDb.Hsapiens.v86 as the annotation database for function annotatePeak from package "ChIPseeker". Yet I met a problem that the argument TxDb doesn't accept an EnsDb object:

library(EnsDb.Hsapiens.v86)
library(ChIPseeker)
EnsHg38 <- EnsDb.Hsapiens.v86
seqlevelsStyle(EnsHg38) <- "UCSC"

> peaks
GRanges object with 10 ranges and 0 metadata columns:
       seqnames                 ranges strand
          <Rle>              <IRanges>  <Rle>
   [1]    chr15 [ 22664756,  22664905]      *
   [2]    chr16 [ 66483816,  66483965]      *
   [3]     chr9 [135561956, 135562105]      *
   [4]    chr14 [ 88163786,  88163935]      *
   [5]    chr20 [ 57498528,  57498677]      *
   [6]    chr19 [ 49097916,  49098065]      *
   [7]    chr10 [ 89374396,  89374545]      *
   [8]     chr6 [  4589811,   4589960]      *
   [9]     chr6 [134420636, 134420785]      *
  [10]     chr1 [173499905, 173500054]      *
  -------
  seqinfo: 25 sequences (1 circular) from hg38 genome

res <- annotatePeak(peaks, TxDb = EnsHg38) 
>> preparing features information...             2019-02-15 14:22:12 
>> identifying nearest features...               2019-02-15 14:22:12 
>> calculating distance from peak to TSS...      2019-02-15 14:22:13 
>> assigning genomic annotation...               2019-02-15 14:22:13 
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function 'intronsByTranscript' for signature '"EnsDb"'
In addition: Warning message:
In .Seqinfo.mergexy(x, y) :
  The 2 combined objects have no sequence levels in common. (Use
  suppressWarnings() to suppress this warning.)

I wonder if it is possible to use EnsDb instead of TxDb in annotatePeak? Thanks.

ADD COMMENTlink modified 10 months ago by Johannes Rainer1.5k • written 10 months ago by foehn60
Answer: How to use EnsDb in annotatePeak from package "ChIPseeker"
2
gravatar for Johannes Rainer
10 months ago by
Johannes Rainer1.5k
Italy
Johannes Rainer1.5k wrote:

The reason is that ensembldb doesn't have an intronsByTranscript method. I'll add that and it should work.

cheers, jo

ADD COMMENTlink written 10 months ago by Johannes Rainer1.5k

intronsByTranscript is exported in ensembldb version 2.6.6 which will be available in a few days.

ADD REPLYlink written 10 months ago by Johannes Rainer1.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 220 users visited in the last hour