Re: [Bioc-devel] request: high-level seqlevel utilities

2013-12-27 Thread Michael Lawrence
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 >

Re: [Bioc-devel] request: high-level seqlevel utilities

2013-12-27 Thread Valerie Obenchain
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

Re: [Bioc-devel] request: high-level seqlevel utilities

2013-12-27 Thread Tim Triche, Jr.
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

Re: [Bioc-devel] request: high-level seqlevel utilities

2013-12-27 Thread Arora, Sonali
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

Re: [Bioc-devel] request: high-level seqlevel utilities

2013-12-27 Thread Michael Lawrence
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

Re: [Bioc-devel] request: high-level seqlevel utilities

2013-12-27 Thread Arora, Sonali
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