Skip to content
Snippets Groups Projects
Verified Commit 8606ce6c authored by Etienne MORICE's avatar Etienne MORICE
Browse files

Added the biopython implementation to the timing benchmark.

parent 983d8229
No related branches found
No related tags found
No related merge requests found
......@@ -145,8 +145,13 @@ class PerformanceTestCase(AlignmentSeqTestCase):
def test_performance(self):
from alignementseq import align, vec_align
def biopython_align(seq1, seq2):
return Bio.pairwise2.align.globalds(
seq1.seq, seq2.seq, blosum62, -8, -8,
one_alignment_only=True)[0]
methods = (vec_align, align)
methods = (vec_align, align, biopython_align)
times = pd.DataFrame(columns=("length1", "length2", "method", "time"),
dtype=float)
for s1, s2, filename in self.get_dataset_heads():
......@@ -162,7 +167,7 @@ class PerformanceTestCase(AlignmentSeqTestCase):
ax = None
cmap = matplotlib.cm.inferno
colors = [ cmap(i/2) for i in range(2) ]
colors = [ cmap(i/len(methods)) for i in range(len(methods)) ]
for im, method in enumerate(methods):
ax = times.loc[times.method == method.__name__].plot.scatter(
'length_product', 'time', c=colors[im],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment