How about a getSeq() method for GRanges ?
0
1
Entering edit mode
@charles-plessy-7857
Last seen 14 months ago
Japan

In a running project I found it very convenient to have a local getSeq() method for GRanges, especially for interactive use.

getSeq_GRanges <- function(x, ...) {
  genome <- unique(genome(x))
  if (any(is.na(genome)))
    stop("Can not getSeq objets where `genome` is not defined.")
  # Maybe should also check that length(genome) == 1
  getSeq(getBSgenome(genome), x)
}
setMethod("getSeq", "GRanges", getSeq_GRanges)

Would you consider adding such a method to the BSgenome packages or wherever it makes sense ?

Have a nice day,

-- Charles

GenomicRanges BSGenome • 984 views
ADD COMMENT

Login before adding your answer.

Traffic: 453 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