Exemple #1
0
nvt = OpenMMnvtCube('nvt')
nvt.promote_parameter('time', promoted_name='picosec', default=10.0)
nvt.promote_parameter('temperature', promoted_name='temperature', default=300.0,
                      description='Selected temperature in K')
# Restraints
nvt.promote_parameter('restraints', promoted_name='restraints', default='noh (ligand or protein)')
nvt.promote_parameter('restraintWt', promoted_name='restraintWt', default=2.0)
# Trajectory and logging info frequency intervals
nvt.promote_parameter('trajectory_interval', promoted_name='trajectory_interval', default=100,
                      description='Trajectory saving interval')
nvt.promote_parameter('reporter_interval', promoted_name='reporter_interval', default=1000,
                      description='Reporter saving interval')

nvt.promote_parameter('outfname', promoted_name='suffix', default='nvt',
                      description='Equilibration suffix name')

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(ifs, nvt, ofs, fail)
ifs.success.connect(nvt.intake)
nvt.success.connect(ofs.intake)
nvt.failure.connect(fail.intake)

if __name__ == "__main__":
    job.run()
job.classification = [["Torsion"]]

# Declare Cubes
ifs = OEMolIStreamCube('ifs')
ifs.promote_parameter('data_in', promoted_name='ifs')
ifs.parameter_overrides["download_format"] = {"hidden": True}
ifs.parameter_overrides["limit"] = {"hidden": True}

# Conformer generation
confgenCube = ParallelGenerateStartingConfs('confgenCube')
confgenCube.promote_parameter('max_confs', required=True)
confgenCube.promote_parameter('rms_cutoff', required=True)
confgenCube.parameter_overrides["energy_window"] = {"hidden": True}
confgenCube.parameter_overrides["split_output"] = {"hidden": True}

confgen_failure = OEMolOStreamCube('confgen_failure')
confgen_failure.promote_parameter('data_out',
                                  promoted_name='confgen_failure',
                                  title='Conformer Generation Failures',
                                  description='Conformer Generation Failures',
                                  default='confgen_failures')
confgen_failure.promote_parameter('buffered', default=False)
confgen_failure.parameter_overrides["buffered"] = {"hidden": True}

