[Bioc-devel] [Rd] Error on executing functions from installed package

Hervé Pagès hpages at fhcrc.org
Fri Jun 28 01:43:53 CEST 2013


Hi Kamal,

The "rbind" method for SummarizedExperiment objects is defined in the
GenomicRanges package:

   > library(GenomicRanges)
   > selectMethod("rbind", "SummarizedExperiment")
   Method Definition:

   function (..., deparse.level = 1)
   {
     args <- unname(list(...))
     .rbind.SummarizedExperiment(args)
   }
   <environment: namespace:GenomicRanges>

   Signatures:
         ...
   target  "SummarizedExperiment"
   defined "SummarizedExperiment"

And the rbind() generic is defined in the BiocGenerics package:

   > rbind
   standardGeneric for "rbind" defined from package "BiocGenerics"

   function (..., deparse.level = 1)
   standardGeneric("rbind")
   <environment: 0x1f0b8b0>
   Methods may be defined for arguments: ...
   Use  showMethods("rbind")  for currently available ones.

So your package needs to import at least the rbind() generic from
BiocGenerics + I think the method from GenomicRanges:

   importFrom(BiocGenerics, rbind)
   importMethodsFrom(GenomicRanges, rbind)

I would highly recommend that you actually import *all* the generics
from BiocGenerics:

   import(BiocGenerics)
   importMethodsFrom(GenomicRanges, rbind)

You also need to put BiocGenerics and GenomicRanges in the Depends field
of your DESCRIPTION file (yes Depends, not Imports -- you can also put
it in both even though some people might try to argue against this).

Please let us know if that still doesn't solve the problem.

Cheers,
H.


On 06/26/2013 07:37 AM, Kamal wrote:
> Few more details:
>
> clRes object is essentially a list of SummarizedExperiment class object (of
> GenomicRanges package). Each object is of single chromosome since it is
> generated by parallelization. I am trying to combine all these object into
> a single SummarizedExperiment Object. Since we can combine
> SummarizedExperiment objects rowwise by using "rbind", I am combing it
> through the function below
>
>> chrcomb <- sapply(clRes, function(x) rbind(x))
> Error in rbind(x) : no method for coercing this S4 class to a vector
>
> Thanks,
> Kamal
>
>
> On Wed, Jun 26, 2013 at 4:29 PM, Kamal <kamal.fartiyal84 at gmail.com> wrote:
>
>> Prof Brian,
>>
>> Thanks for the reply. My mistake its "clRes" in place of "result"
>>
>>> chrcomb <- sapply(clRes, function(x) rbind(x))
>>
>> Error in rbind(x) : no method for coercing this S4 class to a vector
>>
>> I think what you mentioned about the package forgetting to import an S4
>> generic for rbind seems the logical explanation of this problem.
>>
>> Thanks,
>> Kamal
>>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Hervé Pagès

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 fhcrc.org
Phone:  (206) 667-5791
Fax:    (206) 667-1319



More information about the Bioc-devel mailing list