Ejemplo n.º 1
0
import osprey

osprey.start()

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# read a PDB file for molecular info
mol = osprey.readPdb(
    '../../test-resources/4npd.A_DomainA_noH_trim_his_clean.min.pdb')

# make sure all strands share the same template library
templateLib = osprey.TemplateLibrary(ffparams.forcefld)

# define the protein strand
protein = osprey.Strand(mol, templateLib=templateLib, residues=['A1', 'A37'])
protein.flexibility['A8'].setLibraryRotamers(
    osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()

# define the ligand strand
ligand = osprey.Strand(mol, templateLib=templateLib, residues=['A38', 'A58'])
ligand.flexibility['A41'].setLibraryRotamers(
    osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
ligand.flexibility['A42'].setLibraryRotamers(
    osprey.WILD_TYPE, 'THR', 'LYS').addWildTypeRotamers().setContinuous()
ligand.flexibility['A45'].setLibraryRotamers(
    osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
ligand.flexibility['A46'].setLibraryRotamers(
    osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()

# make the conf space for the protein+ligand complex
Ejemplo n.º 2
0
def make_confspace(cfs_file, data, cfs_dir=DEFAULT_CFS_DIR):
    """make_confspace

    Generate conf spaces from input file

    Takes as input a cfs_file that contains chain definitions, flexible
    residues, and mutable residues.

    Returns a dictionary containing forcefield parameters and OSPREY
    confspace objects for:
        protein
        ligand
        complex
    """
    # Get the pdb code for this design
    data["pdb"] = cfs_file[:4]
    print("pdb: %s" % data["pdb"])

    # Load the design conformation space information
    data["cfs"] = os.path.join(cfs_dir, cfs_file)
    confspace = imp.load_source('confspace', data["cfs"])
    print("CFS File: %s" % data["cfs"])

    # Get the sequences if they exist
    try:
        data["sequences"] = confspace.sequences
    except AttributeError:
        data["sequences"] = [None]

    ffparams = osprey.ForcefieldParams()
    mol = osprey.readPdb(confspace.mol)
    template_library = osprey.TemplateLibrary(ffparams.forcefld)

    # Make sure we don't have 3 strands (some cfs files do)
    assert len(confspace.strand_defs) == 2

    # Define the protein strand
    protein = osprey.Strand(mol,
                            templateLib=template_library,
                            residues=confspace.strand_defs["strand0"])
    for resi, res_allowed in confspace.strand_flex["strand0"].iteritems():
        protein.flexibility[resi]\
                .setLibraryRotamers(osprey.WILD_TYPE, *res_allowed)\
                .setContinuous()\
                .addWildTypeRotamers()

    # Define the ligand strand
    ligand = osprey.Strand(mol,
                           templateLib=template_library,
                           residues=confspace.strand_defs["strand1"])
    for resi, res_allowed in confspace.strand_flex["strand1"].iteritems():
        ligand.flexibility[resi]\
                .setLibraryRotamers(osprey.WILD_TYPE,*res_allowed)\
                .setContinuous()\
                .addWildTypeRotamers()

    # Build spaces
    return {
        'protein': osprey.ConfSpace(protein),
        'ligand': osprey.ConfSpace(ligand),
        'complex': osprey.ConfSpace([protein, ligand]),
        'ffparams': ffparams
    }
Ejemplo n.º 3
0
import osprey
osprey.start()

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# read a PDB file for molecular info
mol = osprey.readPdb('2RL0.min.reduce.pdb')

# make sure all strands share the same template library
templateLib = osprey.TemplateLibrary(ffparams.forcefld)

# define the protein strand
protein = osprey.Strand(mol,
                        templateLib=templateLib,
                        residues=['G648', 'G654'])
protein.flexibility['G649'].setLibraryRotamers(
    osprey.WILD_TYPE, 'TYR', 'ALA', 'VAL', 'ILE',
    'LEU').addWildTypeRotamers().setContinuous()
protein.flexibility['G650'].setLibraryRotamers(
    osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
protein.flexibility['G651'].setLibraryRotamers(
    osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
protein.flexibility['G654'].setLibraryRotamers(
    osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()

# define the ligand strand
ligand = osprey.Strand(mol, templateLib=templateLib, residues=['A155', 'A194'])
ligand.flexibility['A156'].setLibraryRotamers(
    osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
ligand.flexibility['A172'].setLibraryRotamers(
import osprey

osprey.start()

mol = osprey.readPdb('1CC8.ss.pdb')

# define a strand
strand1 = osprey.Strand(mol, residues=['A2','A20'])
strand1.flexibility['A2'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers()
strand1.flexibility['A3'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers()
strand1.flexibility['A4'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers()

# define another strand
strand2 = osprey.Strand(mol, residues=['A21','A40'])
strand2.flexibility['A21'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers()
strand2.flexibility['A22'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers()
strand2.flexibility['A23'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers()

# make the conf space
confSpace = osprey.ConfSpace([strand1, strand2])

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# how to compute the energy of a conformation?
ecalc = osprey.EnergyCalculator(confSpace, ffparams)
confEcalc = osprey.ConfEnergyCalculator(confSpace, ecalc)

# how should confs be ordered and searched?
emat = osprey.EnergyMatrix(confEcalc)
Ejemplo n.º 5
0
import osprey
osprey.start()

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# INSERT SCRIPT OUTPUT HERE
mol = osprey.readPdb('../../pdb/1A0R.b.shell.pdb')
pos = [0, 1, 2, 3, 4, 5, 6, 7, 8]
posP = [0, 1, 2]
posL = [3, 4, 5, 6, 7, 8]
resNumsPL = [
    '0311', '0313', '0332', '0601', '0605', '0696', '0697', '0698', '0729'
]
resNumsP = ['0311', '0313', '0332']
resNumsL = ['0601', '0605', '0696', '0697', '0698', '0729']
startResP = '039'
endResP = '0339'
startResL = '0520'
endResL = '0729'
AATypeOptions = [[
    'HID', 'HIE', 'ASP', 'GLU', 'SER', 'THR', 'ASN', 'GLN', 'ALA', 'VAL',
    'ILE', 'LEU', 'GLY'
],
                 [
                     'ASN', 'SER', 'THR', 'GLN', 'HID', 'ALA', 'VAL', 'ILE',
                     'LEU', 'GLY', 'ALA', 'VAL', 'GLY'
                 ],
                 [
                     'TRP', 'ALA', 'VAL', 'ILE', 'LEU', 'PHE', 'TYR', 'MET',
                     'SER', 'THR', 'ASN', 'GLN', 'GLY'
Ejemplo n.º 6
0
import osprey
osprey.start()

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# read a PDB file for molecular info
mol = osprey.readPdb('2RL0.min.reduce.pdb')

# make sure all strands share the same template library
templateLib = osprey.TemplateLibrary(ffparams.forcefld)

# define the protein strand
protein = osprey.Strand(mol, templateLib=templateLib, residues=['G648', 'G654'])
protein.flexibility['G649'].setLibraryRotamers(osprey.WILD_TYPE, 'TYR', 'ALA', 'VAL', 'ILE', 'LEU').addWildTypeRotamers().setContinuous()
protein.flexibility['G650'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
protein.flexibility['G651'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
protein.flexibility['G654'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()

# define the ligand strand
ligand = osprey.Strand(mol, templateLib=templateLib, residues=['A155', 'A194'])
ligand.flexibility['A156'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
ligand.flexibility['A172'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
ligand.flexibility['A192'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
ligand.flexibility['A193'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()

# make the conf space for the protein
proteinConfSpace = osprey.ConfSpace(protein)

# make the conf space for the ligand
Ejemplo n.º 7
0
parallelism = osprey.Parallelism(cpuCores=2)
# or use GPUs
gpuPrallelism = osprey.Parallelism(cpuCores=2, gpus=1, streamsPerGpu=1)

# choose a forcefield
ffparams = osprey.ForcefieldParams(osprey.Forcefield.AMBER)
ffparams.solvationForcefield = osprey.SolvationForcefield.EEF1  # this is the default
# or turn off solvation energy
#ffparams.solvationForcefield = None

# choose a template library
# (see templateLibrary.py for more detailed examples of custom template libraries)
templateLib = osprey.TemplateLibrary()

# load a molecule
mol = osprey.readPdb('1CC8.ss.pdb')

# define the protein strand
protein = osprey.Strand(mol, residues=['A2', 'A30'])

protein.flexibility['A2'].setLibraryRotamers('ALA', 'GLY')
protein.flexibility['A3'].setLibraryRotamers(osprey.WILD_TYPE, 'VAL',
                                             'ARG').setContinuous(10)
protein.flexibility['A4'].setLibraryRotamers(
    osprey.WILD_TYPE).addWildTypeRotamers()

# make the conf space
confSpace = osprey.ConfSpace(protein)

# how should molecule energies be calculated?
ecalc = osprey.EnergyCalculator(confSpace, ffparams, parallelism=parallelism)
Ejemplo n.º 8
0
import osprey
osprey.start()

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# read a PDB file for molecular info
mol = osprey.readPdb('../../test-resources/4npd.A_DomainA_noH_trim_his_clean.min.pdb')

# make sure all strands share the same template library
templateLib = osprey.TemplateLibrary(ffparams.forcefld)

# define the protein strand
protein = osprey.Strand(mol, templateLib=templateLib, residues=['A1', 'A37'])
protein.flexibility['A8'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()

# define the ligand strand
ligand = osprey.Strand(mol, templateLib=templateLib, residues=['A38', 'A58'])
ligand.flexibility['A41'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
ligand.flexibility['A42'].setLibraryRotamers(osprey.WILD_TYPE,'THR','LYS').addWildTypeRotamers().setContinuous()
ligand.flexibility['A45'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()
ligand.flexibility['A46'].setLibraryRotamers(osprey.WILD_TYPE).addWildTypeRotamers().setContinuous()

# make the conf space for the protein+ligand complex
complexConfSpace = osprey.ConfSpace([protein, ligand])

# how should we compute energies of molecules?
# (give the complex conf space to the ecalc since it knows about all the templates and degrees of freedom)
parallelism = osprey.Parallelism(cpuCores=4)
ecalc = osprey.EnergyCalculator(complexConfSpace, ffparams, parallelism=parallelism)
Ejemplo n.º 9
0
def loadd_confspaces(config,
                     xtal_rotamers=True,
                     continuous=False,
                     force_wt=True):
    """Loads OSPREY ConfSpace objects from a config dictionary.

        OPTIONS:
            xtal_rotamers:  if true, add the rotamers from the input pdb
            continuous:     if true, set continuous rotamers
            force_wt:       if true, always add the wild-type amino acid

    """
    ffparams = osprey.ForcefieldParams()
    mol = osprey.readPdb(join(PDB, config["molecule"]))
    template_library = osprey.TemplateLibrary(ffparams.forcefld)
    # Make sure we don't have 3 strands (some cfs files do)
    if len(config["strand_definitions"]) > 2:
        exit()

    # Define the protein strand
    protein = osprey.Strand(mol,
                            templateLib=template_library,
                            residues=config["strand_definitions"]["strand0"])
    for resi, res_allowed in config["strand_mutations"]["strand0"].items():

        # Add the osprey.WILD_TYPE object to the allowed residues if desired
        if force_wt:
            res_allowed.append(osprey.WILD_TYPE)

        # Set the flexibility
        protein.flexibility[resi]\
                .setLibraryRotamers(*res_allowed)
        if xtal_rotamers:
            protein.flexibility[resi].addWildTypeRotamers()
        if continuous:
            protein.flexibility[resi].setContinuous()

    # Define the ligand strand
    ligand = osprey.Strand(mol,
                           templateLib=template_library,
                           residues=config["strand_definitions"]["strand1"])
    for resi, res_allowed in config["strand_mutations"]["strand1"].items():

        # Add the osprey.WILD_TYPE object to the allowed residues if desired
        if force_wt:
            res_allowed.append(osprey.WILD_TYPE)

        # Set the flexibility
        ligand.flexibility[resi]\
                .setLibraryRotamers(*res_allowed)
        if xtal_rotamers:
            ligand.flexibility[resi].addWildTypeRotamers()
        if continuous:
            ligand.flexibility[resi].setContinuous()

    # Build spaces
    return {
        'protein': osprey.ConfSpace(protein),
        'ligand': osprey.ConfSpace(ligand),
        'complex': osprey.ConfSpace([protein, ligand]),
        'ffparams': ffparams
    }
Ejemplo n.º 10
0
import osprey
osprey.start()

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# read a PDB file for molecular info
mol = osprey.readPdb('2hnv_prepped.pdb')

# make sure all strands share the same template library (including wild-type rotamers)
templateLib = osprey.TemplateLibrary(ffparams.forcefld, moleculesForWildTypeRotamers=[mol])

# define the protein strand
ligandStrand = osprey.Strand(mol, templateLib=templateLib, residues=['A7', 'A87'])
ligandStrand.flexibility['A25'].setLibraryRotamers(osprey.WILD_TYPE, 'ASN', 'SER').setContinuous().addWildTypeRotamers()
ligandStrand.flexibility['A36'].setLibraryRotamers(osprey.WILD_TYPE).setContinuous().addWildTypeRotamers()

# define the ligand strand
proteinStrand = osprey.Strand(mol, templateLib=templateLib, residues=['B7', 'B87'])
proteinStrand.flexibility['B81'].setLibraryRotamers(osprey.WILD_TYPE).setContinuous().addWildTypeRotamers()
proteinStrand.flexibility['B72'].setLibraryRotamers(osprey.WILD_TYPE).setContinuous().addWildTypeRotamers()

complex = osprey.EwakstarDoer_State('PL', osprey.ConfSpace([proteinStrand, ligandStrand]))

# number of CPUs
cpus = 4;

# configure EWAKStar
ewakstarDoer = osprey.EwakstarDoer(
Ejemplo n.º 11
0
import osprey
osprey.start(heapSizeMiB=200000)

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# INSERT SCRIPT OUTPUT HERE
mol = osprey.readPdb('../../pdb/1GWC.shell.pdb')
pos =  [0, 1, 2, 3, 4, 5, 6, 7, 8]
posP =  [0, 1, 2, 3, 4]
posL =  [5, 6, 7, 8]
resNumsPL =  ['C53', 'C64', 'C67', 'C71', 'C78', 'B93', 'B100', 'B101', 'B104']
resNumsP =  ['C53', 'C64', 'C67', 'C71', 'C78']
resNumsL =  ['B93', 'B100', 'B101', 'B104']
startResP =  'C7'
endResP =  'C80'
startResL =  'B89'
endResL =  'B161'
AATypeOptions =  [['HID', 'ASP', 'GLU', 'SER', 'THR', 'ASN', 'GLN', 'ALA', 'VAL', 'ILE', 'LEU', 'CYS', 'GLY'], ['ALA', 'LEU', 'ILE', 'VAL', 'PHE', 'TYR', 'MET', 'GLU', 'ASP','HID', 'ASN', 'GLN', 'GLY'], ['CYS', 'SER', 'THR', 'ASN', 'GLN', 'HIE', 'ALA', 'VAL', 'ILE', 'LEU', 'PHE', 'TYR', 'GLY'], ['ILE', 'ALA', 'LEU', 'VAL', 'PHE', 'TYR', 'MET','GLU', 'ASP', 'HID', 'ASN', 'GLN', 'GLY'], ['GLU', 'ASP', 'PHE', 'TYR', 'ALA', 'VAL', 'ILE', 'LEU', 'HIE', 'HID', 'ASN', 'GLN', 'GLY'], ['TYR', 'PHE', 'ALA', 'VAL', 'ILE','LEU', 'GLU', 'ASP', 'HID', 'HIE', 'ASN', 'GLN', 'GLY'], ['PHE', 'TYR', 'ALA', 'VAL', 'ILE', 'LEU', 'GLU', 'ASP', 'HID', 'HIE', 'ASN', 'GLN', 'GLY'], ['TRP', 'ALA', 'VAL','ILE', 'LEU', 'PHE', 'TYR', 'MET', 'SER', 'THR', 'ASN', 'GLN', 'GLY'], ['TYR', 'PHE', 'ALA', 'VAL', 'ILE', 'LEU', 'GLU', 'ASP', 'HID', 'HIE', 'ASN', 'GLN', 'GLY']]
# make sure all strands share the same template library (including wild-type rotamers)
templateLib = osprey.TemplateLibrary(ffparams.forcefld, moleculesForWildTypeRotamers=[mol])

# define the protein strand
ligand = osprey.Strand(mol, templateLib=templateLib, residues=[startResL, endResL])
for i in range(0,len(resNumsL)):
    ligand.flexibility[resNumsL[i]].setLibraryRotamers(*AATypeOptions[posL[i]]).addWildTypeRotamers().setContinuous()

# define the ligand strand
protein = osprey.Strand(mol, templateLib=templateLib, residues=[startResP, endResP])
for i in range(0,len(resNumsP)):
Ejemplo n.º 12
0
import osprey
osprey.start()

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# INSERT SCRIPT OUTPUT HERE
mol = osprey.readPdb('../../pdb/1A0R.b.shell.pdb')
pos =  [0, 1, 2, 3, 4, 5, 6, 7, 8]
posP =  [0, 1, 2]
posL =  [3, 4, 5, 6, 7, 8]
resNumsPL =  ['0311', '0313', '0332', '0601', '0605', '0696', '0697', '0698', '0729']
resNumsP =  ['0311', '0313', '0332']
resNumsL =  ['0601', '0605', '0696', '0697', '0698', '0729']
startResP =  '039'
endResP =  '0339'
startResL =  '0520'
endResL =  '0729'
AATypeOptions =  [['HID', 'HIE', 'ASP', 'GLU', 'SER', 'THR', 'ASN', 'GLN', 'ALA', 'VAL', 'ILE', 'LEU', 'GLY'], ['ASN', 'SER', 'THR', 'GLN', 'HID', 'ALA', 'VAL', 'ILE', 'LEU', 'GLY', 'ALA', 'VAL', 'GLY'], ['TRP', 'ALA', 'VAL', 'ILE', 'LEU', 'PHE', 'TYR', 'MET', 'SER', 'THR', 'ASN', 'GLN', 'GLY'], ['MET', 'ILE', 'ALA', 'VAL', 'LEU', 'PHE', 'TYR', 'GLU', 'ASP', 'HID', 'ASN', 'GLN', 'GLY'], ['LEU', 'ILE', 'ALA', 'VAL', 'PHE', 'TYR', 'MET', 'GLU', 'ASP', 'HID', 'ASN', 'GLN', 'GLY'], ['GLU', 'ASP', 'PHE', 'TYR', 'ALA', 'VAL', 'ILE', 'LEU', 'HIE', 'HID', 'ASN', 'GLN', 'GLY'], ['LEU', 'ILE', 'ALA', 'VAL', 'PHE', 'TYR', 'MET', 'GLU', 'ASP', 'HID', 'ASN', 'GLN', 'GLY'], ['LEU', 'ILE', 'ALA', 'VAL', 'PHE', 'TYR', 'MET', 'GLU', 'ASP', 'HID', 'ASN', 'GLN', 'GLY'], ['GLU', 'ASP', 'PHE', 'TYR', 'ALA', 'VAL', 'ILE', 'LEU', 'HIE', 'HID', 'ASN', 'GLN', 'GLY']]

# make sure all strands share the same template library (including wild-type rotamers)
templateLib = osprey.TemplateLibrary(ffparams.forcefld, moleculesForWildTypeRotamers=[mol])

# define the protein strand
ligand = osprey.Strand(mol, templateLib=templateLib, residues=[startResL, endResL])
for i in range(0,len(resNumsL)):
    ligand.flexibility[resNumsL[i]].setLibraryRotamers(*AATypeOptions[posL[i]]).addWildTypeRotamers().setContinuous()

# define the ligand strand
protein = osprey.Strand(mol, templateLib=templateLib, residues=[startResP, endResP])
Ejemplo n.º 13
0
import osprey

osprey.start()

# choose a forcefield
ffparams = osprey.ForcefieldParams()

# read a PDB file for molecular info
mol = osprey.readPdb('2hnv_prepped.pdb')

# make sure all strands share the same template library (including wild-type rotamers)
templateLib = osprey.TemplateLibrary(ffparams.forcefld,
                                     moleculesForWildTypeRotamers=[mol])

# define the protein strand
ligandStrand = osprey.Strand(mol,
                             templateLib=templateLib,
                             residues=['A7', 'A87'])
ligandStrand.flexibility['A25'].setLibraryRotamers(
    osprey.WILD_TYPE, 'ASN', 'SER').setContinuous().addWildTypeRotamers()
ligandStrand.flexibility['A36'].setLibraryRotamers(
    osprey.WILD_TYPE).setContinuous().addWildTypeRotamers()

# define the ligand strand
proteinStrand = osprey.Strand(mol,
                              templateLib=templateLib,
                              residues=['B7', 'B87'])
proteinStrand.flexibility['B81'].setLibraryRotamers(
    osprey.WILD_TYPE).setContinuous().addWildTypeRotamers()
proteinStrand.flexibility['B72'].setLibraryRotamers(
    osprey.WILD_TYPE).setContinuous().addWildTypeRotamers()