The dropSeqlevels approach for the autosomes is acceptable in terms of
readability, but it means the code needs to know the seqname style (chrX
rather than just X).
On Fri, Dec 27, 2013 at 1:49 PM, Valerie Obenchain wrote:
> I think the idea was to avoid the proliferation of small, specialized
>
I think the idea was to avoid the proliferation of small, specialized
functions.
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
gr <- transcripts(TxDb.Hsapiens.UCSC.hg19.knownGene)
## autosomes
std <- keepStandardChromosomes(gr, "Homo sapiens", "UCSC")
dropSeqlevels(std, c("chrX", "chrY"))
## allo
Hi Sonali,
Thank you for this much requested addition to the GenomicRanges API!
I would like to second Michael Lawrence's assertion that keepAutosomes() is
more straightforward and harder to misunderstand or misuse than a special case
of keep/dropSeqlevels. (If the author of a function has tr
Michael,
Since there is no universal seqnameStyle defined for various objects and
they do not internally store the seqnameStyle and species information,
we decided to ask the user for all 3 arguments. Marc is aware of these
issues and my code.
Regarding the dependency of GenomicRanges on Anno
I guess you mean dropSeqlevels, not keepSeqlevels? That should work. But
your function needs some tweaking, I think. The function should just take
the seqnameStyle from the object. There's no need to require the user to
specify it, and then check for consistency. I would like to be able to just
cal
Hi Michael,
We decided to come up with one function called keepStandardChromosomes()
which
is a wrapper for both the functions suggested by you (i.e.,
keepPrimaryChromosomes() and keepAutosomes() )
Here is an example:
library(AnnotationDbi)
library(GenomicRanges)
txdb <- loadDb(system.file("ext