KlugerLab / GeneTrajectory

R implementation of GeneTrajectory
https://www.nature.com/articles/s41587-024-02186-3
50 stars 9 forks source link

Issue with Getting Variable Genes with Given Human Myeloid Seurat Object #1

Closed qianzach closed 7 months ago

qianzach commented 7 months ago

Hi,

I had a quick question regarding some of the code in your initial preprocessing of the seurat object in your walkthrough of the package.

It seems as if there is an issue with the assay when trying to find the top 500 highly variable genes, i.e. when we attempt to execute: data_S <- FindVariableFeatures(data_S, nfeatures = 500)

As a result, the error I get is:

0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Calculating feature variances of standardized and clipped values
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Error in validObject(object = value) : 
  invalid class "Assay" object: slots in class definition but not in object: "assay.orig"
Error during wrapup: no slot of name "assay.orig" for this object of class "Assay"
Error: no more error handlers available (recursive errors?); invoking 'abort' restart

I can't seem to find the issue unfortunately. I would appreciate any assistance in working through this issue! As a reference, I'm using the Matrix 1.6-5 and Seurat 5.0.2.

Sincerely, Zach

RihaoQu commented 7 months ago

Hi Zach,

If you are using Seurat v5, you can try to update the object by

library(SeuratObject)
data_S = SeuratObject::UpdateSeuratObject(data_S)

Then, change the following line in the first code block to data_S@meta.data$celltype <- cluster_relabel[as.character(data_S$cluster)]

Hope this can solve the issue.

Best, Rihao