Skip to content

Commit

Permalink
Keep only 100% identity matches
Browse files Browse the repository at this point in the history
  • Loading branch information
samuell committed Aug 13, 2024
1 parent 8bf9540 commit bdf94c7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions microSALT/utils/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,18 @@ def scrape_blast(self, type="", file_list=[]):
pass
ind += 1

hypo_filtered = []

for h in hypo:
if float(h["identity"]) == 100.0 and float(h["evalue"]) == 0.0:
hypo_filtered.append(h)

self.logger.info(
"{} {} hits were added after removing overlaps and duplicate hits".format(
len(hypo), type
len(hypo_filtered), type
)
)
for hit in hypo:
for hit in hypo_filtered:
self.logger.debug(
"Kept {}:{} with span {} and id {}".format(
hit.get("loci"),
Expand All @@ -438,7 +444,7 @@ def scrape_blast(self, type="", file_list=[]):
self.name, str(e)
)
)
return hypo
return hypo_filtered

def load_resistances(self):
"""Legacy function, loads common resistance names for genes from notes file"""
Expand Down

0 comments on commit bdf94c7

Please sign in to comment.