Skip to content

Commit

Permalink
Merge pull request #56 from phac-nml/mob-3.0.0
Browse files Browse the repository at this point in the history
fixed issue with mismatched mash sketch and clusters.txt
  • Loading branch information
jrober84 authored May 20, 2020
2 parents 4cb30e5 + f3ff819 commit 39cd181
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mob_suite/mob_typer.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ def main():
record['total_length'] = fastaSeqStats['size']
record['num_contigs'] = fastaSeqStats['num_seq']
record['gc'] = fastaSeqStats['gc_content']
record['mash_nearest_neighbor'] = '-'
record['mash_neighbor_distance'] = 1
record['primary_cluster_id'] = '-'
record['secondary_cluster_id'] = '-'
record['mash_neighbor_identification'] = '-'

for seq_id in mash_results:
distances = OrderedDict(sorted(mash_results[seq_id].items(), key=itemgetter(1), reverse=False))
Expand Down Expand Up @@ -475,7 +480,7 @@ def main():
record['orit_type(s)'] = bio_markers[3]['types']
record['orit_accession(s)'] = bio_markers[3]['acs']

if record['mash_neighbor_distance'] <= primary_distance:
if (isinstance(record['mash_neighbor_distance'],float) or isinstance(record['mash_neighbor_distance'],int)) and record['mash_neighbor_distance'] <= primary_distance:
mob_cluster_id = record['primary_cluster_id']
else:
mob_cluster_id = None
Expand Down

0 comments on commit 39cd181

Please sign in to comment.