Skip to content

Commit

Permalink
<sigh> avoid calculating matched_query_mh until end
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Jun 20, 2021
1 parent 69095a4 commit 00caa41
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/sourmash/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,15 +1229,14 @@ def prefetch(args):
notify(f"saved {matches_out.count} matches to CSV file '{args.output}'")
csvout_fp.close()

print('XXX converting to mutable')
matched_query_mh = query_mh.to_mutable()
print('XXX running remove_many')
matched_query_mh.remove_many(noident_mh)
notify(f"of {len(query_mh)} distinct query hashes, {len(matched_query_mh)} were found in matches above threshold.")
matched_num = len(query_mh) - len(noident_mh)
notify(f"of {len(query_mh)} distinct query hashes, {matched_num} were found in matches above threshold.")
notify(f"a total of {len(noident_mh)} query hashes remain unmatched.")

if args.save_matching_hashes:
filename = args.save_matching_hashes
matched_query_mh = query_mh.to_mutable()
matched_query_mh.remove_many(noident_mh)
notify(f"saving {len(matched_query_mh)} matched hashes to '{filename}'")
ss = sig.SourmashSignature(matched_query_mh)
with open(filename, "wt") as fp:
Expand Down

0 comments on commit 00caa41

Please sign in to comment.