Skip to content
Snippets Groups Projects
Commit acdf5eb5 authored by Bienchen's avatar Bienchen
Browse files

More pithonic module loading

parent da958feb
No related branches found
No related tags found
No related merge requests found
import unittest
from promod3 import *
from promod3.meld import *
from promod3 import meld
from ost import conop, seq, io, mol
class RawModelingTests(unittest.TestCase):
......@@ -13,14 +13,14 @@ class RawModelingTests(unittest.TestCase):
# test that BuildRawModel throws exception when no view is attached
aln=seq.CreateAlignment(seq.CreateSequence('A', 'acdef'),
seq.CreateSequence('B', 'ac-ef'))
self.assertRaises(RuntimeError, BuildRawModel, aln)
self.assertRaises(RuntimeError, meld.BuildRawModel, aln)
def testModeledSequence(self):
# test if the model has the sequence we want.
tpl=io.LoadPDB('data/raw-modeling/gly.pdb')
aln=io.LoadAlignment('data/raw-modeling/seq.fasta')
aln.AttachView(1, tpl.CreateFullView())
result=BuildRawModel(aln)
result=meld.BuildRawModel(aln)
seq1=seq.SequenceFromChain('MODEL', result.model.chains[0])
self.assertEqual(seq1.string, aln.sequences[0].string)
......@@ -29,7 +29,7 @@ class RawModelingTests(unittest.TestCase):
tpl=io.LoadPDB('data/raw-modeling/gly.pdb')
aln=io.LoadAlignment('data/raw-modeling/del.fasta')
aln.AttachView(1, tpl.CreateFullView())
result=BuildRawModel(aln)
result=meld.BuildRawModel(aln)
residues=result.model.residues
self.assertEqual(len(result.gaps), 1)
self.assertEqual(result.gaps[0].before, residues[2])
......@@ -41,7 +41,7 @@ class RawModelingTests(unittest.TestCase):
tpl=io.LoadPDB('data/raw-modeling/gly.pdb')
aln=io.LoadAlignment('data/raw-modeling/ins.fasta')
aln.AttachView(1, tpl.CreateFullView())
result=BuildRawModel(aln)
result=meld.BuildRawModel(aln)
residues=result.model.residues
self.assertEqual(len(result.gaps), 1)
self.assertEqual(result.gaps[0].before, residues[1])
......@@ -54,7 +54,7 @@ class RawModelingTests(unittest.TestCase):
tpl=io.LoadPDB('data/raw-modeling/gly.pdb')
aln=io.LoadAlignment('data/raw-modeling/ter.fasta')
aln.AttachView(1, tpl.CreateFullView())
result=BuildRawModel(aln)
result=meld.BuildRawModel(aln)
residues=result.model.residues
self.assertEqual(len(result.gaps), 2)
self.assertEqual(result.gaps[0].before, mol.ResidueHandle())
......@@ -69,7 +69,7 @@ class RawModelingTests(unittest.TestCase):
tpl=io.LoadPDB('data/raw-modeling/sep.pdb')
aln=io.LoadAlignment('data/raw-modeling/sep.fasta')
aln.AttachView(1, tpl.CreateFullView())
result=BuildRawModel(aln)
result=meld.BuildRawModel(aln)
residues=result.model.residues
self.assertEqual(len(residues), 1)
self.assertEqual(len(residues[0].atoms), 6)
......@@ -85,7 +85,7 @@ class RawModelingTests(unittest.TestCase):
tpl=io.LoadPDB('data/raw-modeling/cbeta.pdb')
aln=io.LoadAlignment('data/raw-modeling/cbeta.fasta')
aln.AttachView(1, tpl.CreateFullView())
result=BuildRawModel(aln)
result=meld.BuildRawModel(aln)
residues=result.model.residues
assert not residues[0].FindAtom("CB").IsValid()
assert not residues[1].FindAtom("CB").IsValid()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment