MuSiC
MuSiC copied to clipboard
bugs with weight of cross cell type co-variance
the code in function music_prop
:
if(ct.cov){
Sigma.ct = sc.basis$Sigma.ct[, m.sc];
if(sum(Yjg[, i] == 0) > 0){
D1.temp = D1[Yjg[, i]!=0, ];
Yjg.temp = Yjg[Yjg[, i]!=0, i];
Sigma.ct.temp = Sigma.ct[, Yjg[,i]!=0];
...
...
Is there miss for loop? like for(i in 1:N.bulk){}
the code in function music.basic.ct
for(iter in 1:iter.max){
weight.gene = 1/(nu + r^2 + weight.cal.ct(lm.D$x*S, Sigma.ct))
Y.weight = Y*sqrt(weight.gene)
D.weight = X * as.matrix(sqrt(weight.gene))[,rep(1,k)]
lm.D.weight = nnls(D.weight, Y.weight )
p.weight.new = lm.D.weight$x/sum(lm.D.weight$x)
r.new = resid(lm.D.weight)
if(sum(abs(p.weight.new - p.weight)) < eps){
p.weight = p.weight.new;
...
...
lm.D
already fixed, will not update.?
should it be weight.gene = 1/(nu + r^2 + weight.cal.ct(lm.D.weight$x*S, Sigma.ct))
?