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
7d956e81
Unverified
Commit
7d956e81
authored
2 years ago
by
Xavier Robin
Browse files
Options
Downloads
Patches
Plain Diff
feat: SCHWED-5783 add check_resname
parent
fa54de98
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/mol/alg/pymod/ligand_scoring.py
+9
-4
9 additions, 4 deletions
modules/mol/alg/pymod/ligand_scoring.py
modules/mol/alg/tests/test_ligand_scoring.py
+14
-0
14 additions, 0 deletions
modules/mol/alg/tests/test_ligand_scoring.py
with
23 additions
and
4 deletions
modules/mol/alg/pymod/ligand_scoring.py
+
9
−
4
View file @
7d956e81
...
...
@@ -87,6 +87,9 @@ class LigandScorer:
based on residue numbers. This can be assumed in
benchmarking setups such as CAMEO/CASP.
:type resnum_alignments: :class:`bool`
:param check_resnames: On by default. Enforces residue name matches
between mapped model and target residues.
:type check_resnames: :class:`bool`
:param chain_mapper: a chain mapper initialized for the target structure.
If None (default), a chain mapper will be initialized
lazily as required.
...
...
@@ -103,9 +106,9 @@ class LigandScorer:
:param lddt_bs_radius: :class:`float`
"""
def
__init__
(
self
,
model
,
target
,
model_ligands
=
None
,
target_ligands
=
None
,
resnum_alignments
=
False
,
ch
ain_mapper
=
Non
e
,
substructure_match
=
False
,
radius
=
4.0
,
lddt_pli_radius
=
6.0
,
lddt_bs_radius
=
10.0
):
resnum_alignments
=
False
,
ch
eck_resnames
=
Tru
e
,
chain_mapper
=
None
,
substructure_match
=
False
,
radius
=
4.0
,
lddt_pli_radius
=
6.0
,
lddt_bs_radius
=
10.0
):
if
isinstance
(
model
,
mol
.
EntityView
):
self
.
model
=
mol
.
CreateEntityFromView
(
model
,
False
)
...
...
@@ -135,6 +138,7 @@ class LigandScorer:
self
.
_chain_mapper
=
chain_mapper
self
.
resnum_alignments
=
resnum_alignments
self
.
check_resnames
=
check_resnames
self
.
substructure_match
=
substructure_match
self
.
radius
=
radius
self
.
lddt_pli_radius
=
lddt_pli_radius
...
...
@@ -453,7 +457,8 @@ class LigandScorer:
n_cont
,
n_cons
=
lddt_scorer
.
lDDT
(
mdl_bs_ent
,
chain_mapping
=
{
"
A
"
:
"
A
"
,
"
_
"
:
"
_
"
},
no_intrachain
=
True
,
return_dist_test
=
True
)
return_dist_test
=
True
,
check_resnames
=
self
.
check_resnames
)
# Save results?
best_lddt
=
self
.
_lddt_pli_matrix
[
target_i
,
model_i
][
"
lddt_pli
"
]
...
...
This diff is collapsed.
Click to expand it.
modules/mol/alg/tests/test_ligand_scoring.py
+
14
−
0
View file @
7d956e81
...
...
@@ -263,6 +263,20 @@ class TestLigandScoring(unittest.TestCase):
assert
sc
.
_lddt_pli_matrix
[
1
,
0
][
"
bs_num_overlap_res
"
]
==
15
assert
sc
.
_lddt_pli_matrix
[
5
,
0
][
"
bs_num_overlap_res
"
]
==
15
def
test_check_resnames
(
self
):
"""
Test check_resname argument works
"""
# 4C0A has mismatching sequence and fails with check_resnames=True
trg
,
trg_seqres
=
io
.
LoadMMCIF
(
os
.
path
.
join
(
'
testfiles
'
,
"
1r8q.cif.gz
"
),
seqres
=
True
)
trg_4c0a
,
_
=
io
.
LoadMMCIF
(
os
.
path
.
join
(
'
testfiles
'
,
"
4c0a.cif.gz
"
),
seqres
=
True
)
with
self
.
assertRaises
(
RuntimeError
):
sc
=
LigandScorer
(
trg
,
trg_4c0a
,
None
,
None
,
check_resnames
=
True
)
sc
.
_compute_scores
()
sc
=
LigandScorer
(
trg
,
trg_4c0a
,
None
,
None
,
check_resnames
=
False
)
sc
.
_compute_scores
()
if
__name__
==
"
__main__
"
:
from
ost
import
testutils
...
...
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