Entering edit mode
Vinicius Henrique da Silva
▴
40
@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)'