コード例 #1
0
 def setUp(self):
     self.cube = ForceFieldPrep('ForceFieldPrep')
     self.runner = CubeTestRunner(self.cube)
     self.runner.start()
コード例 #2
0
class ForceFieldPrepTester(unittest.TestCase):
    """
      Test the Complex Preparation  cube
      Example inputs from `openmm_orion/examples/data`
      """
    def setUp(self):
        self.cube = ForceFieldPrep('ForceFieldPrep')
        self.runner = CubeTestRunner(self.cube)
        self.runner.start()

    def test_excipient_successGaff2(self):
        print('Testing cube:', self.cube.name)
        # File name
        fn_complex = ommutils.get_data_filename(
            'examples', 'data/pbace_lcat13a_solvated_complex.oeb.gz')

        # Read Protein molecule
        complex = oechem.OEMol()

        with oechem.oemolistream(fn_complex) as ifs:
            oechem.OEReadMolecule(ifs, complex)

        # Selecting ligand and excipient parametrization
        self.cube.args.ligand_forcefield = 'GAFF2'
        self.cube.args.other_forcefield = 'GAFF2'

        # Process the molecules
        self.cube.process(complex, 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)

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

    def test_excipient_successSmirnoff(self):
        print('Testing cube:', self.cube.name)
        # File name
        fn_complex = ommutils.get_data_filename(
            'examples', 'data/pbace_lcat13a_solvated_complex.oeb.gz')

        # Read Protein molecule
        complex = oechem.OEMol()

        with oechem.oemolistream(fn_complex) as ifs:
            oechem.OEReadMolecule(ifs, complex)

        # Selecting ligand and excipient parametrization
        self.cube.args.ligand_forcefield = 'SMIRNOFF'
        self.cube.args.other_forcefield = 'SMIRNOFF'

        # Process the molecules
        self.cube.process(complex, 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)

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

    def test_protein_non_std_residue(self):
        print('Testing cube:', self.cube.name)
        # File name
        fn_complex = ommutils.get_data_filename(
            'examples', 'data/pCDK2_l1h1q_solvated_complex.oeb.gz')

        # Read Protein molecule
        complex = oechem.OEMol()

        with oechem.oemolistream(fn_complex) as ifs:
            oechem.OEReadMolecule(ifs, complex)

        # Process the molecules
        self.cube.process(complex, 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)

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

    def test_failure(self):
        pass
コード例 #3
0
                          default=1.25,
                          description="Solution density in g/ml")
solvate.promote_parameter(
    'close_solvent',
    promoted_name='close_solvent',
    default=True,
    description='The solvent molecules will be placed very close to the solute'
)
solvate.promote_parameter(
    'salt_concentration',
    promoted_name='salt_concentration',
    default=50.0,
    description='Salt concentration (Na+, Cl-) in millimolar')

# Force Field Application
ff = ForceFieldPrep("ForceField")
ff.promote_parameter('protein_forcefield',
                     promoted_name='protein_ff',
                     default='amber99sbildn.xml')
ff.promote_parameter('solvent_forcefield',
                     promoted_name='solvent_ff',
                     default='tip3p.xml')
ff.promote_parameter('ligand_forcefield',
                     promoted_name='ligand_ff',
                     default='GAFF2')
ff.promote_parameter('other_forcefield',
                     promoted_name='other_ff',
                     default='GAFF2')

# Output the prepared systems
complex_prep_ofs = OEMolOStreamCube('complex_prep_ofs',
コード例 #4
0
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)
iligs.success.connect(chargelig.intake)
コード例 #5
0
                        description="Protein file name")
iprot.promote_parameter("protein_prefix",
                        promoted_name="protein_prefix",
                        default='PRT',
                        description="Protein prefix")

# COMPLEX SETTING

# Complex cube used to assemble the ligands and the solvated protein
complx = ComplexPrep("Complex")

# The solvation cube is used to solvate the system and define the ionic strength of the solution
solvateComplex = HydrationCube("HydrationComplex", title="HydrationComplex")

# Complex Force Field Application
ffComplex = ForceFieldPrep("ForceFieldComplex", title="ForceFieldComplex")
ffComplex.promote_parameter('protein_forcefield',
                            promoted_name='protein_ff',
                            default='amber99sbildn.xml')
ffComplex.promote_parameter('solvent_forcefield',
                            promoted_name='solvent_ff',
                            default='tip3p.xml')
ffComplex.promote_parameter('ligand_forcefield',
                            promoted_name='ligand_ff',
                            default='GAFF2')
ffComplex.promote_parameter('other_forcefield',
                            promoted_name='other_ff',
                            default='GAFF2')

# Minimization
minComplex = OpenMMminimizeCube('minComplex', title='MinimizeComplex')