Error to rename seqlevels in Granges interactions
1
0
Entering edit mode
@vinicius-henrique-da-silva-6713
Last seen 18 months ago
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)'

interactionset granges • 1.5k views
ADD COMMENT
2
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 7 hours ago
The city by the bay

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 COMMENT

Login before adding your answer.

Traffic: 748 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6