Skip to content

Commit

Permalink
Merge pull request #8 from MistyField/master
Browse files Browse the repository at this point in the history
fix: change the encoding into utf-8
  • Loading branch information
Robaina authored Sep 15, 2023
2 parents 75d3a53 + 4e09fa0 commit 7137aa0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/brendapyrser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ class BRENDA:
"""
Provides methods to parse the BRENDA database (https://www.brenda-enzymes.org/)
"""

def __init__(self, path_to_database):
with open(path_to_database, encoding="iso-8859-1") as file:
with open(path_to_database, encoding="utf-8") as file:
self.__data = file.read()
self.__ec_numbers = [
ec.group(1) for ec in re.finditer("(?<=ID\\t)(.*)(?=\\n)", self.__data)
Expand Down Expand Up @@ -262,8 +261,8 @@ def getReferencesDict(self):
lines = self.__getDataLines("RF")
for line in lines:
line = self.__removeTabs(line)
line, refs = self.__extractDataField(line, ("<", ">"))
references[refs[0]] = line
line, refs = self.__extractDataField(line, ('<', '>'))
references[refs] = line
return references

def printReactionSummary(self):
Expand Down

0 comments on commit 7137aa0

Please sign in to comment.