[Bioc-sig-seq] Dispatch on GenomeDataList or GRangesList

Martin Morgan mtmorgan at fhcrc.org
Fri Sep 3 01:04:22 CEST 2010


  On 9/1/2010 8:00 PM, Dario Strbenac wrote:
> Hello,
>
> I'd like to treat these 2 classes as 1 class for the purpose of method dispatch.
>
> In the first couple of lines of my .R file I have
>
> setGeneric("annotationCounts", function(someArgument1, someArgument2){standardGeneric("annotationCounts")})
> ...          ...
> setClassUnion("sequencingList", c("GenomeDataList", "GRangesList"))
>
> and lower in the file I have
>
> setMethod("annotationCounts", "sequencingList", function(someArgument1, someArgument2) {
>   ...             ...
> })
>
> I am wondering if anyone knows what I should do about this warning in R CMD check ?
>
> * checking whether package 'Repitools' can be installed ... WARNING
> Found the following significant warnings:
>    Warning: Class "GRangesList" is defined (with package slot âGenomicRangesâ) but no metadata object found to revise superClass information---not exported?  Making a copy in package âRepitoolsâ

Hi Dario --

I think you require a NAMESPACE file with

importClassesFrom(BSgenome, GenomeDataList)
importClassesFrom(GRanges, GRangesList)

And a DESCRIPTION file that has the line

Imports: GRanges, BSgenome

And for my 2 cents I'm not sure that class unions are a good idea -- 
you're setting up a contract where you're saying you'll support classes 
that inherit from not one but two classes, and you'll fulfill the 
contract without the author of those classes consenting. This is a 
pretty tall order -- much more so than saying Y contains X, where you're 
only saying that if Y doesn't behave specially it'll behave like X, or Y 
has X, which could say nothing about how much like X a Y is (e.g., 
because there are no user-visible methods to access X directly).

Martin

> Thanks,
>         Dario.
>
> --------------------------------------
> Dario Strbenac
> Research Assistant
> Cancer Epigenetics
> Garvan Institute of Medical Research
> Darlinghurst NSW 2010
> Australia
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing


-- 
Dr. Martin Morgan, PhD
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109



More information about the Bioc-sig-sequencing mailing list