File: test_ialign.py

package info (click to toggle)
openstructure 2.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 206,240 kB
  • sloc: cpp: 188,571; python: 36,686; ansic: 34,298; fortran: 3,275; sh: 312; xml: 146; makefile: 29
file content (37 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download | duplicates (4)
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
33
34
35
36
37
import unittest
from ost import *
from ost import settings
from ost import testutils
from ost.seq.alg import SequenceIdentity
from ost.bindings import ialign

class TestIAlign(unittest.TestCase):
  
  def setUp(self):
    self.protein = io.LoadEntity("testfiles/testprotein.pdb")


  def testIAlign(self):

    try:
      ialign_exec = settings.Locate('ialign.pl')  
    except:
      print("Could not find ialign master perl script: ignoring unit tests")
      return

    ialign_result = ialign.iAlign(self.protein, self.protein)

    # model and reference are the same, we expect pretty good results
    self.assertEqual(ialign_result.rmsd, 0.0)
    self.assertEqual(ialign_result.is_score, 1.0)
    self.assertEqual(SequenceIdentity(ialign_result.alignment), 100.0)
    self.assertEqual(ialign_result.aligned_residues, 78)
    self.assertEqual(ialign_result.aligned_contacts, 91)

    # transformation should be identity matrix (no transformation at all...)
    identity = geom.Mat4(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1)
    self.assertEqual(ialign_result.transform, identity)


if __name__ == "__main__":
  testutils.RunTests()