Question: Error with ChIPpeakAnno Ensembl annotation
0
gravatar for b.nota
2.8 years ago by
b.nota330
Netherlands
b.nota330 wrote:

Hello Bioconductors,

I am trying to annotate peaks derived with MACS and run into some errors. I hope someone can help me to get rid of these errors. I use ChIPpeakAnno and have ensembl data, but I get errors about the style. Here my R code:

> library(ChIPpeakAnno)
> library(GenomicFeatures)
>
> bed <- read.table("new.txt",sep = "\t" )
> colnames(bed)<-c("chr", "start", "end", "x")
> gr1 <- toGRanges(bed, format="BED", header=T)
duplicated or NA names found. Rename all the names by numbers.
> gr1
GRanges object with 69388 ranges and 1 metadata column:
         seqnames                 ranges strand |               x
            <Rle>              <IRanges>  <Rle> |        <factor>
  X00001       1  [ 39845630,  39845896]      * |   All_peak_1450
  X00002       1  [191889009, 191889559]      * |   All_peak_5137
  X00003       1  [212860802, 212861026]      * |   All_peak_5820
  X00004       1  [ 36306817,  36307312]      * |   All_peak_1337
  X00005       1  [ 44433306,  44433488]      * |   All_peak_1630
     ...      ...                    ...    ... .             ...
  X69384       Y    [56847145, 56847269]      * |  All_peak_69384
  X69385       Y    [56850752, 56850897]      * |  All_peak_69385
  X69386       Y    [56858855, 56858947]      * |  All_peak_69386
  X69387       Y    [56859031, 56859116]      * |  All_peak_69387
  X69388       Y    [56861359, 56861446]      * |  All_peak_69388
  -------
  seqinfo: 127 sequences from an unspecified genome; no seqlengths

> library(EnsDb.Hsapiens.v79)
> annoData <- toGRanges(EnsDb.Hsapiens.v79)
> seqlevelsStyle(annoData) <- "Ensembl"
> seqlevelsStyle(gr1) <- seqlevelsStyle(annoData)
Error in .replace_seqlevels_style(x_seqlevels, value) :
  found no sequence renaming map compatible with seqname style "NCBI" for this object
In addition: Warning message:
In `seqlevelsStyle<-`(`*tmp*`, value = c("NCBI", "Ensembl")) :
  more than one seqlevels style supplied, using the 1st one only
> annoPeaks(gr1, annoData)
Error in seqlevelsStyle(seqlevels(x)) :
  The style does not have a compatible entry for the species supported by
  Seqname. Please see genomeStyles() for supported species/style

 

Hope someone understands what's going on. Thanks in advance!

 

Regards, Ben

chippeakanno genomicfeatures • 1.2k views
ADD COMMENTlink modified 2.8 years ago by Julie Zhu4.0k • written 2.8 years ago by b.nota330
1

interesting question.

could you try to output seqlevelsStyle(gr1) before you run

seqlevelsStyle(gr1) <- seqlevelsStyle(annoData)

and also output the seqlevels of gr1? Thank you.

ADD REPLYlink written 2.8 years ago by Ou, Jianhong1.1k

Hi Jianhong, thanks. Do you mean you want to see the output?

> seqlevelsStyle(gr1)
Error in seqlevelsStyle(seqlevels(x)) :
  The style does not have a compatible entry for the species supported by
  Seqname. Please see genomeStyles() for supported species/style
