xuranw / MuSiC

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

music_prop.cluster:Error in if (sum(abs(p.weight.new - p.weight)) < eps) { : missing value where TRUE/FALSE needed #51

Open Jason-bot-stack opened 4 years ago

Jason-bot-stack commented 4 years ago

Hi Xuran,

Thank you for writing this package! I was trying to run the Tutorial of MuSiC, when I run the music_prop.cluster function, I get the following error:

Est.mouse.bulk = music_prop.cluster(bulk.eset = Mouse.bulk.eset, sc.eset = Mousesub.eset,group.markers = IEmarkers, clusters = 'cellType',group = 'clusterType', samples = 'sampleID',clusters.type = clusters.type)

Error in if (sum(abs(p.weight.new - p.weight)) < eps) { : missing value where TRUE/FALSE needed

would you give me some suggestions? Thank you!

m21camby commented 4 years ago

I had same issue. Please let us know.

Jiam1ng commented 4 years ago

I have encounter the exact same issue, anybody has figured it out?

vildeka commented 4 years ago

I also encountered the same issue

mhimanshu11 commented 3 years ago

require(MuSiC) require(xbioc)

Mouse.bulk.eset = readRDS('./Mousebulkeset.rds')

Mousesub.eset = readRDS('./Mousesubeset.rds')

levels(Mousesub.eset$cellType)

Mousesub.basis = music_basis(Mousesub.eset, clusters = 'cellType', samples = 'sampleID', select.ct = c('Endo', 'Podo', 'PT', 'LOH', 'DCT', 'CD-PC', 'CD-IC', 'Fib', 'Macro', 'Neutro','B lymph', 'T lymph', 'NK'))

Plot the dendrogram of design matrix and cross-subject mean of realtive abundance

par(mfrow = c(1, 2)) d <- dist(t(log(Mousesub.basis$Disgn.mtx + 1e-6)), method = "euclidean")

Hierarchical clustering using Complete Linkage

hc1 <- hclust(d, method = "complete" )

Plot the obtained dendrogram

plot(hc1, cex = 0.6, hang = -1, main = 'Cluster log(Design Matrix)') d <- dist(t(log(Mousesub.basis$M.theta + 1e-8)), method = "euclidean")

Hierarchical clustering using Complete Linkage

hc2 <- hclust(d, method = "complete" )

hc2 <- hclust(d, method = "complete")

Plot the obtained dendrogram

plot(hc2, cex = 0.6, hang = -1, main = 'Cluster log(Mean of RA)')

clusters.type = list(C1 = 'Neutro', C2 = 'Podo', C3 = c('Endo', 'CD-PC', 'LOH', 'CD-IC', 'DCT', 'PT'), C4 = c('Macro', 'Fib', 'B lymph', 'NK', 'T lymph'))

cl.type = as.character(Mousesub.eset$cellType)

for(cl in 1:length(clusters.type)){ cl.type[cl.type %in% clusters.type[[cl]]] = names(clusters.type)[cl] } pData(Mousesub.eset)$clusterType = factor(cl.type, levels = c(names(clusters.type), 'CD-Trans', 'Novel1', 'Novel2'))

load('./IEmarkers.RData')

IEmarkers <- list(C3= Epith.marker, C4=Immune.marker)

Since the markers are available only for C3 and C4, we need to remove C1 and C2 from clusters.type

clusters.type = list(C3 = c('Endo', 'CD-PC', 'LOH', 'CD-IC', 'DCT', 'PT'), C4 = c('Macro', 'Fib', 'B lymph', 'NK', 'T lymph'))

Est.mouse.bulk = music_prop.cluster(bulk.eset = Mouse.bulk.eset, sc.eset = Mousesub.eset, group.markers = IEmarkers, clusters = 'cellType', group = 'clusterType', samples = 'sampleID', clusters.type = clusters.type)

Est.mouse.bulk$Est.prop.weighted.cluster`

This works so far for me but unfortunately there's no estimation for cell types present in C4.

ms-balzer commented 3 years ago

Having this problem as well. What @mhimanshu11 posted is essentially the tutorial's code, which unfortunately does not work for me either. Doesn't matter whether subcommand of music_prop.cluster is "group" or "groups", as another user suggested somewhere else.

woshiyangsi commented 3 years ago

same issues.do you know how to solve this probram?

Est.pbmc.bulk = music_prop.cluster(bulk.eset = bulk.eset, sc.eset = SC.eset, clusters = 'celltype', group.markers = Ipmarkers,groups = 'clusterType', samples = 'orig.ident', clusters.type = clusters.type) Start: cluster estimations...

Creating Relative Abundance Matrix... Creating Variance Matrix... Creating Library Size Matrix... Start: cell type estimations... Creating Relative Abundance Matrix... Creating Variance Matrix... Creating Library Size Matrix... Used 20058 common genes... X811_4 has common genes 16605 ... Error in if (sum(abs(p.weight.new - p.weight)) < eps) { : missing value where TRUE/FALSE needed

vdet commented 2 years ago

Dear Xuran,

Same issue here. No solution yet? Any alternative package to address the deconvolution collinearity problem?

All the best

Pazuzzilla commented 2 years ago

Hi, Thanks for the interesting package! I'm facing the same issue described here, there is updates? All the best

ghs101 commented 2 years ago

Hi,

Im facing the same issue. Any solutions yet?

Jason-bot-stack commented 2 years ago

Hi, I haven't solved this problem. you can try another deconvolution tool, which called Bisque.

------------------ 原始邮件 ------------------ 发件人: "xuranw/MuSiC" @.>; 发送时间: 2022年8月5日(星期五) 晚上11:00 @.>; @.**@.>; 主题: Re: [xuranw/MuSiC] music_prop.cluster:Error in if (sum(abs(p.weight.new - p.weight)) < eps) { : missing value where TRUE/FALSE needed (#51)

Hi,

Im facing the same issue. Any solutions yet?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

RouleThomas commented 11 months ago

Hi there, Same issue, any updates?

ZZQ-1117 commented 1 month ago

When construct the list of group marker, marker genes are required in clusters containing multiple celltypes!!!

IEmarkers = list(NULL, NULL, Immune.marker, Epith.marker) names(IEmarkers) = c('C1', 'C2', 'C3', 'C4')