示例#1
0
class ComplexPrepTester(unittest.TestCase):
    """
    Test the Complex Preparation  cube
    Example inputs from `openmm_orion/examples/data`
    """
    def setUp(self):
        self.cube = ComplexPrep('ComplexPrep')
        self.runner = CubeTestRunner(self.cube)
        self.runner.start()

    def test_success(self):
        print('Testing cube:', self.cube.name)
        # File name
        fn_protein = ommutils.get_data_filename('examples',
                                                'data/Bace_solvated.oeb.gz')
        fn_ligand = ommutils.get_data_filename('examples',
                                               'data/lig_CAT13a_chg.oeb.gz')

        # Read Protein molecule
        protein = oechem.OEMol()

        with oechem.oemolistream(fn_protein) as ifs:
            oechem.OEReadMolecule(ifs, protein)

        # Read Ligand molecule
        ligand = oechem.OEMol()

        with oechem.oemolistream(fn_ligand) as ifs:
            oechem.OEReadMolecule(ifs, ligand)

        # Process the molecules
        self.cube.process(protein, self.cube.intake.name)
        # Why do I have to manually set these on?
        self.cube.check_system = True
        self.cube.system = protein
        self.cube.process(ligand, self.cube.system_port)

        # 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)

        complex = self.runner.outputs["success"].get()

        self.assertEquals(complex.GetMaxAtomIdx(), 52312)

    def tearDown(self):
        self.runner.finalize()

    def test_failure(self):
        pass
示例#2
0
 def setUp(self):
     self.cube = ComplexPrep('ComplexPrep')
     self.runner = CubeTestRunner(self.cube)
     self.runner.start()
示例#3
0
# 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',
                        description="Protein Prefix")

splitter = Splitter("Splitter")
solvate = SolvationCube("Solvation")

# Complex Setting
complx = ComplexPrep("Complex")
ff = ForceFieldPrep("ForceField")

ofs = OEMolOStreamCube('ofs', title='OFS-Success')
ofs.set_parameters(backend='s3')

fail = OEMolOStreamCube('fail', title='OFS-Failure')
fail.set_parameters(backend='s3')
fail.set_parameters(data_out='fail.oeb.gz')

job.add_cubes(iprot, splitter, solvate, iligs, chargelig, complx, ff, ofs,
              fail)

iprot.success.connect(splitter.intake)
splitter.success.connect(solvate.intake)
solvate.success.connect(complx.system_port)