Skip to content

Commit 90d7939

Browse files
committed
Ignore rmtree errors and log when results are written #298
1 parent 41b8efd commit 90d7939

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

lib/assemblers/base.py

+8
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ def write_filtered_contigs(self, prefix):
224224
self.state['cxn'],
225225
self.args['bit_score'],
226226
self.args['contig_length'])
227+
228+
self.log.info('Writing {} filtered contigs after iteration {}'.format(
229+
count, self.state['iteration']))
230+
227231
if not count:
228232
return
229233

@@ -241,6 +245,10 @@ def write_filtered_contigs(self, prefix):
241245
def write_all_contigs(self, prefix):
242246
"""Write all contigs to a final output file."""
243247
count = db_atram.all_assembled_contigs_count(self.state['cxn'])
248+
249+
self.log.info('{} total contigs after iteration {}'.format(
250+
count, self.state['iteration']))
251+
244252
if not count:
245253
return
246254

lib/assemblers/none.py

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def __init__(self, args, cxn, log):
1515

1616
def write_final_output(self, blast_db, query):
1717
"""Output this file if we are not assembling the contigs."""
18+
self.log.info('Writing blast hits.')
19+
1820
prefix = self.final_output_prefix(blast_db, query)
1921

2022
file_name = '{}.fasta'.format(prefix)

lib/util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def make_temp_dir(where=None, prefix=None, keep=False):
5555
yield temp_dir
5656
finally:
5757
if not keep or not where:
58-
rmtree(temp_dir)
58+
rmtree(temp_dir, ignore_errors=True)
5959

6060

6161
@contextmanager

0 commit comments

Comments
 (0)