Closed roanvanscheppingen closed 4 months ago
I've identified the piece of code that is causing this. It's in preprocessing.R around line 2000
if (!is.null(metadata)) {
metadata <- match.arg(
arg = metadata,
choices = c(
"Area", "fov", "Mean.MembraneStain", "Mean.DAPI", "Mean.G",
"Mean.Y", "Mean.R", "Max.MembraneStain", "Max.DAPI", "Max.G",
"Max.Y", "Max.R"
),
several.ok = TRUE
)
Shouldn't choices be something like colnames(metadata.file) so you can have all potential columns as meta.data associated to your Seurat? I'm inexperienced in PRs or changing this to work, but I guess the fix is easy for someone to implement!
Hi, A workaround is to first load the Count data using LoadNanostring(). Then you can use flatfiles to build a second seurat object and extract the meta.data from it to append it back to the first Seurat object you have with AddMetaData(). We will look into this to see if this is a real bug and fix it if so. Thank you.
When building a Seurat from Cosmx flatfiles, the import options for meta.data is limited and don't work fully as described. Now the meta.data import is very limited compared to the native Seurat returned by the Cosmx machine. But actually, nanostring recommends building the Seurat using flatfiles. Many meta.data columns are inaccessible using LoadNanostring.
Seurat documentation:
The meta.data file contains more, but cannot be fully imported. Bigger bug, defining "Mean.G" (or Y, R) gives Error in
[.data.frame
(md, , metadata) : undefined columns selected