#    receptor_atoms = range(0,12) # benzene
#    ligand_atoms = range(12,27) # toluene
    receptor_atoms = range(0,2603) # T4 lysozyme L99A
    ligand_atoms = range(2603,2621) # p-xylene
    platform_names = ['Reference', 'Cuda', 'OpenCL']
    platform_names = ['Cuda', 'OpenCL']    

    # Create force type variants of systems.
    force_types = ['standard', 'softcore-full', 'softcore-annihilated', 'custom-full', 'custom-annihilated'] # Different force types
    system_types = ['complex', 'receptor']
    systems = dict()
    for system_type in system_types:
        systems[system_type] = dict()        
    # Load standard systems.
    import simtk.pyopenmm.amber.amber_file_parser as amber    
    systems['complex']['standard'] = amber.readAmberSystem(complex_prmtop_filename, mm=openmm, gbmodel=gbmodel, shake='h-bonds')
    systems['receptor']['standard'] = amber.readAmberSystem(receptor_prmtop_filename, mm=openmm, gbmodel=gbmodel, shake='h-bonds')
    # Create softcore force type variants.
    for system_type in system_types:
        systems[system_type]['softcore-full'] = build_softcore_system(systems[system_type]['standard'], receptor_atoms, ligand_atoms, 1.0, 1.0, 1.0)
        systems[system_type]['softcore-annihilated'] = build_softcore_system(systems[system_type]['standard'], receptor_atoms, ligand_atoms, 0.0, 0.0, 0.0)
    # Create custom force type variants.
    for system_type in system_types:
        systems[system_type]['custom-full'] = build_custom_system(systems[system_type]['standard'], receptor_atoms, ligand_atoms, 1.0, 1.0, 1.0)
        systems[system_type]['custom-annihilated'] = build_custom_system(systems[system_type]['standard'], receptor_atoms, ligand_atoms, 0.0, 0.0, 0.0)

    # Read coordinates.
    coordinates = dict()
    coordinates['complex'] = amber.readAmberCoordinates(complex_crd_filename)
    coordinates['receptor'] = coordinates['complex'][receptor_atoms,:]
