Open YColino opened 1 year ago
Hi! I've been dealing with a similar problem for a couple of days, so I hope the way I went around it works for you.
I got the same error in any music_basis
/music_prop
/music2_prop
as you did when the SCE contained only one value in the samples variable. In my case, I was testing a 1-donor version of a 4-donor dataset when this showed up. So check the data in the sce column that corresponds to your samples
parameter in the function call.
I went through the code in music_basis
and I think it makes sense because the creation of the S
matrix expects somehow both samples and celltypes to compute the relative abundances.
Anyhow, is MuSiC intended for 1 sample datasets?
So, I went for the full dataset and the "Too few common genes!" problem also appeared. I checked: my data have some 30000 genes present in both bulk and single-cell datasets. I think I solved partially the problem with this piece of code, which basically, subsets and resorts the data to common genes:
c.genes <- sort(intersect(rownames(control.mtx), rownames(sce)))
sce <- sce[c.genes,]
control.mtx <- as.matrix(control.mtx[c.genes,])
# case.mtx <- as.matrix(case.mtx[c.genes,])
dim(sce)
dim(control.mtx)
# dim(case.mtx)
Now, the Too few common genes!
error is gone, though I think this could/should be fixed in the package itself, no?
PS: music2_prop
is still complaining about non-conformable arrays, but I don't think it's related to these problems.
Error in MOD0 + mod0: non-conformable arrays
Hi,
I am having the following error when I run both
music_basis
andmusic_prop
functions:If I try with the example data it works but when I use my data it does not.
Here is my code:
The sce looks like this:
The bulk.m:
I think the problem is in the single cell cause when I use the example bulk RNA provided I get the same problem, but if I use my bulk but the example sc data it says "Too few common genes!".
Any guidance on how to solve the error would be much appreciated!
Thanks, Yolanda