-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import psico.minimizing | ||
from pymol import cmd | ||
import pytest | ||
from pytest import approx | ||
|
||
|
||
def test_get_fixed_indices(): | ||
cmd.reinitialize() | ||
cmd.fragment("gly", "m1") | ||
cmd.flag("fix", "elem N+O") | ||
r = psico.minimizing.get_fixed_indices("m1", 1, _self=cmd) | ||
assert r == [0, 3] | ||
r = psico.minimizing.get_fixed_indices("m1 & elem C+O", 1, _self=cmd) | ||
assert r == [2] | ||
|
||
|
||
def test_load_or_update(): | ||
cmd.reinitialize() | ||
cmd.fragment("gly", "m1") | ||
molstr = cmd.get_str("mol", "m1") | ||
psico.minimizing.load_or_update(molstr, "m2", "m1", 1, _self=cmd) | ||
assert cmd.rms_cur("m2", "m1", matchmaker=-1) == approx(0.0) | ||
cmd.alter_state(1, "m1", "(x,y,z) = (x*2, y*2, z*2)") | ||
assert cmd.rms("m2", "m1", matchmaker=-1) > 1 | ||
psico.minimizing.load_or_update(molstr, "", "m1", 1, _self=cmd) | ||
assert cmd.get_names() == ["m1", "m2"] | ||
assert cmd.rms("m2", "m1", matchmaker=-1) == approx(0.0) | ||
|
||
|
||
# def minimize_ob(selection='enabled', state=-1, ff='UFF', nsteps=500, | ||
|
||
|
||
@pytest.mark.rdkit | ||
def test_minimize_rdkit(): | ||
cmd.reinitialize() | ||
cmd.fab("ACD", "m1") | ||
cmd.copy("m2", "m1") | ||
psico.minimizing.minimize_rdkit("m2", nsteps=100) | ||
r = cmd.rms("m2", "m1") | ||
assert r == approx(0.7118, abs=1e-2) | ||
|
||
|
||
# def clean_ob(selection, present='', state=-1, fix='', restrain='', |