Skip to content
Prev 15447 / 21307 Next

[Bioc-devel] Import BSgenome class without attaching BiocGenerics (and others)?

There's never a need to attach a package to satisfy the dependencies
of another package. That would defeat the purpose of namespaces.

The three coercion functions gets at the heart of the S3/S4 mess.
setAs() provides a dynamic coercion mechanism, so is useful for as(x,
class) when class can be anything. as.data.frame() is an S3 generic
defined by the base package, so every package sees it. Something
promotes as.data.frame() to an S4 generic, but only packages that
import the generic can see it. That likely excludes the vast majority
of CRAN packages. Thus, we define an S3 method for calls to the S3
generic. The S4 generic will fall back to the S3 methods; however, it
will first check all S4 methods. Defining as.data.frame,Vector()
defends against the definition of a method above it, such as
as.data.frame,Annotated(), which would intercept dispatch to the S3
as.data.frame.Vector().

Michael

On Fri, Sep 6, 2019 at 10:08 AM Bhagwat, Aditya
<Aditya.Bhagwat at mpi-bn.mpg.de> wrote:

  
    

Thread (25 messages)

Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 6 Michael Lawrence Import BSgenome class without attaching BiocGenerics (and others)? Sep 6 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 6 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 6 Michael Lawrence Import BSgenome class without attaching BiocGenerics (and others)? Sep 6 Kasper Daniel Hansen Import BSgenome class without attaching BiocGenerics (and others)? Sep 6 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 6 Michael Lawrence Import BSgenome class without attaching BiocGenerics (and others)? Sep 6 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 6 Hervé Pagès Import BSgenome class without attaching BiocGenerics (and others)? Sep 10 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Hervé Pagès Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Michael Lawrence Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Michael Lawrence Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Hervé Pagès Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Hervé Pagès Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Michael Lawrence Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Bernat Gel Import BSgenome class without attaching BiocGenerics (and others)? Sep 11 Bernat Gel Import BSgenome class without attaching BiocGenerics (and others)? Sep 12 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 12 Bernat Gel Import BSgenome class without attaching BiocGenerics (and others)? Sep 12 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 12 Bhagwat, Aditya Import BSgenome class without attaching BiocGenerics (and others)? Sep 12