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
cab18201
Verified
Commit
cab18201
authored
6 years ago
by
Etienne MORICE
Browse files
Options
Downloads
Patches
Plain Diff
Added comparison with ref + fixed in-place return
parent
03c67850
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
alignementseq.py
+16
-3
16 additions, 3 deletions
alignementseq.py
with
16 additions
and
3 deletions
alignementseq.py
+
16
−
3
View file @
cab18201
...
@@ -11,6 +11,8 @@ import Bio.SeqIO
...
@@ -11,6 +11,8 @@ import Bio.SeqIO
from
Bio.SeqRecord
import
SeqRecord
from
Bio.SeqRecord
import
SeqRecord
from
Bio.Seq
import
Seq
from
Bio.Seq
import
Seq
import
Bio.pairwise2
seqs
=
[]
seqs
=
[]
handle
=
open
(
"
balibase/RV11.unaligned/BBS11001.fasta
"
)
handle
=
open
(
"
balibase/RV11.unaligned/BBS11001.fasta
"
)
for
seq
in
Bio
.
SeqIO
.
parse
(
handle
,
"
fasta
"
):
for
seq
in
Bio
.
SeqIO
.
parse
(
handle
,
"
fasta
"
):
...
@@ -219,9 +221,11 @@ def align2steps(seq1, seq2, d=8, e=4):
...
@@ -219,9 +221,11 @@ def align2steps(seq1, seq2, d=8, e=4):
j
-=
1
j
-=
1
alx
=
alx
[::
-
1
]
alx
=
alx
[::
-
1
]
aly
=
aly
[::
-
1
]
aly
=
aly
[::
-
1
]
seq1
.
seq
=
Seq
(
alx
)
aseq1
=
SeqRecord
(
seq1
)
seq2
.
seq
=
Seq
(
aly
)
aseq1
.
seq
=
Seq
(
alx
)
return
bestScore
,
seq1
,
seq2
aseq2
=
SeqRecord
(
seq2
)
aseq2
.
seq
=
Seq
(
aly
)
return
bestScore
,
aseq1
,
aseq2
def
test
():
def
test
():
# print(align("chat", "cat"))
# print(align("chat", "cat"))
...
@@ -233,4 +237,13 @@ def test():
...
@@ -233,4 +237,13 @@ def test():
print
(
y
.
seq
)
print
(
y
.
seq
)
with
open
(
"
balibase/us/1.fasta
"
,
"
w
"
)
as
fd
:
with
open
(
"
balibase/us/1.fasta
"
,
"
w
"
)
as
fd
:
Bio
.
SeqIO
.
write
((
x
,
y
),
fd
,
"
fasta
"
)
Bio
.
SeqIO
.
write
((
x
,
y
),
fd
,
"
fasta
"
)
print
(
"
Ref:
"
)
ref
=
Bio
.
pairwise2
.
align
.
globalds
(
seqs
[
0
].
seq
,
seqs
[
1
].
seq
,
Bio
.
SubsMat
.
MatrixInfo
.
blosum62
,
-
8
,
-
4
)
for
x
,
y
,
s
,
*
_
in
ref
:
print
(
s
)
print
(
x
)
print
(
y
)
test
()
test
()
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