class LigChargeTester(unittest.TestCase): """ Test ELF10 charge cube Example inputs from `openmm_orion/examples/data` """ def setUp(self): self.cube = LigChargeCube('elf10charge') self.cube.args.max_conforms = 800 self.runner = CubeTestRunner(self.cube) self.runner.start() def test_success(self): print('Testing cube:', self.cube.name) # File name of a charged ligand lig_fname = utils.get_data_filename('examples', 'data/lig_CAT13a_chg.oeb.gz') # Read OEMol molecule mol = oechem.OEMol() ifs = oechem.oemolistream(lig_fname) if not oechem.OEReadMolecule(ifs, mol): raise Exception('Cannot read molecule from %s' % lig_fname) ifs.close() mol_copy = mol.CreateCopy() # Set the partial charge to zero for at in mol_copy.GetAtoms(): at.SetPartialCharge(0.0) # Process the molecules self.cube.process(mol_copy, self.cube.intake.name) # Assert that one molecule was emitted on the success port self.assertEqual(self.runner.outputs['success'].qsize(), 1) # Assert that zero molecules were emitted on the failure port self.assertEqual(self.runner.outputs['failure'].qsize(), 0) # Check outmol outmol = self.runner.outputs["success"].get() # Loop through atoms and make sure partial charges were set for iat, oat in zip(mol.GetAtoms(), outmol.GetAtoms()): self.assertNotEqual(iat.GetPartialCharge(), oat.GetPartialCharge) def test_failure(self): pass def tearDown(self): self.runner.finalize()
Outputs: -------- ofs: Output file """ job.classification = [['Simulation']] job.tags = [tag for lists in job.classification for tag in lists] # Ligand setting iligs = OEMolIStreamCube("Ligands", title="Ligand Reader") iligs.promote_parameter("data_in", promoted_name="ligands", title="Ligand Input File", description="Ligand file name") chargelig = LigChargeCube("LigCharge") chargelig.promote_parameter( 'max_conformers', promoted_name='max_conformers', description="Set the max number of conformers per ligand", default=800) # Protein Setting iprot = ProteinReader("ProteinReader") iprot.promote_parameter("data_in", promoted_name="protein", title="Protein Input File", description="Protein file name") iprot.promote_parameter("protein_prefix", promoted_name="protein_prefix", default='PRT',
def setUp(self): self.cube = LigChargeCube('elf10charge') self.cube.args.max_conforms = 800 self.runner = CubeTestRunner(self.cube) self.runner.start()