Replies: 2 comments 5 replies
-
|
Same issue! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Hi, thank you for bringing up this issue. Have you tried to remove cells with low UMI counts (e.g., nCount_RNA <=200)? It feels like some kinds of QC problems with the data. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I am having problems with running dimensionality reduction on my seurat object created from a .h5ad file using BPCells. I checked the count matrix and everything looks completely fine (no NAs, values >=0). However, once I reach the step of RunPCA in my pipeline and then check the result using an Elbow plot, something looks very wrong and I simply cannot figure out what is the cause of it. Like why is the standard deviation so large and why does it drop after the 1st PC? Also, when trying to run clustering after RunPCA, it returns an error (see below).
I have the same problem if I subset my seurat object to reduce its size and transform the BPCells count matrix into a dgCMatrix...PCA embeddings and ElbowPlot still make no sense.
#import raw data from h5ad file
raw <- open_matrix_anndata_hdf5(path="/novo/projects/departments/compbio/sysbio/Projects/mouse_liver_models/single_cell_and_nuclei/concatenated.dir/concatenated.h5ad")
#write matrix directory for on-disk storage
write_matrix_dir(mat = raw, dir = "/novo/projects/shared_projects/liver_biology_colab/people/aqnf/mouse_sc_sn_AQNF_June24/BPcells/mouse_counts")
#load data from matrix directory to generate seurat object
raw.mat <- open_matrix_dir(dir = "/novo/projects/shared_projects/liver_biology_colab/people/aqnf/mouse_sc_sn_AQNF_June24/BPcells/mouse_counts")
#merge meta data
meta <- merge(x= metadata_BSCK, y= metadata_CPDM, by.x = "LibraryID", by.y = "library_id", all.y=T)
rownames(meta) <- meta$barcode
# generate Seurat object from on-disk matrix
sobj <- CreateSeuratObject(counts = raw.mat, meta.data = meta)
vals <- as(sobj[["RNA"]]$counts[1:500,1:500], "dgCMatrix")
anyNA(vals)
all(vals >= 0)
any(vals == 0)
# process seurat object
sobj <- NormalizeData(sobj)
sobj <- FindVariableFeatures(sobj)
sobj <- ScaleData(sobj)
sobj <- RunPCA(sobj)
ElbowPlot(sobj.sketch, ndims = 50, reduction = 'pca')
Beta Was this translation helpful? Give feedback.
All reactions