Exemple #2
0
    # Create force type variants of systems.
    force_types = [
        'standard', 'softcore lambda=1', 'softcore lambda=0',
        'custom lambda=1', 'custom lambda=0'
    ]  # Different force types
    system_types = ['complex', 'receptor', 'ligand']
    systems = dict()
    for system_type in system_types:
        systems[system_type] = dict()
    # Load standard systems.
    import simtk.pyopenmm.amber.amber_file_parser as amber
    systems['complex']['standard'] = amber.readAmberSystem(
        complex_prmtop_filename,
        mm=openmm,
        gbmodel=gbmodel,
        nonbondedCutoff=None,
        nonbondedMethod='no-cutoff',
        shake='h-bonds')
    systems['receptor']['standard'] = amber.readAmberSystem(
        receptor_prmtop_filename,
        mm=openmm,
        gbmodel=gbmodel,
        nonbondedCutoff=None,
        nonbondedMethod='no-cutoff',
        shake='h-bonds')
    systems['ligand']['standard'] = amber.readAmberSystem(
        ligand_prmtop_filename,
        mm=openmm,
        gbmodel=gbmodel,
        nonbondedCutoff=None,
#    receptor_crd_filename = 'receptor-minimized.crd'
    ligand_prmtop_filename = 'ligand.prmtop'
    ligand_crd_filename = 'ligand.crd'
#    ligand_crd_filename = 'ligand-minimized.crd'
    platform_names = ['Reference', 'Cuda', 'OpenCL']
    platform_names = ['Cuda', 'OpenCL']    

    # Create force type variants of systems.
    force_types = ['standard', 'softcore lambda=1', 'softcore lambda=0', 'custom lambda=1', 'custom lambda=0'] # Different force types
    system_types = ['complex', 'receptor', 'ligand']
    systems = dict()
    for system_type in system_types:
        systems[system_type] = dict()        
    # Load standard systems.
    import simtk.pyopenmm.amber.amber_file_parser as amber    
    systems['complex']['standard'] = amber.readAmberSystem(complex_prmtop_filename, mm=openmm, gbmodel=gbmodel, nonbondedCutoff=None, nonbondedMethod='no-cutoff', shake='h-bonds')
    systems['receptor']['standard'] = amber.readAmberSystem(receptor_prmtop_filename, mm=openmm, gbmodel=gbmodel, nonbondedCutoff=None, nonbondedMethod='no-cutoff', shake='h-bonds')
    systems['ligand']['standard'] = amber.readAmberSystem(ligand_prmtop_filename, mm=openmm, gbmodel=gbmodel, nonbondedCutoff=None, nonbondedMethod='no-cutoff', shake='h-bonds')
                
    # Determine number of particles.
    nparticles = dict()
    for system_type in system_types:
        nparticles[system_type] = systems[system_type]['standard'].getNumParticles()
    nparticles['ligand'] = nparticles['complex'] - nparticles['receptor']

    receptor_atoms = range(0,nparticles['receptor'])
    ligand_atoms = range(nparticles['receptor'], nparticles['complex'])

    # Add harmonic protein-ligand restraint.
    add_restraint = True    
    iatom = receptor_atoms[0]
Exemple #4
0
if __name__ == "__main__":
    # Create system
    system = openmm.System()

    timestep = 1.0 * units.femtoseconds

    # Set whether to use GB model or not.
    gbmodel = 'OBC'  # use OBC GBSA (gives finite error)
    #gbmodel = 'none' # no solvent model (gives zero error)

    # Load amber system for complex.
    prmtop_filename = 'complex.prmtop'
    crd_filename = 'complex.crd'
    import simtk.pyopenmm.amber.amber_file_parser as amber
    complex_system = amber.readAmberSystem(prmtop_filename,
                                           mm=openmm,
                                           gbmodel=gbmodel,
                                           shake='h-bonds')
    complex_coordinates = amber.readAmberCoordinates(crd_filename)

    # Load amber system for receptor only.
    prmtop_filename = 'receptor.prmtop'
    crd_filename = 'receptor.crd'
    receptor_system = amber.readAmberSystem(prmtop_filename,
                                            mm=openmm,
                                            gbmodel=gbmodel,
                                            shake='h-bonds')
    receptor_coordinates = amber.readAmberCoordinates(crd_filename)

    # Create alchemically-modified system where ligand is turned off.
    receptor_atoms = range(0, 2603)
    ligand_atoms = range(2603, 2621)
    temperature = 300 * units.kelvin
    kB = units.BOLTZMANN_CONSTANT_kB * units.AVOGADRO_CONSTANT_NA
    kT = kB * temperature
    beta = 1.0 / kT
    
    gbmodel = 'OBC'
    #gbmodel = None
    
    # Load amber system.
    receptor_prmtop_filename = 'receptor.prmtop'
    complex_prmtop_filename = 'complex.prmtop'
    ligand_prmtop_filename = 'ligand.prmtop'    
    complex_crd_filename = 'complex.crd'
    import simtk.pyopenmm.amber.amber_file_parser as amber
    receptor_system = amber.readAmberSystem(receptor_prmtop_filename, mm=openmm, gbmodel=gbmodel, nonbondedCutoff=None, nonbondedMethod='no-cutoff', shake='h-bonds')
    complex_system = amber.readAmberSystem(complex_prmtop_filename, mm=openmm, gbmodel=gbmodel, nonbondedCutoff=None, nonbondedMethod='no-cutoff', shake='h-bonds')
    ligand_system = amber.readAmberSystem(ligand_prmtop_filename, mm=openmm, gbmodel=gbmodel, nonbondedCutoff=None, nonbondedMethod='no-cutoff', shake='h-bonds')
    coordinates = amber.readAmberCoordinates(complex_crd_filename)

    # Create alchemically-modified system.
    receptor_atoms = range(0,receptor_system.getNumParticles())
    ligand_atoms = range(receptor_system.getNumParticles(), complex_system.getNumParticles())

    valence_lambda = 1.0
    coulomb_lambda = 0.0
    vdw_lambda = 0.0
    system = build_softcore_system(complex_system, receptor_atoms, ligand_atoms, valence_lambda, coulomb_lambda, vdw_lambda)
    #system = build_custom_system(complex_system, receptor_atoms, ligand_atoms, valence_lambda, coulomb_lambda, vdw_lambda)    
    
    # Add harmonic potential.
Exemple #6
0
    kB = units.BOLTZMANN_CONSTANT_kB * units.AVOGADRO_CONSTANT_NA
    kT = kB * temperature
    beta = 1.0 / kT

    gbmodel = 'OBC'
    #gbmodel = None

    # Load amber system.
    receptor_prmtop_filename = 'receptor.prmtop'
    complex_prmtop_filename = 'complex.prmtop'
    ligand_prmtop_filename = 'ligand.prmtop'
    complex_crd_filename = 'complex.crd'
    import simtk.pyopenmm.amber.amber_file_parser as amber
    receptor_system = amber.readAmberSystem(receptor_prmtop_filename,
                                            mm=openmm,
                                            gbmodel=gbmodel,
                                            nonbondedCutoff=None,
                                            nonbondedMethod='no-cutoff',
                                            shake='h-bonds')
    complex_system = amber.readAmberSystem(complex_prmtop_filename,
                                           mm=openmm,
                                           gbmodel=gbmodel,
                                           nonbondedCutoff=None,
                                           nonbondedMethod='no-cutoff',
                                           shake='h-bonds')
    ligand_system = amber.readAmberSystem(ligand_prmtop_filename,
                                          mm=openmm,
                                          gbmodel=gbmodel,
                                          nonbondedCutoff=None,
                                          nonbondedMethod='no-cutoff',
                                          shake='h-bonds')
    coordinates = amber.readAmberCoordinates(complex_crd_filename)
if __name__ == "__main__":
    # Create system
    system = openmm.System()

    timestep = 1.0 * units.femtoseconds

    # Set whether to use GB model or not.
    gbmodel = 'OBC' # use OBC GBSA (gives finite error)
    #gbmodel = 'none' # no solvent model (gives zero error)
    
    # Load amber system for complex.
    prmtop_filename = 'complex.prmtop'
    crd_filename = 'complex.crd'
    import simtk.pyopenmm.amber.amber_file_parser as amber
    complex_system = amber.readAmberSystem(prmtop_filename, mm=openmm, gbmodel=gbmodel, shake='h-bonds')
    complex_coordinates = amber.readAmberCoordinates(crd_filename)

    # Load amber system for receptor only.
    prmtop_filename = 'receptor.prmtop'
    crd_filename = 'receptor.crd'
    receptor_system = amber.readAmberSystem(prmtop_filename, mm=openmm, gbmodel=gbmodel, shake='h-bonds')
    receptor_coordinates = amber.readAmberCoordinates(crd_filename)

    # Create alchemically-modified system where ligand is turned off.
    receptor_atoms = range(0,2603)
    ligand_atoms = range(2603,2621)
    alchemically_modified_complex_system = build_alchemically_modified_system(complex_system, receptor_atoms, ligand_atoms)

    for platform_name in ['Cuda', 'Reference']:
        # Select platform to use.