Hi, I am attempting to use the classifySex function for mouse data, I defined genome='Mm' but I believe it is still attempting to classify using the human reference XIST instead of the mouse Xist. Below I am pasting my code and the error I am currently receiving.
Hi, I am attempting to use the classifySex function for mouse data, I defined genome='Mm' but I believe it is still attempting to classify using the human reference XIST instead of the mouse Xist. Below I am pasting my code and the error I am currently receiving.
`
library(Seurat) library(CellBench) library(org.Hs.eg.db) library(org.Mm.eg.db)
library(cellXY)
Load so
so <- readRDS(file = filtpath)
DefaultAssay(so) <- 'RNA' so_temp <- so
Use sparse matrix to avoid memory issues
counts <- so_temp@assays$RNA@counts print(head(counts))
Map SYMBOL to ENSEMBL
ann <- select(org.Mm.eg.db, keys=rownames(counts), columns=c("ENSEMBL","SYMBOL"), keytype="SYMBOL")
Match and replace row names
m <- match(rownames(counts), ann$SYMBOL) valid_ann <- ann[!is.na(m), ] valid_counts <- counts[match(valid_ann$SYMBOL, rownames(counts)), ] rownames(valid_counts) <- valid_ann$ENSEMBL
print(head(valid_counts))
print("Now to make counts a matrix...")
Ensure valid_counts is dense if classifySex requires a dense matrix
valid_counts_dense <- as.matrix(valid_counts)
print("Now to classify sex......")
Classify sex
sex <- classifySex(valid_counts, genome="Mm") print(head(sex))
Generate boxplot
table(sex$prediction) boxplot(valid_counts["Xist",] ~ sex$prediction)
`
the error is:
Error: variables ‘XIST’, ‘superX’, ‘superY’ were specified with different types from the fit