Skip to content
Snippets Groups Projects
Commit 1b7f6ea2 authored by Gerardo Tauriello's avatar Gerardo Tauriello
Browse files

SCHWED-2638: fixed/cleaned-up dssp-locate-check in unit tests

parent 1bd92b74
No related branches found
No related tags found
No related merge requests found
...@@ -111,19 +111,14 @@ class TestAccessibility(unittest.TestCase): ...@@ -111,19 +111,14 @@ class TestAccessibility(unittest.TestCase):
def testAccDSSP(self): def testAccDSSP(self):
dssp_path = None # only relevant if dssp there
try: try:
dssp_path = settings.Locate("dssp") # same check used in dssp binding
dssp_path = settings.Locate(['dsspcmbi', 'dssp', 'mkdssp'],
env_name='DSSP_EXECUTABLE')
except: except:
try:
dssp_path = settings.locate("mkdssp")
except:
pass
pass
if dssp_path == None:
print "Could not find DSSP, could not compare Accessibility function..." print "Could not find DSSP, could not compare Accessibility function..."
return
# we assume oligo mode to be working as it is tested in # we assume oligo mode to be working as it is tested in
# testAccNACCESS. So we only test the single residue # testAccNACCESS. So we only test the single residue
...@@ -133,7 +128,7 @@ class TestAccessibility(unittest.TestCase): ...@@ -133,7 +128,7 @@ class TestAccessibility(unittest.TestCase):
ent_one = ent_one.Select("peptide=true") ent_one = ent_one.Select("peptide=true")
ent_two = ent_two.Select("peptide=true") ent_two = ent_two.Select("peptide=true")
dssp.AssignDSSP(ent_one, extract_burial_status=True, dssp_bin = dssp_path) dssp.AssignDSSP(ent_one, extract_burial_status=True, dssp_bin=dssp_path)
mol.alg.Accessibility(ent_two, algorithm=mol.alg.AccessibilityAlgorithm.DSSP) mol.alg.Accessibility(ent_two, algorithm=mol.alg.AccessibilityAlgorithm.DSSP)
for a,b in zip(ent_one.residues, ent_two.residues): for a,b in zip(ent_one.residues, ent_two.residues):
......
...@@ -9,20 +9,18 @@ class TestSecStruct(unittest.TestCase): ...@@ -9,20 +9,18 @@ class TestSecStruct(unittest.TestCase):
def testSecStruct(self): def testSecStruct(self):
# unit test only makes sense, when a dssp binary is around # unit test only makes sense, when a dssp binary is around
dssp_path = None
try: try:
dssp_path = settings.Locate("dssp") # same check used in dssp binding
dssp_path = settings.Locate(['dsspcmbi', 'dssp', 'mkdssp'],
env_name='DSSP_EXECUTABLE')
except: except:
try: print "Could not find DSSP, could not compare sec struct assignment..."
dssp_path = settings.Locate("mkdssp") return
except:
print "Could not find dssp, could not compare sec struct assignment..."
return
dssp_ent = io.LoadPDB(os.path.join("testfiles", "1a0s.pdb")) dssp_ent = io.LoadPDB(os.path.join("testfiles", "1a0s.pdb"))
ost_ent = io.LoadPDB(os.path.join("testfiles", "1a0s.pdb")) ost_ent = io.LoadPDB(os.path.join("testfiles", "1a0s.pdb"))
dssp.AssignDSSP(dssp_ent, dssp_bin = dssp_path) dssp.AssignDSSP(dssp_ent, dssp_bin=dssp_path)
mol.alg.AssignSecStruct(ost_ent) mol.alg.AssignSecStruct(ost_ent)
for a, b in zip(dssp_ent.residues, ost_ent.residues): for a, b in zip(dssp_ent.residues, ost_ent.residues):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment