From 18a4fb5cfc61cdd0c3163c21558ab65cc2d27d4e Mon Sep 17 00:00:00 2001 From: anastasiia Date: Fri, 4 Jan 2019 15:30:37 +0100 Subject: [PATCH] adding a check if the directory was passed by the user --- bin/1.1_footprint_extraction/footprints_extraction.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/1.1_footprint_extraction/footprints_extraction.py b/bin/1.1_footprint_extraction/footprints_extraction.py index 1ce0c9f..fae040e 100644 --- a/bin/1.1_footprint_extraction/footprints_extraction.py +++ b/bin/1.1_footprint_extraction/footprints_extraction.py @@ -317,8 +317,9 @@ def write_to_bed_file(all_footprints, sorted_output_file_name): #extract the name of directory where we want to save the file output_directory = os.path.dirname(sorted_output_file_name) - #check if this directory exists, and if not, create one - check_directory(output_directory) + #check if there is a directory provided + if output_directory: + check_directory(output_directory) #make sure the file is in .bed format output_name = "not_sorted_" + os.path.splitext(os.path.basename(sorted_output_file_name))[0] + ".bed"