> seqlevels(gr1)
  [1] "1 "          "10 "         "11 "         "12 "         "13 "        
  [6] "14 "         "15 "         "16 "         "17 "         "18 "        
 [11] "19 "         "2 "          "20 "         "21 "         "22 "        
 [16] "3 "          "4 "          "5 "          "6 "          "7 "         
 [21] "8 "          "9 "          "GL000008.2 " "GL000009.2 " "GL000194.1 "
 [26] "GL000195.1 " "GL000205.2 " "GL000208.1 " "GL000213.1 " "GL000214.1 "
 [31] "GL000216.2 " "GL000218.1 " "GL000219.1 " "GL000220.1 " "GL000221.1 "
 [36] "GL000224.1 " "GL000225.1 " "KI270303.1 " "KI270304.1 " "KI270310.1 "
 [41] "KI270312.1 " "KI270317.1 " "KI270322.1 " "KI270329.1 " "KI270330.1 "
 [46] "KI270333.1 " "KI270336.1 " "KI270337.1 " "KI270383.1 " "KI270386.1 "
 [51] "KI270391.1 " "KI270393.1 " "KI270395.1 " "KI270396.1 " "KI270411.1 "
 [56] "KI270412.1 " "KI270418.1 " "KI270420.1 " "KI270422.1 " "KI270435.1 "
 [61] "KI270438.1 " "KI270442.1 " "KI270465.1 " "KI270466.1 " "KI270467.1 "
 [66] "KI270511.1 " "KI270512.1 " "KI270517.1 " "KI270519.1 " "KI270522.1 "
 [71] "KI270529.1 " "KI270538.1 " "KI270544.1 " "KI270587.1 " "KI270588.1 "
 [76] "KI270589.1 " "KI270591.1 " "KI270706.1 " "KI270707.1 " "KI270708.1 "
 [81] "KI270709.1 " "KI270710.1 " "KI270711.1 " "KI270712.1 " "KI270713.1 "
 [86] "KI270714.1 " "KI270717.1 " "KI270718.1 " "KI270719.1 " "KI270720.1 "
 [91] "KI270721.1 " "KI270722.1 " "KI270723.1 " "KI270724.1 " "KI270725.1 "
 [96] "KI270726.1 " "KI270727.1 " "KI270728.1 " "KI270729.1 " "KI270730.1 "
[101] "KI270731.1 " "KI270732.1 " "KI270733.1 " "KI270734.1 " "KI270735.1 "
[106] "KI270736.1 " "KI270737.1 " "KI270738.1 " "KI270739.1 " "KI270741.1 "
[111] "KI270742.1 " "KI270743.1 " "KI270744.1 " "KI270745.1 " "KI270746.1 "
[116] "KI270747.1 " "KI270748.1 " "KI270749.1 " "KI270750.1 " "KI270751.1 "
[121] "KI270753.1 " "KI270754.1 " "KI270756.1 " "KI270757.1 " "MT "        
[126] "X "          "Y "

 

Do you think the spaces might cause the problem???

ADD REPLYlink modified 2.8 years ago • written 2.8 years ago by b.nota330
2

Ben, there are spaces after the chromosome name which will lead to to the mapping error. 

Best,

Julie

ADD REPLYlink written 2.8 years ago by Julie Zhu4.0k
Answer: Error with ChIPpeakAnno Ensembl annotation
0
gravatar for Julie Zhu
2.8 years ago by
Julie Zhu4.0k
United States
Julie Zhu4.0k wrote:

 

Ben,

 

The following code should work.
library(EnsDb.Hsapiens.v79)
annoData <- toGRanges(EnsDb.Hsapiens.v79)

seqlevelsStyle(gr1) <- "UCSC"

seqlevelsStyle(annoData)
#[1] "UCSC"

seqlevelsStyle(gr1)

#[1] "UCSC"

If you would prefer Ensembl seqlevelsStyle, please try the following code

seqlevelsStyle(annoData) <- "Ensembl"

seqlevelsStyle(gr1) <- "Ensembl"

Best,

Julie

ADD COMMENTlink written 2.8 years ago by Julie Zhu4.0k

Thanks, Julie. It didn't work, I think the bed file was 'bad'. I don't know why, though.

> bed <- read.table("new.txt",sep = "\t")
> colnames(bed)<-c("chr", "start", "end", "x")
> head(bed)
  chr     start       end              x
1  1   39845629  39845896  All_peak_1450
2  1  191889008 191889559  All_peak_5137
3  1  212860801 212861026  All_peak_5820
4  1   36306816  36307312  All_peak_1337
5  1   44433305  44433488  All_peak_1630
6  1   54132564  54132932  All_peak_1940


But I solved the issue by using the summits bed file from MACS2. Thanks for your input.

Ben

 

ADD REPLYlink written 2.8 years ago by b.nota330
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: 135 users visited in the last hour