Commit 19f0e9ba authored by Mikaël Salson's avatar Mikaël Salson

pear: Remove temporary results that take lots of space.

Those files could quickly saturate disk space
parent 44299179
......@@ -720,6 +720,9 @@ def run_pre_process(pre_process_id, sequence_file_id, clean_before=True, clean_a
log_file.close()
for l in open(out_log):
print l,
# Remove data file from disk to save space (it is now saved elsewhere)
os.remove(filepath)
if clean_after:
clean_cmd = "rm -rf " + out_folder
......
......@@ -16,6 +16,7 @@ parser.add_argument("output_file", help="output file")
parser.add_argument("-r1", "--keep_r1", help="keep unmerged reverse reads", action="store_true")
parser.add_argument("-r2", "--keep_r2", help="keep unmerged forward reads", action="store_true")
parser.add_argument("-p", "--pear-options", help="additional options passed to PEAR", default="")
parser.add_argument("-k", "--keep", help="keep temporary files (may take lots of disk space in the end)", action = 'store_true')
args = parser.parse_args()
......@@ -43,6 +44,10 @@ try :
if (args.keep_r2):
with open(f_out+'.unassembled.forward.fastq', 'rb') as f3:
shutil.copyfileobj(f3, outFile)
if not args.keep:
os.remove(f_out+'.assembled.fastq')
os.remove(f_out+'.unassembled.reverse.fastq')
os.remove(f_out+'.unassembled.forward.fastq')
except IOError :
os.remove(f_out)
raise IOError
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment