theislab / destiny

R package for single cell and other data analysis using diffusion maps
https://theislab.github.io/destiny/
GNU General Public License v3.0
77 stars 11 forks source link

Error creating DiffusionMap #29

Closed swokybio closed 1 year ago

swokybio commented 5 years ago

Hi,

I am trying to make a DiffusionMap in an integrated single cell object (SingleCellExperiment) created in Seurat and I am getting the following error:

> dm <- DiffusionMap(t(pseudotime_sce))
Error in dataset_extract_doublematrix(data, vars) : 
  Data needs to be matrix, data.frame, ExpressionSet, or SingleCellExperiment

When I check the object class it is on dgCMatrix format:

> class (pseudotime_sce)
[1] "dgCMatrix"
attr(,"package")
[1] "Matrix"

I've tried to convert the object to data.frame format using "as.data.frame" but had no success.

Any thoughts?

flying-sheep commented 5 years ago

So it’s a dgCMatrix, not a SingleCellExperiment.

What did you try to convert your Seurat object into a SingleCellExperiment?

apal6 commented 1 year ago

Same error, I treid to do the exact same thing

deng <- logcounts(deng_SCE)
colnames(deng) <- cellLabels
dm <- DiffusionMap(t(deng))
error: dm <- DiffusionMap(t(deng))
Error in dataset_extract_doublematrix(data, vars) : 
  Data needs to be matrix, data.frame, ExpressionSet, or SingleCellExperiment

Now I just tried to run the diffusion map on the SingleCellExperiment.

Not sure why it is not mentioned in the vignette?

Thanks, Aastha

flying-sheep commented 1 year ago

The API reference says what DiffusionMap expects:

The provided data can be a double matrix of expression data or a data.frame with all non-integer (double) columns being treated as expression data features (and the others ignored), an ExpressionSet, or a SingleCellExperiment.