Re: [Bioc-devel] Interoperability between DataFrame and dplyr?

2015-04-24 Thread Michael Lawrence
Lists are vectors, but as long as they aren't doing too much C++, or assert specific types, it should work. Functions like length(), names(), [, etc dispatch to both S3 and S4. On Thu, Apr 23, 2015 at 6:11 PM, Ryan Thompson wrote: > It looks like dplyr has support for base R lists as columns in

Re: [Bioc-devel] Interoperability between DataFrame and dplyr?

2015-04-24 Thread Vincent Carey
Seems to me that DataFrame is too flexible -- you can have very complex objects in the columns (anything that inherits from Vector) with which, in its current state, dplyr would not work too naturally. You would wind up doing a fair amount of coercion of such entities, so it seems to me that arran

Re: [Bioc-devel] Interoperability between DataFrame and dplyr?

2015-04-24 Thread Ryan Thompson
It looks like dplyr has support for base R lists as columns in data frames: http://cran.r-project.org/web/packages/dplyr/vignettes/data_frames.html Hopefully that feature is flexible enough to accommodate anything that looks sufficiently like a vector. Is love to give this a try, but I can't find

Re: [Bioc-devel] Interoperability between DataFrame and dplyr?

2015-04-24 Thread Michael Lawrence
In theory, probably not that hard. DataFrame implements methods on primitive and S3 generics, so even the darkest shadows of the S3 world will dispatch correctly on those. One potential roadblock is that dplyr may assume that all columns are base R vectors, which would obviously fail for stuff like

Re: [Bioc-devel] Interoperability between DataFrame and dplyr?

2015-04-24 Thread Michael Lawrence
Sure, but the way DataFrame is flexible is by relying on two abstractions in base R. Just length() and '['. If dplyr does the same thing, which seems totally reasonable, everything should work the same. On Thu, Apr 23, 2015 at 4:32 PM, Vincent Carey wrote: > Seems to me that DataFrame is too fle

[Bioc-devel] BioC 2015 Conference Posters

2015-04-24 Thread Valerie Obenchain
Poster registration is now open. Visit the web site http://www.bioconductor.org/help/course-materials/2015/BioC2015/ and registration page https://register.bioconductor.org/BioC2015/poster_submit.php for more information. Posters can be from any area of computational biology, medicine, c

Re: [Bioc-devel] Interoperability between DataFrame and dplyr?

