From 5214d2e5f0ad85281f0db2e8aa6f5b087baa1edb Mon Sep 17 00:00:00 2001
From: Laurent Modolo <laurent.modolo@ens-lyon.fr>
Date: Thu, 12 Oct 2023 10:00:20 +0200
Subject: [PATCH] update boot script to use 1e-3 of the reads for the fit

---
 src/bin/kmerclust_boot.R | 2 +-
 src/bin/kmerclust_plot.R | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/bin/kmerclust_boot.R b/src/bin/kmerclust_boot.R
index eb2e344..1857219 100644
--- a/src/bin/kmerclust_boot.R
+++ b/src/bin/kmerclust_boot.R
@@ -5,7 +5,7 @@ load(file = paste0(args[1], ".Rdata"))
 res <- count %>%
   dplyr::select(count_m, count_f) %>%
   as.matrix() %>%
-  poiss_compare_models(count, nboot = as.numeric(args[2]) * 2, bootsize = 1, core = as.numeric(args[2]))
+  poiss_compare_models(count, nboot = as.numeric(args[2]) * 2, frac = 1e-3 bootsize = 1, core = as.numeric(args[2]))
 save(res, file = paste0(args[1], "_boot_", args[3], ".Rdata"))
 
 
diff --git a/src/bin/kmerclust_plot.R b/src/bin/kmerclust_plot.R
index 5f50f46..5a62bbe 100644
--- a/src/bin/kmerclust_plot.R
+++ b/src/bin/kmerclust_plot.R
@@ -7,11 +7,13 @@ print(args)
 load(file = paste0(args[1], "_boot.Rdata"))
 
 print(res)
-res %>%
-  ggplot(aes(x = name, y = BIC)) +
+res %>% 
+  pivot_longer(cols = -c("name"), names_to = "metric") %>% 
+  ggplot(aes(x =  name, y = value)) +
   geom_violin() +
+  facet_wrap(~metric) +
   theme_bw()
-ggsave(paste0(args[1], "_BIC.pdf"))
+ggsave(paste0(args[1], "_BIC_loglik.pdf"))
 
 load(file = paste0(args[1], ".Rdata"))
 count %>%
-- 
GitLab