[Bioc-devel] Valid classes for extraColumnSlots

Peter Hickey hickey at wehi.EDU.AU
Tue Aug 26 13:25:14 CEST 2014


Hi Michael,
Sorry for my misunderstanding. Here is some code describing the class https://github.com/PeteHaitch/GenomicTuples/blob/master/R/GTuples-class.R(the package is not yet installable but hopefully the in-progress code shows you what I'm trying to achieve).
The relevant slot is called "internalPos" and extraColumnSlotNames does indeed return this as a character vector. What I meant is that originally the internalPos slot was a matrix (or NULL). I switched to DataFrame (or NULL) because I was running into some problems related to replaceROWS when it was a matrix.
Thanks,Pete


----- Original Message -----From: Michael Lawrence <lawrence.michael at gene.com>To: Peter Hickey <hickey at wehi.edu.au>Cc: bioc-devel at r-project.orgSent: Tue, 26 Aug 2014 13:35:35 +1000 (EST)Subject: Re: [Bioc-devel] Valid classes for extraColumnSlots

Hi Peter,

Some code would help here.  I'm not sure what you mean by having a matrix as your extraColumnSlots. A derivative of GenomicRanges should definel a method for extraColumnSlotNames that returns a character vector of names for actual slots that the class defines. It sounds like you're trying to represent all of the extra column slots with a single matrix slot, which is not how the mechanism was designed.

Michael


On Mon, Aug 25, 2014 at 7:57 PM, Peter Hickey <hickey at wehi.edu.au> wrote:
Are the extraColumnSlots of a class that extends GenomicRanges limited to DataFrame objects?

Background: I wrote a class that extends the GRanges class. It has a matrix as the extraColumnSlots. When I use replaceROWS,GenomicRanges,GenomicRanges-method (via inheritance) it extracts this extraColumnSlots as a DataFrame object by use of GenomicRanges:::extraColumnSlotsAsDF. This means that the subsequent call to update() in replaceROWS,GenomicRanges,GenomicRanges-method fails because the class definition expects a matrix for the extraSlotNames but gets a DataFrame.

In this case, it's not a problem for me to change my extraColumnSlots element to a DataFrame in the class definition. However, more generally, some guidance on what classes are and are not allowed in extraColumnSlots would be appreciated.

Thanks,

Pete

This is using BioC devel:

sessionInfo()

R version 3.1.1 (2014-07-10)

Platform: x86_64-apple-darwin13.1.0 (64-bit)

locale:

[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:

[1] parallel  stats     graphics  grDevices utils     datasets  methods

[8] base

other attached packages:

[1] GenomicTuples_0.1.0   GenomicRanges_1.17.35 GenomeInfoDb_1.1.18

[4] IRanges_1.99.24       S4Vectors_0.1.2       BiocGenerics_0.11.4

[7] devtools_1.5

loaded via a namespace (and not attached):

 [1] Biobase_2.25.0   digest_0.6.4     evaluate_0.5.5   httr_0.4

 [5] memoise_0.2.1    packrat_0.4.0.12 Rcpp_0.11.2      RCurl_1.95-4.3

 [9] stats4_3.1.1     stringr_0.6.2    tools_3.1.1      whisker_0.3-2

--------------------------------

Peter Hickey,

PhD Student/Research Assistant,

Bioinformatics Division,

Walter and Eliza Hall Institute of Medical Research,

1G Royal Parade, Parkville, Vic 3052, Australia.

Ph: +613 9345 2324

hickey at wehi.edu.auhttp://www.wehi.edu.au

______________________________________________________________________

The information in this email is confidential and intend...{{dropped:15}}



More information about the Bioc-devel mailing list