xuranw / MuSiC

Multi-subject Single Cell Deconvolution
https://github.com/xuranw/MuSiC
GNU General Public License v3.0
220 stars 83 forks source link

music_prop not able to handle when y = counts(x)[, clusters %in% ct & samples %in% sid] is single row #100

Open btuftin opened 1 year ago

btuftin commented 1 year ago

I've struggled getting music_prop to complete with my data and have run it in debugging mode following the code through the functions to see if I could identify the issue.

What I've found is that music_basis returns a large matrix, but it lacks the row names with gene IDs so when cm.gene = intersect( row names(sc.basis$Disgn.mtx), bulk.gene ) runs the intersection is empty.

The rownames appear to be lost in the line y = counts(x)[, clusters %in% ct & samples %in% sid] when this is a single row it returns as a vector (which the following lines test for) and the rowname is lost.

music_prop then stops with the error "Too few common genes!", which is not what the issue actually is, as far as I can tell.