From 264cb2a386015f7a906ec1acd3ebf683b0e52c20 Mon Sep 17 00:00:00 2001 From: Samuel Lampa Date: Wed, 26 Jun 2024 09:58:22 +0200 Subject: [PATCH] Fix #149: Avoid promiscuous matching of gene name This needs to be follow up with additional checks The same change might need to be done for other matching as well. --- microSALT/utils/scraper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/microSALT/utils/scraper.py b/microSALT/utils/scraper.py index 0743f413..847a5942 100644 --- a/microSALT/utils/scraper.py +++ b/microSALT/utils/scraper.py @@ -257,9 +257,9 @@ def scrape_blast(self, type="", file_list=[]): ].capitalize() #Ignores reference name and finds relevant resFinder entry - padder = [x for x in locilengths.keys() if x.startswith('>{}'.format(partials[1]))] + padder = [x for x in locilengths.keys() if x.startswith('>{}_'.format(partials[1]))] if len(padder) == 0: - padder = [x for x in locilengths.keys() if x.startswith('>{}'.format(partials[1][:-1]))] + padder = [x for x in locilengths.keys() if x.startswith('>{}_'.format(partials[1][:-1]))] try: padder = padder[0] except IndexError as e: