[Bioc-devel] issue about S4 slot has a dist object.
hpages at fredhutch.org
Thu Apr 2 00:52:51 CEST 2015
In the same way that we avoid having 2 packages define the same
S4 generic function by moving the shared generic definitions to
BiocGenerics, it seems that we should also avoid having 2 packages
call setOldClass on the same S3 class. Like with S4 generic functions,
we've already started to do this by putting some setOldClass
statements in BiocGenerics (e.g. we've done it for the 'connection'
classes 'file', 'url', 'gzfile', 'bzfile', etc..., see class?gzfile).
So if nobody objects we'll do this for the 'dist' class too.
Then you won't need to use setOldClass in your cogena package Zhilong.
You'll just need to make sure that you import BiocGenerics.
On 04/01/2015 03:28 PM, Michael Lawrence wrote:
> Using setOldClass is generally fine. In this case, the graph package is
> already defining the dist class, so you could just import that. The graph
> package might have to export it though.
> On Wed, Apr 1, 2015 at 3:15 PM, Zhilong Jia <zhilongjia at gmail.com> wrote:
>> Here is the package. (https://tracker.bioconductor.org/issue1204 or
>> https://github.com/zhilongjia/cogena; ). When I biocCheck it, there is a
>> Note: the specification for S3 class “dist” in package ‘cogena’ seems
>> equivalent to one from package ‘graph’: not turning on duplicate class
>> definitions for this class.
>> In the source code, there are two R files are related with this issue,
>> and <https://github.com/zhilongjia/cogena/blob/master/R/cogena_class.R>
>> <https://github.com/zhilongjia/cogena/blob/master/R/dist_class.R> in the R
>> dir. Here there is a dist slot in cogena class. In the dist_class.R
>> <https://github.com/zhilongjia/cogena/blob/master/R/dist_class.R>, I use
>> setOldClass, but it seems it is not recommended by Bioconductor.
>> How to repair this issue? Thank you.
>> [[alternative HTML version deleted]]
>> Bioc-devel at r-project.org mailing list
> [[alternative HTML version deleted]]
> Bioc-devel at r-project.org mailing list
Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024
E-mail: hpages at fredhutch.org
Phone: (206) 667-5791
Fax: (206) 667-1319
More information about the Bioc-devel