# Search torsions & select best conformer for each
torsgenCube = ParallelGenerateTorsionalConfs('torsional_conf_gen')
torsgenCube.promote_parameter(
    'num_points',
    required=True,
    title='Number of torsional conformers to generate.',
    description="""The number of evenly spaced torsion angles to sample 
Exemple #3
0
# Declare Cubes
ifs = OEMolIStreamCube('ifs')
ifs.promote_parameter('data_in', promoted_name='ifs')
ifs.parameter_overrides["download_format"] = {"hidden": True}
ifs.parameter_overrides["limit"] = {"hidden": True}

element_filter = FilterBrI('element_filter')

# Conformer generation
confgenCube = ParallelGenerateStartingConfs('confgenCube')
confgenCube.promote_parameter('max_confs', required=True)
confgenCube.promote_parameter('rms_cutoff', required=True)
confgenCube.parameter_overrides["energy_window"] = {"hidden": True}
confgenCube.parameter_overrides["split_output"] = {"hidden": True}

confgen_failure = OEMolOStreamCube('confgen_failure')
confgen_failure.promote_parameter('data_out',
                                  promoted_name='confgen_failure',
                                  title='Conformer Generation Failures',
                                  description='Conformer Generation Failures',
                                  default='confgen_failures')
confgen_failure.promote_parameter('buffered', default=False)
confgen_failure.parameter_overrides["buffered"] = {"hidden": True}

# Search torsions & select best conformer for each
torsgenCube = ParallelGenerateTorsionalConfs('torsional_conf_gen')
torsgenCube.promote_parameter(
    'num_points',
    required=True,
    title='Number of torsional conformers to generate.',
    description="""The number of evenly spaced torsion angles to sample 
"""

job.classification =[["YANK", "Binding free energies", "OpenMM", "choderalab"]]
job.tags = [tag for lists in job.classification for tag in lists]

ifs = OEMolIStreamCube("ifs")
ifs.promote_parameter("data_in", promoted_name="molecules", description="Input molecules")

yank_cube = YankBindingCube('yank_binding', title = 'Yank for binding free energies')
for parameter_name in ['receptor', 'solvent', 'temperature', 'pressure', 'nsteps_per_iteration', 'simulation_time', 'timestep', 'minimize', 'verbose']:
    promoted_name = parameter_name
    description = yank_cube.parameters()[parameter_name].description
    yank_cube.promote_parameter(parameter_name, promoted_name=promoted_name, description=description)

success_ofs = OEMolOStreamCube("success_ofs")
success_ofs.promote_parameter("data_out", promoted_name="success", description="Output molecules")

failure_ofs = OEMolOStreamCube("failure_ofs")
failure_ofs.promote_parameter("data_out", promoted_name="failure", description="Failed molecules")

cubes = [ifs, yank_cube, success_ofs, failure_ofs]

job.add_cubes(*cubes)

ifs.success.connect(yank_cube.intake)
yank_cube.success.connect(success_ofs.intake)
yank_cube.failure.connect(failure_ofs.intake)


if __name__ == "__main__":
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',
                                    title='ComplexSetUpOut')
complex_prep_ofs.set_parameters(backend='s3')
complex_prep_ofs.set_parameters(
    data_out=iprot.promoted_parameters['protein_prefix']['default'] +
    '_SetUp.oeb.gz')

# Minimization
minComplex = OpenMMminimizeCube('minComplex', title='Minimize')
minComplex.promote_parameter('restraints',
                             promoted_name='m_restraints',
                             default="noh (ligand or protein)",
                             description='Select mask to apply restarints')
minComplex.promote_parameter('restraintWt',
                             promoted_name='m_restraintWt',
                             default=5.0,
                             description='Restraint weight')
# Declare Cubes
ifs = OEMolIStreamCube('ifs')
ifs.promote_parameter('data_in', promoted_name='ifs')

confgenCube = SerialGenerateStartingConfs('starting_conf_gen')
confgenCube.promote_parameter(
    'max_confs',
    title='Maximum Alternate Starting Conformers',
    description=
    'Maximum number of starting conformations to use in QM torsion driving experiment. '
    +
    'NOTE: If you do not want to generate starting conformations, set this to 1.'
)

confgen_failure = OEMolOStreamCube('confgen_failure')
confgen_failure.promote_parameter('data_out',
                                  promoted_name='confgen_failure',
                                  title='Conformer Generation Failures',
                                  description='Conformer Generation Failures',
                                  default='confgen_failures')

torsgenCube = SerialGenerateTorsionalConfs('torsional_conf_gen')
torsgenCube.promote_parameter(
    'num_points',
    title='Number of torsional conformers to generate.',
    description="""The number of evenly spaced torsion angles to sample 
                              when generating torsional conformers.""")

psi4EnergyCube = ParallelPsi4EnergyCalculation(
    'parallel_psi4_energy_calculation')
# Fast QM optimization with 6-11G to get approximate geometry
b3lyp631gCube = HiddenParamParallelPsi4EnergyCalculation('b3lyp631g_precalc')
b3lyp631gCube.set_parameters(spe_method='B3LYP', spe_basis='6-31G', opt_method='B3LYP', opt_basis='6-31G', geom_maxiter=200)

# Full QM optimization & SP for energy
psi4EnergyCube = ParallelPsi4EnergyCalculation('parallel_psi4_energy_calculation')
psi4EnergyCube.set_parameters(geom_maxiter=200)
psi4EnergyCube.promote_parameter('spe_method', required=True)
psi4EnergyCube.promote_parameter('spe_basis', required=True)
psi4EnergyCube.promote_parameter('molden_output', required=True)
psi4EnergyCube.promote_parameter('opt_method', required=True)
psi4EnergyCube.promote_parameter('opt_basis', required=True)

# hf3c failure handling
failFastQM = OEMolOStreamCube('fail_fast_QM')
failFastQM.promote_parameter('data_out', promoted_name='fast_qm_fail', title='fast_qm_fail',
                             description="fast QM Failures",
                             default='fast_QM_failures')
failFastQM.promote_parameter('buffered', default=False)
failFastQM.parameter_overrides["buffered"] = {"hidden": True}

# final molecular output
ofs = OEMolOStreamCube('ofs')
ofs.promote_parameter('data_out', promoted_name='ofs',
                      description='Floe output',
                      default='output',
                      title='Successes')
ofs.promote_parameter('buffered', default=False)
ofs.parameter_overrides["buffered"] = {"hidden": True}
from PlatformTestCubes.cubes import PlatformTestCube

job = WorkFloe("OpenMMPlatforms")

job.description = """
**Check available OpenMM Platforms**
Based on OpenMM SimTK installation check script
"""

job.classification = [
    ["OpenMM", "Platforms"]
]
job.tags = [tag for lists in job.classification for tag in lists]

ifs = OEMolIStreamCube("ifs")
ofs = OEMolOStreamCube("ofs")

# Promotes the parameter to something we can specify from the command line as "--ifs=..."
ifs.promote_parameter("data_in", promoted_name="ifs")

# this is hardwiring the filename to the molecules coming out of ofs
ofs.set_parameters(data_out="openmmPlatformCheck.oeb")

# the name of the object has to match the string: this is the name of myself
platformTester = PlatformTestCube("platformTester")

job.add_cubes(ifs, ofs, platformTester)
ifs.success.connect(platformTester.intake)
platformTester.success.connect(ofs.intake)