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

interesting question.
could you try to output seqlevelsStyle(gr1) before you run
and also output the seqlevels of gr1? Thank you.
Hi Jianhong, thanks. Do you mean you want to see the output?
Do you think the spaces might cause the problem???
Ben, there are spaces after the chromosome name which will lead to to the mapping error.
Best,
Julie