hms-dbmi / scde

R package for analyzing single-cell RNA-seq data
http://pklab.med.harvard.edu/scde
Other
170 stars 64 forks source link

Errors when running tutorial code #42

Closed mnsekula closed 7 years ago

mnsekula commented 7 years ago

Hello,

I downloaded the scde package from the development version from GitHub (version 1.99.4) and am trying to learn how to use it so I can use it on another dataset. When I try running the tutorial code verbatim, I am getting errors.

The code I am running is:

library(scde)
# load example dataset
data(es.mef.small)
# factor determining cell types
sg <- factor(gsub("(MEF|ESC).*", "\\1", colnames(es.mef.small)), levels = c("ESC", "MEF"))
# the group factor should be named accordingly
names(sg) <- colnames(es.mef.small)  
table(sg)
# clean up the dataset
cd <- clean.counts(es.mef.small, min.lib.size=1000, min.reads = 1, min.detected = 1)
# EVALUATION NOT NEEDED
# calculate models
o.ifm <- scde.error.models(counts = cd, groups = sg, n.cores = 1, threshold.segmentation = TRUE, save.crossfit.plots = FALSE, save.model.plots = FALSE, verbose = 1)

However after this last line, I'm receiving the same error over and over again. For the sake of brevity I've only included the first few instances of the error:

> library(scde)
Loading required package: flexmix
Loading required package: lattice
> # load example dataset
> data(es.mef.small)
> # factor determining cell types
> sg <- factor(gsub("(MEF|ESC).*", "\\1", colnames(es.mef.small)), levels = c("ESC", "MEF"))
> # the group factor should be named accordingly
> names(sg) <- colnames(es.mef.small)  
> table(sg)
sg
ESC MEF 
 20  20 
> # clean up the dataset
> cd <- clean.counts(es.mef.small, min.lib.size=1000, min.reads = 1, min.detected = 1)
> # EVALUATION NOT NEEDED
> # calculate models
> o.ifm <- scde.error.models(counts = cd, groups = sg, n.cores = 1, threshold.segmentation = TRUE, save.crossfit.plots = FALSE, save.model.plots = FALSE, verbose = 1)
cross-fitting cells.
number of pairs:  190 
number of pairs:  190 
total number of pairs:  380 
cross-fitting 380 pairs:
building individual error models.
adjusting library size based on 2000 entries
fitting ESC models:
1 : ESC_10
Classification: weighted 
Error in FUN(X[[i]], ...) : 
  trying to get slot "logLik" from an object of a basic class ("function") with no slots
2 : ESC_11
Classification: weighted 
Error in FUN(X[[i]], ...) : 
  trying to get slot "logLik" from an object of a basic class ("function") with no slots
3 : ESC_12
Classification: weighted 
Error in FUN(X[[i]], ...) : 
  trying to get slot "logLik" from an object of a basic class ("function") with no slots

I've also tried running the same code using the scde package on Bioconductor (version 2.5.0), and am getting (different) errors as well.

> library(scde)
Loading required package: flexmix
Loading required package: lattice
> # load example dataset
> data(es.mef.small)
> # factor determining cell types
> sg <- factor(gsub("(MEF|ESC).*", "\\1", colnames(es.mef.small)), levels = c("ESC", "MEF"))
> # the group factor should be named accordingly
> names(sg) <- colnames(es.mef.small)  
> table(sg)
sg
ESC MEF 
 20  20 
> # clean up the dataset
> cd <- clean.counts(es.mef.small, min.lib.size=1000, min.reads = 1, min.detected = 1)
> # EVALUATION NOT NEEDED
> # calculate models
> o.ifm <- scde.error.models(counts = cd, groups = sg, n.cores = 1, threshold.segmentation = TRUE, save.crossfit.plots = FALSE, save.model.plots = FALSE, verbose = 1)
cross-fitting cells.
number of pairs:  190 
number of pairs:  190 
total number of pairs:  380 
cross-fitting 380 pairs:
building individual error models.
adjusting library size based on 2000 entries
fitting ESC models:
1 : ESC_10
Error in checkSlotAssignment(object, name, value) : 
  assignment of an object of class “function” is not valid for slot ‘defineComponent’ in an object of class “FLXMRglmC”; is(value, "expression") is not TRUE
2 : ESC_11
Error in checkSlotAssignment(object, name, value) : 
  assignment of an object of class “function” is not valid for slot ‘defineComponent’ in an object of class “FLXMRglmC”; is(value, "expression") is not TRUE
3 : ESC_12
Error in checkSlotAssignment(object, name, value) : 
  assignment of an object of class “function” is not valid for slot ‘defineComponent’ in an object of class “FLXMRglmC”; is(value, "expression") is not TRUE
JEFworks commented 7 years ago

Solution previously posted here: https://github.com/hms-dbmi/scde/issues/40

mnsekula commented 7 years ago

Thank you! Sorry I didn't see that post earlier.