This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Creating Seurat Object from DropViz metacells and annotations?

Hi all,

I am new to all this, and I was trying to create a Seurat Object from: http://dropviz.org/

I downloaded R Data: metacells.BrainCellAtlas_Saunders_version_2018.04.01.rds (15M) and R Data: annotation.BrainCellAtlas_Saunders_version_2018.04.01.rds (12K)

I ran this code:

countsData <-readRDS("metacells.BrainCellAtlas_Saunders_version_2018.04.01.RDS")

metaData <- readRDS("annotation.BrainCellAtlas_Saunders_version_2018.04.01.RDS")

But when I run:

Saunders_object <- CreateSeuratObject(counts = countsData, meta.data = metaData, project = 'SaundersObject')

I get this warning message:

 "In CreateSeuratObject.default(counts = countsData, meta.data = metaData,  :
  Some cells in meta.data not present in provided counts matrix".

And my meta.data is full of NAs.

Any advice would be much appreciated!

single cell transcriptomics seurat r

To avoid this warning; first, read the metaData (or convert it) to a data frame, then make sure the count matrix has the same header (column names) as metaData row names; here are modifications to your code to avoid the warning message :

# reading metaData as dataframe
metaData <- data.frame(readRDS("annotation.BrainCellAtlas_Saunders_version_2018.04.01.RDS"))
# setting row name for metaData
row.names(metaData) <- metaData$tissue_subcluster
# Make sure the metaData rownames are in the same order as the count matrix column names 
all(rownames(metaData)== colnames(countsData))
[1] TRUE

Also note, to format the code in your posts into the proper format using the "code sample" option

Thanks for the help. Will do!

0 answers

No answers yet.

Log in to answer this question.