Open lucygarner opened 1 year ago
Hi! I think you might be right:
long vectors not supported yet
might mean that your data is stored as a long vector, and something can’t deal with this.
Which R version are you using? If the Rinlinedfuns.h
from your version is identical to the current trunk version, the error happens in this line: https://github.com/wch/r-source/blob/dac7eca95d50285a12addcf74ca42d82fc2bfe9b/src/include/Rinlinedfuns.h#L537 which looks weird: We can’t get the length
of it?
What structure does your data matrix have? I assume it’s a sparse matrix, but it still has that many entries?
Hi,
No, it's a dense matrix. Are sparse matrices accepted? I was looking at dataset_extract_doublematrix
(https://github.com/theislab/destiny/blob/master/R/dataset-helpers.r) and it appears to require either a matrix, data.frame, ExpressionSet, or SingleCellExperiment object.
Unless I use as.matrix()
to convert my dgCMatrix
into a dense matrix, is.matrix()
gives FALSE.
I am using R 4.2.0 and destiny 3.12.0.
Best wishes, Lucy
Oh! Focusing on scanpy must have led to me neglecting to finish convenient sparse matrix support here. I’m sorry!
What you can do is to use the distance matrix support. If you specify a “sparse distance matrix”* as distance
parameter and NULL
or a covariate dataframe as data
, destiny will skip doing the KNN search itself.
covariates <- data.frame(...) # cell metadata
dists <- N2R::Knn(data) # I think N2R supports sparse data, but I don’t know
dm <- DiffusionMap(covariates, distance = dists)
*It’s a bit of an awkward format, as the non-specified entries in such a sparse matrix don’t stand for 0, but for “unknown large distance”.
Thank you. I tried to run N2R::Knn
on my "dgCMatrix" (normalised expression), but got an error.
Error in n2Knn(m = m, k = k, nThreads = nThreads, verbose = verbose, indexType = indexType, : Not compatible with requested type: [type=S4; target=double].
I have got DiffusionMap
working with PCA embeddings as data
, so I will try this for now.
Hi,
I am getting a segmentation fault with
DiffusionMap
. I am not changing any of the defaults.1) When inputting a data matrix as
data
, I get the following error:2) When inputting a SingleCellExperiment object as
data
, I get the following error:I assume these errors are both down to the large size of my data (~100,000 cells x ~20000 genes) and the best approach would be to input PCA scores rather than the normalised expression values? Or is there another way around this?
Best wishes, Lucy