From 2904ac2494db58d3d76e8486ce14472cef1305b7 Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Thu, 26 Mar 2020 15:50:04 +0100
Subject: [PATCH] src/db_utils/interactions/bedtools.py: creation of the
 required directory if they don't exist at the beginning of function
 'main_bedtools'

---
 src/db_utils/interactions/bedtools.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/db_utils/interactions/bedtools.py b/src/db_utils/interactions/bedtools.py
index 69e9a914..82740ad5 100644
--- a/src/db_utils/interactions/bedtools.py
+++ b/src/db_utils/interactions/bedtools.py
@@ -72,6 +72,9 @@ def main_bedtools() -> None:
     Launch bedtools slop and bedtools intersect commands for exons and genes.
 
     """
+    Config.exon_output.parent.mkdir(exist_ok=True, parents=True)
+    Config.pet_vs_exon_output.mkdir(exist_ok=True, parents=True)
+    Config.pet_vs_gene_output.mkdir(exist_ok=True, parents=True)
     launch_bedtools_slop(Config.exon, Config.exon_window, Config.exon_output)
     launch_bedtools_slop(Config.gene, Config.gene_window, Config.gene_output)
     launch_bedtools_intersect(Config.exon_output,
-- 
GitLab