Skip to content

Commit

Permalink
pairwise2: Convert substitution array to dict in dictionary_match (#3865
Browse files Browse the repository at this point in the history
)
  • Loading branch information
MarkusPiotrowski committed Feb 15, 2022
1 parent 93c44bd commit 4d37d81
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Bio/pairwise2.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@

from Bio import BiopythonWarning
from Bio import BiopythonDeprecationWarning
from Bio.Align import substitution_matrices

warnings.warn(
"Bio.pairwise2 has been deprecated, and we intend to remove it in a "
Expand Down Expand Up @@ -1282,6 +1283,8 @@ class dictionary_match:

def __init__(self, score_dict, symmetric=1):
"""Initialize the class."""
if isinstance(score_dict, substitution_matrices.Array):
score_dict = dict(score_dict) # Access to dict is much faster
self.score_dict = score_dict
self.symmetric = symmetric

Expand Down

0 comments on commit 4d37d81

Please sign in to comment.