Question: Cannot create SingleCellExperiment object
0
gravatar for Shian Su
2.1 years 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 • 896 views
ADD COMMENTlink modified 2.0 years ago by Aaron Lun25k • written 2.1 years ago by Shian Su20

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

ADD REPLYlink written 2.0 years ago by Martin Morgan ♦♦ 24k
Answer: Cannot create SingleCellExperiment object
3
gravatar for Aaron Lun
2.0 years ago by
Aaron Lun25k
Cambridge, United Kingdom
Aaron Lun25k 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 2.0 years ago by Aaron Lun25k

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 2.0 years 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: 447 users visited in the last hour