What to do with Seurat metadata and counts in separate text files?
1
0
Entering edit mode
23 months ago
5b54ea20 • 0

I am trying to learn some single-cell methods, and wanted to work with this dataset: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE190772

However, the data has already been through QC and pre-processing, and I can't figure out how to create a Seurat Object from a normalized count matrix and a metadata file instead of the expected barcodes, genes, and matrix files.

single-cell seurat • 2.8k views
ADD COMMENT
1
Entering edit mode
23 months ago
fracarb8 ★ 1.6k

Have a look at how CreateSeuratObject works: ?CreateSeuratObject.

CreateSeuratObject( counts, project = "SeuratProject", assay = "RNA",  meta.data = NULL)
  • counts is the normalised matrix ;
  • assay is the seurat slot. As you already have a normalised matrix, you need to set it to data.
  • meta.data is the table containing the metadata

You can then skip the first steps and proceed with the scaling, PCA, ....

ADD COMMENT
0
Entering edit mode

Thanks for your reply - I actually tried something very similar, which I thought worked until I tried to complete scaling and dimension reduction:

logCounts <- data.table::fread("GSE190772_BoM_logCounts.txt")
BMmetaData <- data.table::fread("GSE190772_BoM_MetaData.txt")

bonemets <- CreateSeuratObject(counts = logCounts, assay = "data", meta.data = BMmetaData)'

all.genes <- rownames(bonemets)
bonemets <- ScaleData(bonemets, features = all.genes)
bonemets <- RunPCA(bonemets, features = VariableFeatures(object = bonemets))

Did I do this correctly? If so, it seems like there is some disagreement between the metadata and count matrix, or something is formatted weirdly...

Console looked like this:

> bonemets <- CreateSeuratObject(counts = logCounts, project = "SeuratProject", assay = "data", meta.data = BMmetaData)

Warning messages:

1: In CreateSeuratObject.default(counts = logCounts, project = "SeuratProject", : Some cells in meta.data not present in provided counts matrix

2: In storage.mode(from) <- "double" : NAs introduced by coercion

all.genes <- rownames(bonemets)
bonemets <- ScaleData(bonemets, features = all.genes)

Centering and scaling data matrix |==========================================================================================| 100%

bonemets <- RunPCA(bonemets, features = VariableFeatures(object = bonemets))

Error in irlba(A = t(x = object), nv = npcs, ...) : max(nu, nv) must be positive

ADD REPLY

Login before adding your answer.

Traffic: 2569 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