Question: Error to rename seqlevels in Granges interactions
0
gravatar for Vinicius Henrique da Silva
15 months ago by
Brazil

I am trying to rename the seqlevels in an interactionSet object. The syntax for common GRanges don't work in an interaction set. Any ideas how to make it work then?

 

library(GenomicRanges)

gr <- GRanges(rep(c("chr2", "chr3", "chrM"), 2), IRanges(1:6, 10))

 index.epistasis <- expand.grid(seq_len(length(gr)), seq_len(length(gr)))

gr.interactions <- InteractionSet::GInteractions(index.epistasis$Var1, index.epistasis$Var2, gr)

seqlevels(gr) <- sub("chrM", "chrMit", seqlevels(gr)) ## works

seqlevels(gr.interactions) <- sub("chrM", "chrMit", seqlevels(gr.interactions)) ## error

 

Error in GenomeInfoDb:::makeNewSeqnames(x, new2old = new2old, seqlevels(value)) :
  when 'new2old' is NULL, the first elements in the
  supplied 'seqlevels' must be identical to 'seqlevels(x)'

granges interactionset • 258 views
ADD COMMENTlink modified 15 months ago by Aaron Lun25k • written 15 months ago by Vinicius Henrique da Silva40
Answer: Error to rename seqlevels in Granges interactions
2
gravatar for Aaron Lun
15 months ago by
Aaron Lun25k
Cambridge, United Kingdom
Aaron Lun25k wrote:

It doesn't work because I haven't gotten around to adding seqlevels<-. The current workaround would be:

seqlevels(regions(gr.interactions)) <- sub("chrM", "chrMit", seqlevels(regions(gr.interactions)))
ADD COMMENTlink modified 15 months ago • written 15 months ago by Aaron Lun25k
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: 211 users visited in the last hour