2015-04-24 Thread Jim Hester
dplyr internally converts all `data.frame` objects to its `tbl_df` class and most dplyr methods operate on the `tbl` superclass, see ( https://github.com/hadley/dplyr/blob/master/R/tbl-df.r, https://github.com/hadley/dplyr/blob/master/R/tbl.r). The most direct route would to getting DataFrame obj

Re: [Bioc-devel] Interoperability between DataFrame and dplyr?

2015-04-24 Thread Michael Lawrence
On Fri, Apr 24, 2015 at 7:42 AM, Jim Hester wrote: > dplyr internally converts all `data.frame` objects to its `tbl_df` class > and most dplyr methods operate on the `tbl` superclass, see ( > https://github.com/hadley/dplyr/blob/master/R/tbl-df.r, > https://github.com/hadley/dplyr/blob/master/R/

[Bioc-devel] Warnings from ls() in AnnotationDbi

2015-04-24 Thread James W. MacDonald
A poster on the support site reported some warnings issued when running hyperGTest() from GOstats. I tracked this down to the ls() function from AnnotationDbi, when it dispatches on AnnDbBimap objects. The method is: setMethod("ls", signature(name="Bimap"), function(name, pos, envir, all.names

Re: [Bioc-devel] Warnings from ls() in AnnotationDbi

2015-04-24 Thread Martin Morgan
On 04/24/2015 09:07 AM, James W. MacDonald wrote: A poster on the support site reported some warnings issued when running hyperGTest() from GOstats. I tracked this down to the ls() function from AnnotationDbi, when it dispatches on AnnDbBimap objects. The method is: setMethod("ls", signature(nam

[Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Peter Haverty
Would people be interested in having this: setMethod("as.character", "GenomicRanges", function(x) { paste0(seqnames(x), ":", start(x), "-", end(x)) }) ? I find myself doing that a lot to make unique names or for output that goes to collaborators. I suppose we m

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Hervé Pagès
Hi Pete, Excellent idea. That will make things like table() work out-of-the-box on GenomicRanges objects. I'll add that. Thanks, H. On 04/24/2015 09:43 AM, Peter Haverty wrote: Would people be interested in having this: setMethod("as.character", "GenomicRanges", function(x) {

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Michael Lawrence
It is a great idea, but I'm not sure I would use it to implement table(). Allocating those strings will be costly. Don't we already have the 4-way int hash? Of course, my intuition might be completely off here. On Fri, Apr 24, 2015 at 9:59 AM, Hervé Pagès wrote: > Hi Pete, > > Excellent idea. T

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Michael Lawrence
Sorry, one more concern, if you're thinking of using as a range key, you will need the strand, but many use cases might not want the strand on there. Like for pasting into a genome browser. On Fri, Apr 24, 2015 at 10:18 AM, Michael Lawrence wrote: > It is a great idea, but I'm not sure I would u

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Hervé Pagès
On 04/24/2015 10:21 AM, Michael Lawrence wrote: Sorry, one more concern, if you're thinking of using as a range key, you will need the strand, but many use cases might not want the strand on there. Like for pasting into a genome browser. What about appending the strand only for GRanges objects

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Hervé Pagès
On 04/24/2015 10:18 AM, Michael Lawrence wrote: It is a great idea, but I'm not sure I would use it to implement table(). Allocating those strings will be costly. Don't we already have the 4-way int hash? Of course, my intuition might be completely off here. It does use the 4-way int hash inter

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Peter Haverty
Good catch. We'll want the strand in case we need to go back to a GRanges. I would make the strand addition optional with the default of FALSE. It's nice to have a column of strings you can paste right into a genome browser (sorry Michael :-) ). I often pass my bench collaborators a spreadsheet wi

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Hervé Pagès
On 04/24/2015 11:08 AM, Peter Haverty wrote: Good catch. We'll want the strand in case we need to go back to a GRanges. I would make the strand addition optional with the default of FALSE. It's nice to have a column of strings you can paste right into a genome browser (sorry Michael :-) ). I oft

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Peter Haverty
Going the other way can look like this: ##' Parse one or more location strings and return as a GRanges ##' ##' Parse one or more location strings and return as a GRanges. GRanges will get the names from the location.strings. ##' @param location.string character ##' @export ##' @retur

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Peter Haverty
Those are all good reasons for keeping the strand by default. I'm on board. Pete Peter M. Haverty, Ph.D. Genentech, Inc. phave...@gene.com On Fri, Apr 24, 2015 at 11:26 AM, Herv� Pag�s wrote: > On 04/24/2015 11:08 AM, Peter Haverty wrote: > >> Good catch. We'll want the s

Re: [Bioc-devel] as.character method for GenomicRanges?

2015-04-24 Thread Michael Lawrence
Taking this a bit off topic but it would be nice if we could get the GRanges equivalent of as.data.frame(table(x)), i.e., unique(x) with a count mcol. Should be easy to support but what should the API be like? On Fri, Apr 24, 2015 at 10:54 AM, Hervé Pagès wrote: > On 04/24/2015 10:18 AM, Michael

[Bioc-devel] Announcing a new package: GoogleGenomics

2015-04-24 Thread Siddhartha Bagaria via Bioc-devel
Hi everyone, I am happy to announce the availability of the GoogleGenomics package in the latest release and devel branches of Bioconductor. This package is meant to be the R/Bioconductor interface to the Google Genomics API <