feiyoung / PRECAST

an efficient data integration method for multiple spatial transcriptomics data with non- cluster-relevant effects such as the complex batch effects.
GNU General Public License v3.0
9 stars 3 forks source link

FindMarker function does not work with precast object #25

Closed abraham-abin13 closed 2 weeks ago

abraham-abin13 commented 1 month ago

Hello, I am trying to find DEG between cases and controls. I have a precast object which already contains 5 cases and 5 control samples.

I tried to use the following seurat command on the precast object. The metadata of the precast object has a column called "condition" which has the labels "controls" or "cases".

Idents(preObj) <- "condition"
FindMarkers(preObj,
                                    ident.1 = "cases",
                                    ident.2 = "controls",
                                    grouping.var = "condition",
                                    only.pos = FALSE,
                                    logfc.threshold = 0.25)

I get the following error: ! Cells in one or both identity groups are not present in the data requested.

Interestingly, FindAllMakers function works. I wonder if this has to do with how the seurat object is created with the precast package?

I didn't find any examples in the paper or in the package website to compare cases and control. Any advice on this front? Again thank you for the package!

Abin

abraham-abin13 commented 1 month ago

I figured out that this was a bug in my code. however, if you have any advice/comments about case vs control analyses other than using Seurat with PRECAST corrected gene expression, that would be helpful

feiyoung commented 4 weeks ago

As of now, I do not have any better advice regarding case-control analysis except for the analysis of corrected gene expression.