xuranw / MuSiC

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

MuSiC2 issue: Error in MOD0 + mod0 : non-conformable arrays #106

Open jaclynbeck-sage opened 1 year ago

jaclynbeck-sage commented 1 year ago

Running music2_prop, the following issue happens if 'select.ct' argument = NULL. It's allowed to be NULL in the original music_prop, and a NULL value means "use all cell types in the metadata" for that function. The documentation for music2_prop also says this. However there's no check or logic for the case where select.ct = NULL in music2_prop, so when it gets to the iteration loop it creates a MOD0 matrix with 0 rows:

ncell = length(select.ct) # returns 0 for select.ct = NULL ... MOD0 = MOD1 = matrix(0L, nrow = ncell, ncol = length(exp_genel))

I can get around this by putting an actual value for select.ct when calling the function, however, could you change the documentation to match the code, or code to match documentation?

jaclynbeck-sage commented 1 year ago

Also this same issue appears in music2_prop_toast and music2_prop_t_statistics.

spatts14 commented 1 year ago

Hi @jaclynbeck-sage, what exactly you put for the select.ct value? Im assuming you just put all the cell types once, not label a list per cell - correct? Does it need to in the form of a list? It looks like they did update it to be c("Cell type", "etc").

I got this error: Error in MOD0 + mod0 : non-conformable arrays Calls: music2_prop_t_statistics

So Im trying to trouble shoot it . I had it set as NULL so it would use the single cell as default. Just double checking as this takes me a long time to run!

jaclynbeck-sage commented 1 year ago

@spatts14 Yes, I just put a vector of cell types: c('type1', 'type2', 'type3', ..., 'typeZ') (unique values, not a list per cell). That seemed to work ok.

JoyOtten commented 9 months ago

Hi I still have the same problem even when I put the cell types in a character vector.

gevro commented 5 months ago

Hi, I am getting the same issue.

JoyOtten commented 5 months ago

Hi, I think this issue has to do with the construction of your datasets. See here the code that I used for MuSiC (v1) version https://github.com/klengellab/Ska2/blob/main/Deconvolution_MuSic.R This worked for me.

gevro commented 5 months ago

Thanks, but the issue is specific to music2 functions. Music v1 works fine. So your code I don't think helps this issue.

rob-meller commented 5 months ago

Has there been any resolution to this issue.? When I run my two data sets individually through MuSiC using a vector of cell_types, they work. Then I run them together with MuSiC2 we get the "Error in MOD0 + mod0 : non-conformable arrays". THX