You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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