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
8784e3ac
Commit
8784e3ac
authored
2 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
lDDT: enable iterative SVD superposition
parent
e9d8c8be
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
modules/mol/alg/pymod/chain_mapping.py
+27
-5
27 additions, 5 deletions
modules/mol/alg/pymod/chain_mapping.py
with
27 additions
and
5 deletions
modules/mol/alg/pymod/chain_mapping.py
+
27
−
5
View file @
8784e3ac
...
@@ -491,7 +491,8 @@ class ChainMapper:
...
@@ -491,7 +491,8 @@ class ChainMapper:
return
_BlockGreedy
(
the_greed
,
block_seed_size
,
block_n_mdl_chains
)
return
_BlockGreedy
(
the_greed
,
block_seed_size
,
block_n_mdl_chains
)
def
GetRigidMapping
(
self
,
model
,
single_chain_gdtts_thresh
=
0.4
,
def
GetRigidMapping
(
self
,
model
,
single_chain_gdtts_thresh
=
0.4
,
subsampling
=
None
,
first_complete
=
False
):
subsampling
=
None
,
first_complete
=
False
,
iterative_superposition
=
False
):
"""
Identify chain mapping based on rigid superposition
"""
Identify chain mapping based on rigid superposition
Superposition and scoring is based on CA/C3
'
positions which are present
Superposition and scoring is based on CA/C3
'
positions which are present
...
@@ -523,6 +524,12 @@ class ChainMapper:
...
@@ -523,6 +524,12 @@ class ChainMapper:
mapping that covers all model chains or all
mapping that covers all model chains or all
target chains.
target chains.
:type first_complete: :class:`bool`
:type first_complete: :class:`bool`
:param iterative_superposition: Whether to compute inital
transformations with
:func:`ost.mol.alg.IterativeSuperposeSVD`
as oposed to
:func:`ost.mol.alg.SuperposeSVD`
:type iterative_superposition: :class:`bool`
:returns: A :class:`list` of :class:`list` that reflects
:returns: A :class:`list` of :class:`list` that reflects
:attr:`~chem_groups` but is filled with the respective model
:attr:`~chem_groups` but is filled with the respective model
chains. Target chains without mapped model chains are set to
chains. Target chains without mapped model chains are set to
...
@@ -545,7 +552,15 @@ class ChainMapper:
...
@@ -545,7 +552,15 @@ class ChainMapper:
for
t_pos
,
t
in
zip
(
trg_pos
,
trg_chains
):
for
t_pos
,
t
in
zip
(
trg_pos
,
trg_chains
):
for
m_pos
,
m
in
zip
(
mdl_pos
,
mdl_chains
):
for
m_pos
,
m
in
zip
(
mdl_pos
,
mdl_chains
):
if
len
(
t_pos
)
>=
3
and
len
(
m_pos
)
>=
3
:
if
len
(
t_pos
)
>=
3
and
len
(
m_pos
)
>=
3
:
res
=
mol
.
alg
.
SuperposeSVD
(
m_pos
,
t_pos
)
if
iterative_superposition
:
try
:
res
=
mol
.
alg
.
IterativeSuperposeSVD
(
m_pos
,
t_pos
)
except
:
# potentially fails if an iteration tries to
# superpose with < 3 positions => skip
continue
else
:
res
=
mol
.
alg
.
SuperposeSVD
(
m_pos
,
t_pos
)
t_m_pos
=
geom
.
Vec3List
(
m_pos
)
t_m_pos
=
geom
.
Vec3List
(
m_pos
)
t_m_pos
.
ApplyTransform
(
res
.
transformation
)
t_m_pos
.
ApplyTransform
(
res
.
transformation
)
gdt
=
t_pos
.
GetGDTTS
(
t_m_pos
)
gdt
=
t_pos
.
GetGDTTS
(
t_m_pos
)
...
@@ -1625,9 +1640,16 @@ def _GetRefPos(trg, mdl, trg_msas, mdl_alns, max_pos = None):
...
@@ -1625,9 +1640,16 @@ def _GetRefPos(trg, mdl, trg_msas, mdl_alns, max_pos = None):
for
trg_msa
,
mdl_msa
in
zip
(
trg_msas
,
mdl_msas
):
for
trg_msa
,
mdl_msa
in
zip
(
trg_msas
,
mdl_msas
):
# make sure they have the same ref sequence (should be a given...)
if
mdl_msa
.
GetCount
()
>
0
:
assert
(
trg_msa
.
GetSequence
(
0
).
GetGaplessString
()
==
\
# make sure they have the same ref sequence (should be a given...)
mdl_msa
.
GetSequence
(
0
).
GetGaplessString
())
assert
(
trg_msa
.
GetSequence
(
0
).
GetGaplessString
()
==
\
mdl_msa
.
GetSequence
(
0
).
GetGaplessString
())
else
:
# if mdl_msa is empty, i.e. no model chain maps to the chem group
# represented by trg_msa, we just continue. The result will be
# empty position lists added to trg_pos and mdl_pos.
pass
# check which columns in MSAs are fully covered (indices relative to
# check which columns in MSAs are fully covered (indices relative to
# first sequence)
# first sequence)
...
...
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