summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Code/download_and_map.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Code/download_and_map.py b/Code/download_and_map.py
index ebc742d..a78409e 100644
--- a/Code/download_and_map.py
+++ b/Code/download_and_map.py
@@ -361,6 +361,14 @@ def kill_process(process_name):
print(f'{e}')
return False
+def reverse_lines(fname, fname2):
+ with open(fname) as f:
+ lines = f.readlines()
+
+ with open(fname2, 'w') as f2:
+ lines.reverse()
+ content = ''.join(lines)
+ f2.write(content)
## main
@@ -421,3 +429,4 @@ else:
write_download_log_file(DOWNLOADED_SRA_ID_LOG_FILE, '%s\n' % ('\n'.join(map_list)))
write_download_log_file(DOWNLOADED_SRA_ID_LOG_FILE, 'DONE at %s\n' % (curr_time))
+reverse_lines(DOWNLOADED_SRA_ID_LOG_FILE, os.path.splitext(DOWNLOADED_SRA_ID_LOG_FILE)[0] + '_reversed.txt')