An anonymous student found this. PREP library(GenomicFeatures) library(TxDb.Hsapiens.UCSC.hg19.knownGene)
EXAMPLE txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene seqlevels(txdb, force=TRUE) <- c("chr22") gr <- GRanges(seqnames = "chr22", ranges = IRanges(start = 1, end = 52330658)) gr.trans.chr22 <- subsetByOverlaps(transcripts(txdb), gr, ignore.strand = TRUE) length(gr.trans.chr22) END_EXAMPLE if you run the EXAMPLE to END_EXAMPLE code twice after each other in an R session, you first get the answer 1868 and second time the answer 2576. In fact, you get behavior like this in a fresh setting library(GenomicFeatures) library(TxDb.Hsapiens.UCSC.hg19.knownGene) txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene seqlevels(txdb, force=TRUE) <- c("chr22") library(TxDb.Hsapiens.UCSC.hg19.knownGene) seqlevels(TxDb.Hsapiens.UCSC.hg19.knownGene) [1] "chr22" so here the modification of txdb gets carried through to the original object. Best, Kasper [[alternative HTML version deleted]] _______________________________________________ Bioc-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/bioc-devel