seurat
seurat copied to clipboard
ERROR findmarkers latent.vars MAST
I have a question and an issue regarding MAST latent variables
Idents(object) <- "celltype.condition"
markers <- FindMarkers(object,
ident.1 = "astro_DS",
ident.2 = "astro_CT",
assay = "RNA",
logfc.threshold = 0,
test.use = "MAST",
latent.vars = c("Age_at_death", "Sex")
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
Calls: FindMarkers ... model.matrix -> model.matrix.default -> contrasts<-
Execution halted
the age at death is character. Do I need to change to numeric before using the findmarkers function to find DEGS between disease and control?
str(object$Age_at_death) Named chr [1:309364] "82" "82" "82" "82" "82" "82" "82" "82" "82" "82" "82" "82" "82" "82" "82" "82" "82" ...
- attr(*, "names")= chr [1:309364] "D03_S09_AAACCTGAGCTTTGGT-1" "D03_S09_AAACCTGAGGCCCTTG-1" "D03_S09_AAACCTGAGTAGCGGT-1" "D03_S09_AAACCTGAGTCGTACT-1" ...
I tried converting it into numeric but still the error persists which might not be related but in general do I change it to numeric or not? object$Age_at_death <- as.numeric(object$Age_at_death)