Skip to content

Commit

Permalink
fixing the bug with the output directory name
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiia authored Jan 2, 2019
1 parent e224922 commit 36d7756
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/footprints_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,15 @@ def find_peaks_from_bw(bed_dictionary, bw_file, window_length, step, percentage)
#as input the dictionary with all footprints and the name for the output file are needed
#the function outputs first an unsorted file and finally sorts it, removing the unsorted one
def write_to_bed_file(all_footprints, sorted_output_file_name):
#save the output file in the working directory
output_file_name = "not_sorted_" + 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)

#make sure the file is in .bed format
output_name = "not_sorted_" + os.path.splitext(os.path.basename(sorted_output_file_name))[0] + ".bed"

#save the output file in the working directory or in the directory provided by the user
output_file_name = (os.path.join(output_directory, output_name))

#a header to know what is in the columns
header = ["#chr", "start", "end", "name", "score", "strand", "len", "max_pos", "bonus_info"]
Expand Down

0 comments on commit 36d7756

Please sign in to comment.