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
1cde4be1
Commit
1cde4be1
authored
3 years ago
by
Studer Gabriel
Browse files
Options
Downloads
Patches
Plain Diff
lDDT: make matching residue names in model/target optional (on by default)
parent
656b852b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/mol/alg/pymod/lddt.py
+6
-3
6 additions, 3 deletions
modules/mol/alg/pymod/lddt.py
modules/mol/alg/tests/test_lddt.py
+17
-0
17 additions, 0 deletions
modules/mol/alg/tests/test_lddt.py
with
23 additions
and
3 deletions
modules/mol/alg/pymod/lddt.py
+
6
−
3
View file @
1cde4be1
...
...
@@ -307,7 +307,7 @@ class lDDTScorer:
local_lddt_prop
=
None
,
local_contact_prop
=
None
,
chain_mapping
=
None
,
no_interchain
=
False
,
penalize_extra_chains
=
False
,
residue_mapping
=
None
,
return_dist_test
=
False
):
return_dist_test
=
False
,
check_resnames
=
True
):
"""
Computes lDDT of *model* - globally and per-residue
:param model: Model to be scored
...
...
@@ -373,7 +373,10 @@ class lDDTScorer:
Fifth: numpy matrix of shape
(len(scored_residues), len(thresholds))
specifying how many for each threshold are
conserved.
conserved.
:param check_resnames: On by default. Enforces residue name matches
between mapped model and target residues.
:type check_resnames: :class:`bool`
:returns: global and per-residue lDDT scores as a tuple -
first element is global lDDT score and second element
a list of per-residue scores with length len(*model*.residues)
...
...
@@ -437,7 +440,7 @@ class lDDTScorer:
if
res_mapper_key
not
in
self
.
res_mapper
:
continue
r_idx
=
self
.
res_mapper
[
res_mapper_key
]
if
r
.
name
!=
self
.
compound_names
[
r_idx
]:
if
check_resnames
and
r
.
name
!=
self
.
compound_names
[
r_idx
]:
raise
RuntimeError
(
f
"
Residue name mismatch for
{
r
}
,
"
f
"
expect
{
self
.
compound_names
[
r_idx
]
}
"
...
...
This diff is collapsed.
Click to expand it.
modules/mol/alg/tests/test_lddt.py
+
17
−
0
View file @
1cde4be1
...
...
@@ -172,6 +172,23 @@ class TestlDDT(unittest.TestCase):
for
a
,
b
in
zip
(
per_res_scores_one
,
per_res_scores_three
):
self
.
assertAlmostEqual
(
a
,
b
,
places
=
5
)
def
test_resname_match
(
self
):
model
=
_LoadFile
(
"
7SGN_C_model.pdb
"
)
target
=
_LoadFile
(
"
7SGN_C_target.pdb
"
)
# introduce name mismatch
ed
=
model
.
handle
.
EditXCS
()
ed
.
RenameResidue
(
model
.
residues
[
42
],
"
asdf
"
)
# do scoring and select aname=CA
scorer
=
lDDTScorer
(
target
.
Select
(
"
aname=CA
"
),
conop
.
GetDefaultLib
())
with
self
.
assertRaises
(
RuntimeError
):
scorer
.
lDDT
(
model
)
scorer
.
lDDT
(
model
,
check_resnames
=
False
)
if
__name__
==
"
__main__
"
:
from
ost
import
testutils
if
testutils
.
SetDefaultCompoundLib
():
...
...
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