Commit d82b7044 authored by Amine  GHOZLANE's avatar Amine GHOZLANE

Solve a defective case with the weighted normalization

parent 87292543
Pipeline #15659 passed with stage
in 7 minutes and 29 seconds
......@@ -770,12 +770,12 @@ w.sizefactor <- function(CT)
CT[which(CT<1)]=NA
gm = apply(CT,1,geometric.mean,na.rm=TRUE)
weights = nbsamp - apply(CT,1,FUN=function(x){tmp =length(which(is.na(x))) ;return(tmp)})
weights_tmp = weights
for(i in 1:ncol(CT))
{
ind = which(is.na(CT[,i]))
gm_tmp = gm
weights_tmp = weights
tmp = CT[,i]
if(length(ind)>0) {tmp = CT[-ind,i]; gm_tmp = gm[-ind]; weights_tmp = weights[-ind]}
sf[i] = w.median(tmp/gm_tmp,weights_tmp, na.rm = TRUE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment