From b74af7f6a13e3cca4cab4758592bf6ef3c97f428 Mon Sep 17 00:00:00 2001 From: anastasiia Date: Wed, 19 Dec 2018 13:28:40 +0100 Subject: [PATCH 1/2] changing the separator in the last line --- bin/footprints_extraction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/footprints_extraction.py b/bin/footprints_extraction.py index bf43de2..e2c1fee 100644 --- a/bin/footprints_extraction.py +++ b/bin/footprints_extraction.py @@ -294,7 +294,7 @@ def write_to_bed_file(all_footprints, sorted_output_file_name): #write each footprint line for line to the output file for footprint in all_footprints: - output_file.write('\t'.join([footprint[1]['chromosom'], str(footprint[1]['start']), str(footprint[1]['end']), footprint[0], str(round(footprint[1]['score'], 6)), str(footprint[1]['len']), str(footprint[1]['max_pos']), '\t'.join(footprint[1]['bonus'])]) + '\n') + output_file.write('\t'.join([footprint[1]['chromosom'], str(footprint[1]['start']), str(footprint[1]['end']), footprint[0], str(round(footprint[1]['score'], 6)), str(footprint[1]['len']), str(footprint[1]['max_pos']), ';'.join(footprint[1]['bonus'])]) + '\n') output_file.close() From 117ab504898f3ccd3f9f235a025a20e5cbf12f2c Mon Sep 17 00:00:00 2001 From: anastasiia Date: Wed, 19 Dec 2018 13:30:55 +0100 Subject: [PATCH 2/2] adding a column name strand containing always . --- bin/footprints_extraction.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/footprints_extraction.py b/bin/footprints_extraction.py index e2c1fee..3e73eb5 100644 --- a/bin/footprints_extraction.py +++ b/bin/footprints_extraction.py @@ -284,7 +284,7 @@ def find_peaks_from_bw(bed_dictionary, bw_file, window_length, step, percentage) def write_to_bed_file(all_footprints, sorted_output_file_name): output_file_name = "not_sorted_" + sorted_output_file_name #save in the working directory - header = ["#chr", "start", "end", "name", "score", "len", "max_pos", "bonus_info"] #a header to know what is in the columns + header = ["#chr", "start", "end", "name", "score", "strand", "len", "max_pos", "bonus_info"] #a header to know what is in the columns output_file = open(output_file_name, 'w') #open a file to write @@ -294,7 +294,7 @@ def write_to_bed_file(all_footprints, sorted_output_file_name): #write each footprint line for line to the output file for footprint in all_footprints: - output_file.write('\t'.join([footprint[1]['chromosom'], str(footprint[1]['start']), str(footprint[1]['end']), footprint[0], str(round(footprint[1]['score'], 6)), str(footprint[1]['len']), str(footprint[1]['max_pos']), ';'.join(footprint[1]['bonus'])]) + '\n') + output_file.write('\t'.join([footprint[1]['chromosom'], str(footprint[1]['start']), str(footprint[1]['end']), footprint[0], str(round(footprint[1]['score'], 6)), '.', str(footprint[1]['len']), str(footprint[1]['max_pos']), ';'.join(footprint[1]['bonus'])]) + '\n') output_file.close()