Skip to content

Commit

Permalink
Prune dist matrix only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlees committed Nov 11, 2020
1 parent c519f58 commit 2aa2799
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PopPUNK/reference_pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ def main():
# Prune distances
nodes_to_remove = set(range(len(refList))).difference(reference_indices)
names_to_remove = [refList[n] for n in nodes_to_remove]
prune_distance_matrix(refList, names_to_remove, distMat,
args.output + "/" + os.path.basename(args.output) + ".dists")

# 'Resketch'
if len(nodes_to_remove) > 0:
prune_distance_matrix(refList, names_to_remove, distMat,
args.output + "/" + os.path.basename(args.output) + ".dists")

removeFromDB(args.ref_db, args.output, set(refList) - set(reference_names))

db_outfile = args.output + "/" + os.path.basename(args.output) + ".tmp.h5"
Expand Down

0 comments on commit 2aa2799

Please sign in to comment.