Re: [Bioc-devel] S4 overwrite inspector of virtual class

2016-08-15 Thread Gabe Becker
Ah, yeah we usually call them validator functions or (more commonly) validity functions/validity method. The issue with what you want is that if A is a superclass of B (B inherits from or "contains" A) then objects of class B must be valid objects of class A. From ?validObject (emphasis mine) V

Re: [Bioc-devel] S4 overwrite inspector of virtual class

2016-08-15 Thread Michael Lawrence
In principle, there should be no need to override a validator, since the constraints specified by the super class should not be violated. Subclasses should only add constraints. But you can abstract the constraints, e.g., make a generic for checking the chromosome ID format, and have version-specif

Re: [Bioc-devel] S4 overwrite inspector of virtual class

2016-08-15 Thread Zach Skidmore
maybe validator is the proper term in R? i've highlighted what I refer to as the inspector below as an example: setClass("file", contains="file_virtual", validity=function(object){ # Check that object is as expected } ) On 8/15/16

Re: [Bioc-devel] S4 overwrite inspector of virtual class

2016-08-15 Thread Gabe Becker
Zach, Is an inspector a method you define on your classes? I'm not quite following what you mean by your question. AFAIK inspectors are not generally a thing in R (at least that go by that name). ~G On Mon, Aug 15, 2016 at 9:42 AM, Zach Skidmore wrote: > Hi All, > > I'm currently transforming

[Bioc-devel] S4 overwrite inspector of virtual class

2016-08-15 Thread Zach Skidmore
Hi All, I'm currently transforming the GenVisR package into an Object Oriented system. Currently I have a virtual class and several child-classes. I am wondering if there is a way to tell R to use the inspector of the virtual class only if the inspector of a child class in not defined. For exa