File: stereochemistry.py

package info (click to toggle)
pymol 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 74,084 kB
  • sloc: cpp: 482,660; python: 89,328; ansic: 29,512; javascript: 6,792; sh: 84; makefile: 25
file content (32 lines) | stat: -rw-r--r-- 1,021 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
from pymol import movie, cmd, testing, stored

@testing.requires('incentive')
@testing.requires_version('2.2')
class TestStereochemistry(testing.PyMOLTestCase):

    def test_assign_stereo_schrodinger(self):
        if not os.getenv("SCHRODINGER"):
            self.skipTest("SCHRODINGER not set")

        self.assertEqual(cmd.count_atoms("stereo R"), 0)

        cmd.load(self.datafile("1ehz-5.pdb"), "m1")
        cmd.assign_stereo(method="schrodinger")

        self.assertEqual(cmd.count_atoms("stereo R"), 15)
        self.assertEqual(cmd.count_atoms("stereo S"), 5)

    def test_assign_stereo_rdkit(self):
        try:
            import rdkit
        except ImportError:
            self.skipTest("rdkit not available")

        self.assertEqual(cmd.count_atoms("stereo R"), 0)

        cmd.load(self.datafile("1ehz-5.pdb"), "m1")
        cmd.assign_stereo(method="rdkit")

        self.assertEqual(cmd.count_atoms("stereo R & not elem P"), 15)
        self.assertEqual(cmd.count_atoms("stereo S"), 5)