Cannot create SingleCellExperiment object
1
0
Entering edit mode
Shian Su ▴ 40
@shian-su-9869
Last seen 6 days ago
Walter and Eliza Hall Institute of Medi…

 

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 • 2.6k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
3
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 12 hours ago
The city by the bay

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 COMMENT
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 1028 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6