MarioniLab / scran

Clone of the Bioconductor repository for the scran package.
https://bioconductor.org/packages/devel/bioc/html/scran.html
40 stars 22 forks source link

Error with computeSumFactors #2 #12

Closed janihuuh closed 6 years ago

janihuuh commented 6 years ago

Hi,

I was following the vignette from https://master.bioconductor.org/packages/release/workflows/html/simpleSingleCell.html to count HVG:s starting from a gene-cell -matrix, but am facing issues with SummarizedExperiment -function, with the following error message coming along:

Error in .colSums(object) : unknown SEXP type for SummarizedExperiment object

I saw this issue before, and then it was perhaps a discrepancy issue with SummarizedExperiment and SCE-object. However, even with a reproducible example I get the same issue as well:

nrows <- 200
ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
colData <- DataFrame(Treatment=rep(c("IO", "No"), 3),
                     row.names=LETTERS[1:6])

temp <- SummarizedExperiment(assays=list(counts=counts),
                     colData=colData)

calcAverage(temp)

Error in .colSums(object) : 
  unknown SEXP type for SummarizedExperiment object

With R version 3.5.1 running under macOS Sierra 10.12.6

LTLA commented 6 years ago

You need to create a SingleCellExperiment object.

nrows <- 200
ncols <- 6
counts <- matrix(runif(nrows * ncols, 1, 1e4), nrows)
colData <- DataFrame(Treatment=rep(c("IO", "No"), 3),
                     row.names=LETTERS[1:6])
temp <- SingleCellExperiment(assays=list(counts=counts),
                     colData=colData)
calcAverage(temp)

... which works fine for me.

Also, this issue is better raised on the Bioconductor support site, or at https://github.com/MarioniLab/simpleSingleCell, given that it doesn't have much to do with scran (even calcAverage is from scater).

janihuuh commented 6 years ago

Thanks, got the issue solved!