Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
schwede
openstructure
Commits
fa7a8d57
Commit
fa7a8d57
authored
14 years ago
by
Marco Biasini
Browse files
Options
Downloads
Patches
Plain Diff
added AlignmentFromChainView
parent
05b70881
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/seq/alg/doc/seqalg.rst
+4
-2
4 additions, 2 deletions
modules/seq/alg/doc/seqalg.rst
modules/seq/alg/pymod/__init__.py
+36
-1
36 additions, 1 deletion
modules/seq/alg/pymod/__init__.py
modules/seq/base/pymod/export_sequence.cc
+1
-0
1 addition, 0 deletions
modules/seq/base/pymod/export_sequence.cc
with
41 additions
and
3 deletions
modules/seq/alg/doc/seqalg.rst
+
4
−
2
View file @
fa7a8d57
:mod:`
mol
.alg <ost.seq.alg>` -- Algorithms for Sequences
:mod:`
seq
.alg <ost.seq.alg>` -- Algorithms for Sequences
================================================================================
.. currentmodule:: ost.seq.alg
...
...
@@ -30,4 +30,6 @@
considered as aligned. There is no information in the pairwise alignment to
guide the merging, the result is undefined.
.. autofunction:: AlignToSEQRES
\ No newline at end of file
.. autofunction:: AlignToSEQRES
.. autofunction:: AlignmentFromChainView
\ No newline at end of file
This diff is collapsed.
Click to expand it.
modules/seq/alg/pymod/__init__.py
+
36
−
1
View file @
fa7a8d57
...
...
@@ -39,5 +39,40 @@ def AlignToSEQRES(chain, seqres):
return
seq
.
CreateAlignment
(
seq
.
CreateSequence
(
'
SEQRES
'
,
str
(
seqres
)),
seq
.
CreateSequence
(
'
atoms
'
,
aln_seq
))
def
AlignmentFromChainView
(
chain
,
handle_seq_name
=
'
handle
'
,
view_seq_name
=
'
view
'
):
"""
Creates and returns the sequence alignment of the given chain view to the
chain handle. The alignment contains two sequences, the first containing all
non-ligand peptide-linking residues, the second containing all non-ligand
peptide-linking residues that are part of the view.
:param chain: A valid chain
:type chain: :class:`~ost.mol.ChainView`
:param handle_seq_name: Name of the handle sequence in the output alignment
:param view_seq_name: Name of the view sequence in the output alignment
:returns: The alignment
:rtype: :class:`~ost.seq.AlignmentHandle`
"""
from
ost
import
seq
v0
=
chain
.
handle
.
Select
(
'
ligand=false and peptide=true
'
)
v1
=
chain
.
Select
(
'
ligand=false and peptide=true
'
)
s0
=
seq
.
CreateSequence
(
handle_seq_name
,
''
)
s1
=
seq
.
CreateSequence
(
view_seq_name
,
''
)
s0
.
AttachView
(
v0
)
s1
.
AttachView
(
v1
)
res0
=
v0
.
residues
res1
=
v1
.
residues
idx0
,
idx1
=
(
0
,
0
)
while
idx0
<
len
(
res0
):
s0
.
Append
(
res0
[
idx0
].
one_letter_code
)
if
idx1
<
len
(
res1
)
and
res1
[
idx1
].
handle
==
res0
[
idx0
].
handle
:
s1
.
Append
(
res1
[
idx1
].
one_letter_code
)
idx1
+=
1
else
:
s1
.
Append
(
'
-
'
)
idx0
+=
1
return
seq
.
CreateAlignment
(
s0
,
s1
)
This diff is collapsed.
Click to expand it.
modules/seq/base/pymod/export_sequence.cc
+
1
−
0
View file @
fa7a8d57
...
...
@@ -256,6 +256,7 @@ void export_sequence()
.
def
(
"SetOffset"
,
&
SequenceHandle
::
SetOffset
)
.
def
(
"AttachView"
,
attach_one
)
.
def
(
"AttachView"
,
attach_two
)
.
def
(
"Append"
,
&
SequenceHandle
::
Append
)
.
def
(
"SetString"
,
&
SequenceHandle
::
SetString
)
.
add_property
(
"string"
,
make_function
(
&
SequenceHandle
::
GetString
,
...
...
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