Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BIOINF588
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Etienne MORICE
BIOINF588
Commits
c5ffa34a
Verified
Commit
c5ffa34a
authored
6 years ago
by
Etienne MORICE
Browse files
Options
Downloads
Patches
Plain Diff
Changed dtype to int32 and added plot
parent
5e447d8a
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
.gitlab-ci.yml
+3
-0
3 additions, 0 deletions
.gitlab-ci.yml
alignementseq.py
+1
-1
1 addition, 1 deletion
alignementseq.py
alignementseq_tests.py
+13
-1
13 additions, 1 deletion
alignementseq_tests.py
with
18 additions
and
2 deletions
.gitignore
+
1
−
0
View file @
c5ffa34a
...
...
@@ -3,3 +3,4 @@ balibase/
__pycache__/
balibase.zip
atlas
timings.png
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
+
3
−
0
View file @
c5ffa34a
...
...
@@ -11,3 +11,6 @@ test:
test_performance
:
script
:
-
python3 -m unittest alignementseq_tests.PerformanceTestCase
artifacts
:
paths
:
-
timings.png
This diff is collapsed.
Click to expand it.
alignementseq.py
+
1
−
1
View file @
c5ffa34a
...
...
@@ -159,7 +159,7 @@ def vec_align(seq1, seq2, mat=dict_to_weight(Bio.SubsMat.MatrixInfo.blosum62), g
x
=
np
.
array
(
list
(
ord
(
c
)
-
ord
(
'
A
'
)
for
c
in
seq1
.
seq
))
y
=
np
.
array
(
list
(
ord
(
c
)
-
ord
(
'
A
'
)
for
c
in
seq2
.
seq
))
mat
=
mat
.
flatten
()
S
=
[
np
.
zeros
(
min
(
s
,
n
,
m
,
n
+
m
-
s
)
+
1
,
dtype
=
np
.
int
)
for
s
in
range
(
n
+
m
+
1
)
]
S
=
[
np
.
zeros
(
min
(
s
,
n
,
m
,
n
+
m
-
s
)
+
1
,
dtype
=
np
.
int
32
)
for
s
in
range
(
n
+
m
+
1
)
]
S
[
0
][
0
]
=
0
S
[
1
][
0
]
=
gap
...
...
This diff is collapsed.
Click to expand it.
alignementseq_tests.py
+
13
−
1
View file @
c5ffa34a
...
...
@@ -8,6 +8,7 @@ import warnings
import
timeit
import
multiprocessing
import
pandas
as
pd
import
matplotlib.pyplot
import
Bio.SeqIO
import
Bio.pairwise2
...
...
@@ -144,7 +145,8 @@ class PerformanceTestCase(AlignmentSeqTestCase):
from
alignementseq
import
align
,
vec_align
methods
=
(
vec_align
,
align
)
times
=
pd
.
DataFrame
(
columns
=
(
"
length1
"
,
"
length2
"
,
"
method
"
,
"
time
"
))
times
=
pd
.
DataFrame
(
columns
=
(
"
length1
"
,
"
length2
"
,
"
method
"
,
"
time
"
),
dtype
=
float
)
for
s1
,
s2
,
filename
in
self
.
get_dataset_heads
():
for
method
in
methods
:
def
to_time
():
...
...
@@ -153,7 +155,17 @@ class PerformanceTestCase(AlignmentSeqTestCase):
times
.
loc
[
len
(
times
)]
=
(
len
(
s1
.
seq
),
len
(
s2
.
seq
),
method
.
__name__
,
t
)
times
[
'
length_product
'
]
=
times
.
length1
*
times
.
length2
print
(
times
)
ax
=
None
cmap
=
matplotlib
.
cm
.
inferno
colors
=
[
cmap
(
i
/
2
)
for
i
in
range
(
2
)
]
for
im
,
method
in
enumerate
(
methods
):
ax
=
times
.
loc
[
times
.
method
==
method
.
__name__
].
plot
.
scatter
(
'
length_product
'
,
'
time
'
,
c
=
colors
[
im
],
label
=
method
.
__name__
,
ax
=
ax
)
matplotlib
.
pyplot
.
savefig
(
"
timings.png
"
)
def
test_titin
(
self
):
from
alignementseq
import
align
,
vec_align
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment