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
76cea324
Unverified
Commit
76cea324
authored
2 years ago
by
Xavier Robin
Browse files
Options
Downloads
Patches
Plain Diff
refactor: SCHWED-5783 rename LigandRMSD to SCRMSD
parent
5ca5fcec
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/ligand_scoring.py
+2
-2
2 additions, 2 deletions
modules/mol/alg/pymod/ligand_scoring.py
modules/mol/alg/tests/test_ligand_scoring.py
+9
-9
9 additions, 9 deletions
modules/mol/alg/tests/test_ligand_scoring.py
with
11 additions
and
11 deletions
modules/mol/alg/pymod/ligand_scoring.py
+
2
−
2
View file @
76cea324
...
...
@@ -337,7 +337,7 @@ def ResidueToGraph(residue, by_atom_index=False):
return
nxg
def
Ligand
RMSD
(
model_ligand
,
target_ligand
,
transformation
=
geom
.
Mat4
(),
def
SC
RMSD
(
model_ligand
,
target_ligand
,
transformation
=
geom
.
Mat4
(),
substructure_match
=
False
):
"""
Calculate symmetry-corrected RMSD.
...
...
@@ -464,4 +464,4 @@ class NoSymmetryError(Exception):
"""
pass
__all__
=
[
"
LigandScorer
"
,
"
ResidueToGraph
"
,
"
Ligand
RMSD
"
,
"
NoSymmetryError
"
]
__all__
=
[
"
LigandScorer
"
,
"
ResidueToGraph
"
,
"
SC
RMSD
"
,
"
NoSymmetryError
"
]
This diff is collapsed.
Click to expand it.
modules/mol/alg/tests/test_ligand_scoring.py
+
9
−
9
View file @
76cea324
...
...
@@ -179,8 +179,8 @@ class TestLigandScoring(unittest.TestCase):
with
self
.
assertRaises
(
NoSymmetryError
):
ost
.
mol
.
alg
.
ligand_scoring
.
_ComputeSymmetries
(
mdl_g3d_sub
,
trg_g3d1
,
substructure_match
=
True
)
def
test_
Ligand
RMSD
(
self
):
"""
Test that
Ligand
RMSD works.
def
test_
SC
RMSD
(
self
):
"""
Test that
SC
RMSD works.
"""
trg
,
trg_seqres
=
io
.
LoadMMCIF
(
os
.
path
.
join
(
'
testfiles
'
,
"
1r8q.cif.gz
"
),
seqres
=
True
)
mdl
,
mdl_seqres
=
io
.
LoadMMCIF
(
os
.
path
.
join
(
'
testfiles
'
,
"
P84080_model_02.cif.gz
"
),
seqres
=
True
)
...
...
@@ -191,23 +191,23 @@ class TestLigandScoring(unittest.TestCase):
trg_g3d2
=
trg
.
FindResidue
(
"
J
"
,
1
)
mdl_g3d
=
mdl
.
FindResidue
(
"
L_2
"
,
1
)
rmsd
=
Ligand
RMSD
(
mdl_g3d
,
trg_g3d1
)
rmsd
=
SC
RMSD
(
mdl_g3d
,
trg_g3d1
)
self
.
assertAlmostEqual
(
rmsd
,
2.21341e-06
,
10
)
rmsd
=
Ligand
RMSD
(
mdl_g3d
,
trg_g3d2
)
rmsd
=
SC
RMSD
(
mdl_g3d
,
trg_g3d2
)
self
.
assertAlmostEqual
(
rmsd
,
61.21325
,
4
)
# Ensure we raise a NoSymmetryError if the ligand is wrong
with
self
.
assertRaises
(
NoSymmetryError
):
Ligand
RMSD
(
mdl_g3d
,
trg_mg1
)
SC
RMSD
(
mdl_g3d
,
trg_mg1
)
with
self
.
assertRaises
(
NoSymmetryError
):
Ligand
RMSD
(
mdl_g3d
,
trg_afb1
)
SC
RMSD
(
mdl_g3d
,
trg_afb1
)
# Assert that transform works
trans
=
geom
.
Mat4
(
-
0.999256
,
0.00788487
,
-
0.0377333
,
-
15.4397
,
0.0380652
,
0.0473315
,
-
0.998154
,
29.9477
,
-
0.00608426
,
-
0.998848
,
-
0.0475963
,
28.8251
,
0
,
0
,
0
,
1
)
rmsd
=
Ligand
RMSD
(
mdl_g3d
,
trg_g3d2
,
transformation
=
trans
)
rmsd
=
SC
RMSD
(
mdl_g3d
,
trg_g3d2
,
transformation
=
trans
)
self
.
assertAlmostEqual
(
rmsd
,
0.293972
,
5
)
# Assert that substructure matches work
...
...
@@ -215,8 +215,8 @@ class TestLigandScoring(unittest.TestCase):
trg_g3d1_sub
=
trg_g3d1
.
Select
(
"
aindex>6019
"
).
residues
[
0
]
# Skip PA, PB and O[1-3]A and O[1-3]B.
mdl_g3d_sub
=
mdl_g3d
.
Select
(
"
aindex>1447
"
).
residues
[
0
]
# Skip PA, PB and O[1-3]A and O[1-3]B.
with
self
.
assertRaises
(
NoSymmetryError
):
Ligand
RMSD
(
mdl_g3d
,
trg_g3d1_sub
)
# no full match
rmsd
=
Ligand
RMSD
(
mdl_g3d
,
trg_g3d1_sub
,
substructure_match
=
True
)
SC
RMSD
(
mdl_g3d
,
trg_g3d1_sub
)
# no full match
rmsd
=
SC
RMSD
(
mdl_g3d
,
trg_g3d1_sub
,
substructure_match
=
True
)
if
__name__
==
"
__main__
"
:
...
...
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