Question: Cannot create SingleCellExperiment object
0
gravatar for Shian Su
20 months ago by
Shian Su20
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Shian Su20 wrote:

 

Using R 3.4.2, BioC 3.6, SingleCellExperiment_1.0.0. The following example code from ?SingleCellExperiment produces an error

 

library(SingleCellExperiment)

ncells <- 100
u <- matrix(rpois(20000, 5), ncol=ncells)
v <- log2(u + 1)

pca <- matrix(runif(ncells*5), ncells)
tsne <- matrix(rnorm(ncells*2), ncells)

sce <- SingleCellExperiment(
  assays = list(counts=u, logcounts=v),
  reducedDims = SimpleList(PCA=pca, tSNE=tsne)
)

 

The error message is

Error in checkSlotAssignment(object, name, value) : 
  assignment of an object of class “GRangesList” is not valid for slot ‘rowRanges’ in an object of class “SingleCellExperiment”; is(value, "GenomicRangesORGRangesList") is not TRUE

 

This on a fresh Centos7 VM. If I'm not mistaken these examples are also tested as a part of the build process so I'm very puzzled how the code could fail on me.

EDIT: This appears to work perfectly fine on my MacBook Pro. It may be something strange in the setup of the Unix server I'm on.

singlecellexperiment • 777 views
ADD COMMENTlink modified 20 months ago by Aaron Lun24k • written 20 months ago by Shian Su20

Can you provide the output of sessionInfo() after library(SingleCellExperiment), and also BiocInstaller::biocValid() ?

ADD REPLYlink written 20 months ago by Martin Morgan ♦♦ 23k
Answer: Cannot create SingleCellExperiment object
3
gravatar for Aaron Lun
20 months ago by
Aaron Lun24k
Cambridge, United Kingdom
Aaron Lun24k wrote:

Works fine on my machine. Make sure you've properly updated all dependencies, as mentioned in:

C: SingleCellExperiment function in SingleCellExperiment package returns error (whe

ADD COMMENTlink written 20 months ago by Aaron Lun24k

Thanks Aaron, following that other question thread lead me to the solution. I had been drawing most of the BioC packages from a shared location I have no access to. The solution was to use

biocLite("SingleCellExperiment", dependencies=TRUE, lib="~/R/library")

to get a copy of all the dependencies in a local library. This removed the error.

ADD REPLYlink written 20 months ago by Shian Su20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 130 users visited in the last hour