Skip to content

Commit 6ca4dce

Browse files
committed
don't asume that hogmaps are sorted
1 parent cacbc3e commit 6ca4dce

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

FastOMA/_utils_roothog.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def resolve_singletons(rhogs_prots, hogmaps, conf):
342342
could_resolve = False
343343
for alt_mapping in prot_mappings[1:]:
344344
if float(alt_mapping.score) < conf.mergHOG_fscore_thresh:
345-
break
345+
continue
346346

347347
alt_rhog = extract_root_hog_id(alt_mapping.hogid)
348348

@@ -357,7 +357,7 @@ def resolve_singletons(rhogs_prots, hogmaps, conf):
357357
remained_count += 1
358358
for alt_mapping in prot_mappings[1:]:
359359
if float(alt_mapping.score) < conf.mergHOG_fscore_thresh:
360-
break
360+
continue
361361
singletons_remained[extract_root_hog_id(alt_mapping.hogid)].add((species, prot))
362362

363363
logger.info(f"Resolved {resolved_count} singleton HOGs based on omammer multi-hits.")
@@ -514,7 +514,7 @@ def find_rhog_candidate_pairs(hogmaps, rhogs_prots, conf_infer_roothogs): # rhog
514514
for prot_map in prot_maps: #
515515
# prot_map: HOGMapData record
516516
if float(prot_map.score) > conf_infer_roothogs.mergHOG_fscore_thresh:
517-
rhogid = prot_map.hogid.split(".")[0].split(":")[1]
517+
rhogid = extract_root_hog_id(prot_map.hogid)
518518
rhogs_size[rhogid] += 1
519519
rhogs.append((rhogid, float(prot_map.score)))
520520

0 commit comments

Comments
 (0)