On Thu, Sep 2, 2010 at 4:04 PM, Martin Morgan <mtmorgan@fhcrc.org> wrote:

>  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).
>
>
I agree about the fragility of code that relies on two independent APIs. In
this particular case, I don't even understand where the design is going.
GRanges and GenomeData are very different objects, even if they might encode
the same information. A GenomeData object is a difficult object to
manipulate, since it's essentially a general "list". There are no guarantees
as to what it contains. If I were you, I would expect the user to explicitly
coerce a generic GenomeDataList into a GRangesList before passing it to my
API.

Michael


> 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@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
>
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>

	[[alternative HTML version deleted]]

