Skip to content

Commit

Permalink
Memory mindful patch to PON generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafailov committed Nov 28, 2023
1 parent ff1e15f commit 283952d
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions R/dryclean.R
Original file line number Diff line number Diff line change
Expand Up @@ -560,26 +560,23 @@ pon <- R6::R6Class("pon",
reads[, signal := log(signal)]
reads = reads[, .(signal)]
if (!any(is.infinite(reads$signal))){
reads = transpose(reads)
return(reads)
#reads = transpose(reads)
return(reads$signal)
}
}
}, all.chr, mc.cores = num.cores)
gc()
mat.bind = rbindlist(mat.n, fill = T)

mat.bind.t = transpose(mat.bind)

rm(mat.bind)
gc()

}, all.chr, mc.cores = num.cores, ignore.interactive = T)

if (verbose){
message("Starting decomposition")
}

mat.bind.t = as.matrix(mat.bind.t)

mat.bind.t = matrix(unlist(mat.n), ncol = length(mat.n))
print(nrow(mat.bind.t))
print(ncol(mat.bind.t))
rm(mat.n)
gc()

detergent = rrpca.mod(mat.bind.t, trace = F, tol = tolerance)

rm(mat.bind.t)
Expand Down

0 comments on commit 283952d

Please sign in to comment.