I am trying to perform single cell RNA seq analysis and have a .h5ad file that I am trying to convert into a seurat object to start analysing it.
So far, I have converted the file into a h5seurat file. The problem I am facing is at the step when I try to load this h5seurat file.
This is the code I have written in R:
library(Seurat)
library(SeuratObject)
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
remotes::install_github("mojaveazure/seurat-disk", force = TRUE)
library(SeuratDisk)
#reading in the h5ad file
#STEP1: convert the annData object to h5Seurat object
Convert("file.h5ad", dest="h5seurat", overwrite=TRUE)
#STEP2:loading the h5Seurat file
file_seurat<- LoadH5Seurat("file.h5seurat")
When I run STEP2, this is the error message I get:
Error in fixupDN.if.valid(value, x@Dim) : length of Dimnames[[1]] (28728) is not equal to Dim[1] (2219)
I am aware that this implies that there is a discrepancy between:
Dimnames[[1]] : which refers to the names assigned to the rows (usually the features) which has a lenght of 28,728.
Dim[1] : which refers to the actual number of rows in the data matrix and has a size of 2,219.
But I am not sure about what I would need to do to solve this issue. Appreciate all the help I can get!
rjiminkook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.