DittoDimPlot errror: Cannot find 'NA' in this Seurat object
2
0
Entering edit mode
nina.hahn ▴ 10
@ninahahn-23355
Last seen 15 months ago
Germany

Dear all,

I am using seurat to analyze spatial data. I have 8 datasets from 2 batches merged together. I aim to use dittoSeq for visualizations, however, I am facing a problem regarding NA values. The batches are saved in the metadata slot of my seurat object. DimPlot from Seurat is working well.


dittoDimPlot(brain.merge, var="Batch")
Error: Cannot find 'NA' in this Seurat object

Best, Nina

dittoSeq • 2.1k views
ADD COMMENT
1
Entering edit mode
ATpoint ★ 4.5k
@atpoint-13662
Last seen 7 hours ago
Germany

Without knowing the package, a quick look at the help page suggested that this function plots a given variable (here Batch) using a dimensionality reduction. The relevant argument default is reduction.use = .default_reduction(object). If the object has none, then it is NA. Hence, I assume your object has not been run through any reductuon before. What is the output of: dittoSeq:::.default_reduction(brain.merge)

ADD COMMENT
1
Entering edit mode

dittoSeq:::.default_reduction(brain.merge)

[1] NA

You're right. After RunUMAP it changes to "umap" and it is working without any error.

Thanks!

ADD REPLY
0
Entering edit mode

Great, you're welcome. I submitted a PR to dittoSeq GitHub with a fix for this: https://github.com/dtm2451/dittoSeq/pull/123

ADD REPLY
0
Entering edit mode

I've updated the fix and just pushed through to both the release and devel versions of the package! It'll take a few days to go through.

Ultimately, running RunUmap and then re-running dittoDimPlot() was indeed your correct path... ATpoint and my fix just makes it so you'd actually have gotten the error message -- "No dimensionality reduction slots in 'object'. Add one, or provide embeddings directly to 'reduction.use'." -- which was intended to point you in that direction.

ADD REPLY
0
Entering edit mode
@james-w-macdonald-5106
Last seen 2 hours ago
United States

Seurat is not a Bioconductor package, so this question is off-topic for this site. You should ask your question on the Seurat Discussions page.

ADD COMMENT
1
Entering edit mode

...but dittoSeq is :)

ADD REPLY
0
Entering edit mode

I am sorry if it is wrong here. As this function is part of the dittoSeq package derived from Bioconductor, I guess it should be wrong at the seurat discussion page.

ADD REPLY
1
Entering edit mode

Ah, my bad. What do you get from running traceback() right after you get the error?

ADD REPLY
0
Entering edit mode

traceback()

8: stop("Cannot find '", i, "' in this Seurat object", call. = FALSE)

7: [[.Seurat(object, reduction)

6: object[[reduction]]

5: Embeddings(object = object[[reduction]], ...)

4: Embeddings.Seurat(object, reduction = reduction.use)

3: Seurat::Embeddings(object, reduction = reduction.use)

2: .extract_Reduced_Dim(reduction.use, dim.1, object)

1: dittoDimPlot(brain.merge, var = "Batch")

I never used traceback before, but this was a good hint to search for a solution. In this data set there was no UMAP projection calculated before. After RunUMAP it was working =) thanks for your help!

Best, Nina

ADD REPLY

Login before adding your answer.

Traffic: 713 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6