From 5799fa323bc0277750129ed19766b274d031ad73 Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent@modolo.fr>
Date: Wed, 6 May 2020 11:10:29 +0200
Subject: [PATCH] tdd_analysis_bt_cell_type.R: fix data loading for bt_analysis

---
 src/tdd_analysis_bt_cell_type.R | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/tdd_analysis_bt_cell_type.R b/src/tdd_analysis_bt_cell_type.R
index f0f658d..65aaf91 100644
--- a/src/tdd_analysis_bt_cell_type.R
+++ b/src/tdd_analysis_bt_cell_type.R
@@ -192,7 +192,7 @@ model_construction <- function(tdd_index, factor_rm, transcript_selection, outdi
 }
 
 tdd_analysis <- function(tdd_index, factor_rm, transcript_selection, outdir, cpus = 10) {
-  cl <- makePSOCKcluster(12)
+  cl <- makePSOCKcluster(cpus)
   registerDoParallel(cl)
   # compute Feature importance
   # Permutation feature importance measures the increase in the prediction error
@@ -221,8 +221,6 @@ tdd_analysis <- function(tdd_index, factor_rm, transcript_selection, outdir, cpu
   # compute Feature effects
   # The partial dependence function at a particular feature value represents the
   # average prediction if we force all data points to assume that feature value.
-  load(file = str_c(outdir, "bt_model.Rdata"))
-
   if (!file.exists(str_c(outdir, "bt_ale.Rdata"))) {
     bt_ale <- list()
   for (feature in tdd_index %>%
@@ -304,8 +302,6 @@ tdd_analysis <- function(tdd_index, factor_rm, transcript_selection, outdir, cpu
   # Individual Conditional Expectation (ICE) plots display one line per instance
   # that shows how the instance’s prediction changes when a feature changes.
 
-  load(file = str_c(outdir, "bt_model.Rdata"))
-
   if (!file.exists(str_c(outdir, "bt_ice.Rdata"))) {
     bt_ice <- list()
     for (feature in bt_imp_mse$results %>%
@@ -336,8 +332,6 @@ tdd_analysis <- function(tdd_index, factor_rm, transcript_selection, outdir, cpu
   }
 
   # compute interaction of any feature with others
-  load(file = str_c(outdir, "bt_model.Rdata"))
-
   if (!file.exists(str_c(outdir, "bt_interact.Rdata"))) {
     cl <- makePSOCKcluster(24)
     registerDoParallel(cl)
-- 
GitLab