Hi everyone,
When I started my analysis, I merged 3 samples.
merged_seurat <- merge(x = PC9_1_raw_feature_bc_matrix,
y = c(PC9_2_raw_feature_bc_matrix, PC9_3_raw_feature_bc_matrix),
add.cell.id = c("PC9_1", "PC9_2", "PC9_3"))
After cell filtering, I checked the cell cycle and batch effects (no batch effect, I won't do integration). I split my Seurat object to do normalization with SCTransform separately.
split_seurat <- SplitObject(seurat_phase, split.by = "Sample")
for (i in 1:length(split_seurat)) {
split_seurat[[i]] <- SCTransform(split_seurat[[i]], vars.to.regress = c("mitoRatio"), vst.flavor = "v2")
}
Now I would like to do the umap (without integration), and then I merge the 3 split Seurat objects.
new_seurat <- merge(x = split_seurat$PC9_1,
y = list(split_seurat$PC9_2, split_seurat$PC9_3),
merge.data = TRUE)
When I ran runPCA,
# Run PCA
new_seurat <- RunPCA(new_seurat, verbose = FALSE)
I had this error message:
Error in PrepDR(object = object, features = features, verbose = verbose) : Variable features haven't been set. Run FindVariableFeatures() or provide a vector of feature names.
How can I fix it?
Thank you antonioggsousa for your help :-)