Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too few common genes! #120

Open
hasanalanya opened this issue Jul 13, 2023 · 1 comment
Open

Too few common genes! #120

hasanalanya opened this issue Jul 13, 2023 · 1 comment

Comments

@hasanalanya
Copy link

Hi there,

I am trying to use MuSiC method but keep getting "Too few common genes!" error. I would appreciate if someone can help me to figure it out.

> bulk.matrix <- as.matrix(read.table(...)

> bulk.eset <- Biobase::ExpressionSet(assayData = bulk.matrix)

> # load the single cell study
> exprs.edited <- read.csv(...)

> pData <- read.csv("...) header = TRUE, sep = ",")

> i <- which(colnames(exprs.edited) %in% pData$X)
> subsetexpr <- exprs.edited[,i]
> m <- match(pData$X, colnames(subsetexpr))
> subsetexpr <- na.omit (subsetexpr)
> rownames(subsetexpr) <- make.names(exprs.edited[,1], unique = TRUE)
> rownames(subsetexpr) <- exprs.edited[,1]  
> subsetexpr <- na.omit (subsetexpr)
> subsetexpr <- exprs.edited[,i]
> subsetexpr <- na.omit (subsetexpr)
> dim (subsetexpr)
> rownames(subsetexpr) <- make.names(exprs.edited[,1], unique = TRUE)
> subsetexpr_mtx <-as.matrix(subsetexpr[,m])

> sce <- SingleCellExperiment(assays = list(counts = subsetexpr_sc), colData=DataFrame(label=pData))
> metadata <- data.frame(labelDescription=c('cell id', 'number of genes', 'number of UMI', 'origin identity', 'percent mito', 'cell type', 'clusters'))

> phenoData <- AnnotatedDataFrame(data=pData, 
+                                 varMetadata=metadata,)
> 
> rownames(phenoData)<-phenoData@data$X 
> 

> identical(rownames(phenoData),colnames(subsetexpr_sc))
[1] TRUE
> 
> assemb.expSet <- ExpressionSet(assayData=subsetexpr_sc, 
+                                phenoData=phenoData)
> 

> bulk.eset <- new("ExpressionSet", exprs=as.matrix(bulk.eset))
> bulk <- exprs(bulk.eset)
> Est.prop = music_prop(bulk.mtx = bulk, sc.sce = sce, clusters = 'label.cell_type', samples = 'label.X', select.ct = NULL, verbose =  F)
Error in music_prop(bulk.mtx = bulk, sc.sce = sce, clusters = "label.cell_type",  : 
  **Too few common genes!**
@hasanalanya
Copy link
Author

@xuranw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant