Skip to content

Commit

Permalink
Respect high --keep setting
Browse files Browse the repository at this point in the history
  • Loading branch information
rrwick committed Sep 28, 2017
1 parent 4b044dc commit 76445d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions unicycler/spades_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_best_spades_graph(short1, short2, short_unpaired, out_dir, read_depth_fi
reads = (short1, short2, short_unpaired)
else:
reads = spades_read_correction(short1, short2, short_unpaired, spades_dir, threads,
spades_path)
spades_path, keep)
kmer_range = get_kmer_range(short1, short2, short_unpaired, spades_dir, kmer_count, min_k_frac,
max_k_frac)
assem_dir = os.path.join(spades_dir, 'assembly')
Expand Down Expand Up @@ -200,7 +200,7 @@ def get_best_spades_graph(short1, short2, short_unpaired, out_dir, read_depth_fi
return assembly_graph


def spades_read_correction(short1, short2, unpaired, spades_dir, threads, spades_path):
def spades_read_correction(short1, short2, unpaired, spades_dir, threads, spades_path, keep):
"""
This runs SPAdes with the --only-error-correction option.
"""
Expand Down Expand Up @@ -309,7 +309,8 @@ def spades_read_correction(short1, short2, unpaired, spades_dir, threads, spades
if using_unpaired_reads and not corrected_u_exists:
quit_with_error('SPAdes read error correction failed. '
'See spades_assembly/read_correction/spades.log for more info.')
shutil.rmtree(read_correction_dir, ignore_errors=True)
if keep < 3:
shutil.rmtree(read_correction_dir, ignore_errors=True)

if not using_paired_reads:
corrected_1 = None
Expand Down
1 change: 0 additions & 1 deletion unicycler/string_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def remove_branching_paths(self):
else:
log.log('No links needed removal', verbosity=2)


def segment_leads_directly_to_contig_in_both_directions(self, seg_name):
if self.segments[seg_name].contig:
return True
Expand Down

0 comments on commit 76445d3

Please sign in to comment.