Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with SlingshotDataSet(): as(<dsCMatrix>, "dgCMatrix") is deprecated #203

Closed
jedazard opened this issue Oct 7, 2022 · 5 comments
Closed

Comments

@jedazard
Copy link

jedazard commented Oct 7, 2022

Hi Kelly,
I've run 'getLineages' on a Seurat object outputs as follows:

lineages <- getLineages(data=Embeddings(object=seur.scaled, reduction="umap"),
clusterLabels=seurat_clusters,
reducedDim=NULL,
dist.method="slingshot",
use.median=FALSE,
omega=FALSE,
omega_scale=1.5,
times=NULL)

'lineages' PseudotimeOrdering object looks okay to me:

lineages
class: PseudotimeOrdering
dim: 13472 5
metadata(3): lineages mst slingParams
pathStats(2): pseudotime weights
cellnames(13472): AAACCCAAGACGCAGT-1 AAACCCAAGCGATGCA-1 ...
TTTGTTGGTGCCCTTT-1 TTTGTTGGTTTCGTGA-1
cellData names(2): reducedDim clusterLabels
pathnames(5): Lineage1 Lineage2 Lineage3 Lineage4 Lineage5
pathData names(0):

Now, when I simply try to extract a SlingshotDataSet object from my 'lineages' object, I get the following error:

SlingshotDataSet(lineages)
Error: as(, "dgCMatrix") is deprecated since Matrix 1.5-0; do as(., "generalMatrix") instead

The same happens with slingshot(). Any idea of what's going on here?
Thanks in advance.

I'm using:
R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.6 (Ootpa)
[...]
other attached packages:
[1] slingshot_2.5.2

@jedazard
Copy link
Author

jedazard commented Oct 11, 2022

I think that I figured it out. I found a conflict between "slingshot" with another library that was attached in my environment. The library is "cerebroApp" (https://github.com/romanhaa/Cerebro). It is used also for trajectory analysis and interactive visualization of scRNA-seq data. I tested the SlingshotDataSet() function with and witout this library, and it's definitely what was causing the problem: SlingshotDataSet() works perfectly when "cerebroApp" is not attched, and fails with this weird error message when it's attached. Now, "cerebroApp" imports and suggests no less than 39 other libraries! I did not have time to test which is causing the conflict, but if someone is willing to do the testing, I'd be happy to learn about it. Also, "cerebroApp" is no longer supported. So, it may be a good idea to stay away from it when using "slingshot". Any suggestion is welcome. Thanks.

@kstreet13
Copy link
Owner

Hi @jedazard,

I looked into this a little bit and I'm not sure where the error is coming from. As far as I can tell, nothing in slingshot uses as(, "dgCMatrix"), so this must be something that gets called from another package. I'll keep an eye out for this error, though, in case it pops up again and will try to update this thread if I figure out what's causing it. For now, I think your solution of avoiding having both packages loaded at the same time is probably the best one.

Best,
Kelly

@peanut-123
Copy link

Dear Kelly,
i came across the same error with @jedazard
As i was using the function lines(SlingshotDataSet(ss), lwd=2, col='black')
The R outputs as follows: Error: as(<dsCMatrix>, "dgCMatrix") is deprecated since Matrix 1.5-0; do as(., "generalMatrix") instead
But I did not library the"cerebroApp" like @jedazard said.
I guess some dependencies had updated their function. Could you find the solution about it , thanks very much!

@kstreet13
Copy link
Owner

Hi @peanut-123,

Thanks for reporting this! I'm not able to reproduce this error, unfortunately, so is there any chance you could send me some code causes it?

Thanks,
Kelly

@kstreet13
Copy link
Owner

Closing due to lack of response. Feel free to re-open if this error pops up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants