def testROGscore(self): entryId = 'test' project = Project(entryId) self.failIf(project.removeFromDisk()) project = Project.open(entryId, status='new') molecule = Molecule(name='moleculeName') molecule.ensemble = Ensemble(molecule) # Needed for html. project.appendMolecule(molecule) # Needed for html. # Add some crud to prevent warnings/errors later. molecule.addChain('top') top = molecule.allChains()[0] # Disable warnings temporarily v = cing.verbosity cing.verbosity = verbosityNothing for i in range(1 * 10): res = top.addResidue(repr(random()), i) for j in range(5): _atom = res.addAtom(repr(random()), j) cing.verbosity = v molecule.updateAll() project.setupHtml() # Needed for creating the sub dirs. a = Atom(resName='ALA', atomName='HN') a.criticize() self.assertTrue(a) self.assertEquals(a.rogScore.colorLabel, COLOR_ORANGE) self.assertEquals(a.rogScore.colorCommentList[0][0], COLOR_ORANGE) self.assertEquals(a.rogScore.colorCommentList[0][1], ROGscore.ROG_COMMENT_NO_COOR) lotr_remark = 'One ring to rule them all' preserved_remark = 'Preserved' nowHasEffect_remark = 'Now has effect' nowHasEffectToo_remark = 'Now has effect too' # Next line will have to wipe out the orange comments. a.rogScore.setMaxColor(COLOR_RED, lotr_remark) a.rogScore.setMaxColor(COLOR_ORANGE, nowHasEffect_remark) a.rogScore.setMaxColor(COLOR_RED, preserved_remark) a.rogScore.setMaxColor(COLOR_ORANGE, nowHasEffectToo_remark) self.assertEquals(len(a.rogScore.colorCommentList), 5) self.assertEquals(a.rogScore.colorCommentList[0][1], ROGscore.ROG_COMMENT_NO_COOR) self.assertEquals(a.rogScore.colorCommentList[1][1], nowHasEffect_remark) myhtml = HTMLfile('testROGscore.html', project, 'A Test') myhtml.main("a main") a.rogScore.createHtmlForComments(myhtml.main) kw = {} a.rogScore.addHTMLkeywords(kw) myhtml.main("a", 'or by popup', **kw) myhtml.render()
def testROGscore(self): entryId = 'test' project = Project(entryId) self.failIf(project.removeFromDisk()) project = Project.open(entryId, status='new') molecule = Molecule(name='moleculeName') molecule.ensemble = Ensemble(molecule) # Needed for html. project.appendMolecule(molecule) # Needed for html. # Add some crud to prevent warnings/errors later. molecule.addChain('top') top = molecule.allChains()[0] # Disable warnings temporarily v = cing.verbosity cing.verbosity = verbosityNothing for i in range( 1*10): res = top.addResidue( repr(random()),i ) for j in range( 5): _atom = res.addAtom( repr(random()),j ) cing.verbosity = v molecule.updateAll() project.setupHtml() # Needed for creating the sub dirs. a = Atom(resName='ALA', atomName='HN') a.criticize() self.assertTrue(a) self.assertEquals(a.rogScore.colorLabel, COLOR_ORANGE) self.assertEquals(a.rogScore.colorCommentList[0][0], COLOR_ORANGE) self.assertEquals(a.rogScore.colorCommentList[0][1], ROGscore.ROG_COMMENT_NO_COOR) lotr_remark = 'One ring to rule them all' preserved_remark = 'Preserved' nowHasEffect_remark = 'Now has effect' nowHasEffectToo_remark = 'Now has effect too' # Next line will have to wipe out the orange comments. a.rogScore.setMaxColor(COLOR_RED, lotr_remark) a.rogScore.setMaxColor(COLOR_ORANGE, nowHasEffect_remark ) a.rogScore.setMaxColor(COLOR_RED, preserved_remark) a.rogScore.setMaxColor(COLOR_ORANGE, nowHasEffectToo_remark) self.assertEquals(len(a.rogScore.colorCommentList), 5) self.assertEquals(a.rogScore.colorCommentList[0][1], ROGscore.ROG_COMMENT_NO_COOR) self.assertEquals(a.rogScore.colorCommentList[1][1], nowHasEffect_remark) myhtml = HTMLfile('testROGscore.html', project, 'A Test') myhtml.main("a main") a.rogScore.createHtmlForComments(myhtml.main) kw = {} a.rogScore.addHTMLkeywords(kw) myhtml.main("a", 'or by popup', **kw) myhtml.render()
def setupSimplestProject(self): entryId = 'setupSimplestProject' project = Project(entryId) self.failIf(project.removeFromDisk()) project = Project.open(entryId, status='new') molecule = Molecule(name='moleculeName') molecule.ensemble = Ensemble(molecule) # Needed for html. project.appendMolecule(molecule) # Needed for html. c = molecule.addChain('A') r1 = c.addResidue('ALA', 1, Nterminal=True) if r1: r1.addAllAtoms() molecule.updateAll() project.setupHtml() # Needed for creating the sub dirs. return project
def setupSimplestProject(self): entryId = 'setupSimplestProject' project = Project(entryId) self.failIf(project.removeFromDisk()) project = Project.open(entryId, status='new') molecule = Molecule(name='moleculeName') molecule.ensemble = Ensemble(molecule) # Needed for html. project.appendMolecule(molecule) # Needed for html. c = molecule.addChain('A') r1 = c.addResidue('ALA', 1, Nterminal = True) if r1: r1.addAllAtoms() molecule.updateAll() project.setupHtml() # Needed for creating the sub dirs. return project