Skip to content

Commit

Permalink
Fix #149: Make regex more specific to not match other genes with same…
Browse files Browse the repository at this point in the history
… prefix
  • Loading branch information
samuell committed Jul 11, 2024
1 parent fc763fe commit c9ee900
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions microSALT/utils/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,9 @@ def scrape_blast(self, type="", file_list=[]):
].capitalize()
#Ignores reference name and finds relevant resFinder entry

#FIXME: Needs to match again a _ so as not to be too promiscuous (See #149)
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:
#FIXME: Needs to match again a _ so as not to be too promiscuous (See #149)
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:
Expand Down

0 comments on commit c9ee900

Please sign in to comment.