Creating Seurat Object from DropViz metacells and annotations?
0
0
Entering edit mode
2.1 years ago
zor0 • 0

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 • 1.1k views
ADD COMMENT
1
Entering edit mode

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

ADD REPLY
0
Entering edit mode

Thanks for the help. Will do!

ADD REPLY

Login before adding your answer.

Traffic: 2136 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6