Exemplo n.º 1
0
        allCoords[proteinPdbPrefix] = numpy.array(allCoords[proteinPdbPrefix])
        centerCoords[proteinPdbPrefix] = [numpy.mean(allCoords[proteinPdbPrefix][:,0]),
                                          numpy.mean(allCoords[proteinPdbPrefix][:,1]),
                                          numpy.mean(allCoords[proteinPdbPrefix][:,2])]
        # Generate the PDB map
        sideLength = 30
        protein_boundaries = [centerCoords[proteinPdbPrefix][0] - sideLength,
                              centerCoords[proteinPdbPrefix][0] + sideLength,
                              centerCoords[proteinPdbPrefix][1] - sideLength,
                              centerCoords[proteinPdbPrefix][1] + sideLength,
                              centerCoords[proteinPdbPrefix][2] - sideLength,
                              centerCoords[proteinPdbPrefix][2] + sideLength]
        protein_molecule = pymolecule.Molecule()
        protein_molecule.fileio.load_pdb_into(pdbFileName, serial_reindex=True, resseq_reindex=False)
        protein_peel = peel.peel(protein_molecule, my_params)
        protein_feature_maps = protein_peel.create_feature_maps(protein_boundaries,
                                                                gridResolution,
                                                                features = features)
        # Now save the featureMaps for this protein
        #with gzip.open('%s/%s_featureMaps.cPickle.gz' %(proteinFmOutputDir, proteinPdbPrefix),'wb') as my_file:
        my_file = gzip.open('%s/%s_featureMaps.cPickle.gz' %(proteinFmOutputDir, proteinPdbPrefix),'wb')
        cPickle.dump(protein_feature_maps, my_file, protocol=2)
        my_file.close()
    else:
        #If the job is marked as started, let's see if it's finished. If so, load that receptor map
        if os.path.exists('%s/%s_featureMaps.cPickle.gz' %(proteinFmOutputDir, proteinPdbPrefix)):
            #with gzip.open('%s/%s_featureMaps.cPickle.gz' %(proteinFmOutputDir, proteinPdbPrefix),'rb') as my_file:
            my_file = gzip.open('%s/%s_featureMaps.cPickle.gz' %(proteinFmOutputDir, proteinPdbPrefix),'rb')
            protein_feature_maps = cPickle.load(my_file)
            my_file.close()
Exemplo n.º 2
0
import packages.binana.peel as peel
#import packages.pymolecule.pymolecule as pymolecule
#import numpy
my_params = peel.defaultParams
#my_protein = pymolecule.Molecule()
ligand = peel.PDB()

ligand.LoadPDB('3CZ_reduced.pdb')
#my_protein.fileio.load_pdb_into('3CZ_reduced.pdb', bonds_by_distance=True, serial_reindex=True, resseq_reindex=False)

my_peel = peel.peel(ligand, my_params, isLigand=True)
my_peel.write_vmd_script('visualize_lig.vmd', peel.defaultParams)

#povmeMap = numpy.ones((13,13,13))

#my_peel.color_povme_map(povmeMap, [0,13,0,13,0,13], 1)
my_feature_maps = my_peel.create_feature_maps([50, 70, -30, -10, 45, 65], 1)

my_feature_maps['occupancy'].write_dx_file('OCC.dx')
my_feature_maps['hbondAcceptor'].write_pdb('HBA.pdb')
#There are no hbond donor groups on the ligand
#my_feature_maps['hbondDonor'].write_pdb('HBD.pdb')
my_feature_maps['aromatic'].write_pdb('ARO.pdb')
my_feature_maps['aromatic'].write_dx_file('ARO.dx')
my_feature_maps['hydrophobic'].write_pdb('HBC.pdb')
my_feature_maps['hydrophilic'].write_pdb('HPL.pdb')
#This is a bad feature
#my_feature_maps['hydrophobicity'].write_pdb('HPBTY.pdb')
#my_feature_maps['hydrophobicity'].write_dx_file('HPBTY.dx')

#HBAMap = my_feature_maps[0].data
Exemplo n.º 3
0
import packages.binana.peel as peel
import packages.pymolecule.pymolecule as pymolecule
my_params = peel.defaultParams
trp = pymolecule.Molecule()
trp.fileio.load_pdb_into('trp.pdb',
                         bonds_by_distance=True,
                         serial_reindex=True,
                         resseq_reindex=False)
my_peel = peel.peel(trp, my_params)
my_peel.write_vmd_script('visualize_trp.vmd', peel.defaultParams)

my_feature_maps = my_peel.create_feature_maps([-20, 20, -20, 20, -20, 20], 0.5)
my_feature_maps['hbondAcceptor'].write_pdb('HBA.pdb')
my_feature_maps['hbondDonor'].write_pdb('HBD.pdb')
my_feature_maps['aromatic'].write_pdb('ARO.pdb')

print "Done!"
Exemplo n.º 4
0
import packages.pymolecule.pymolecule as pymolecule
import packages.binana.peel as peel
import sys
#print sys.modules




my_params = peel.defaultParams

#DEFAULT
#arg = pymolecule.FileIO.load_pdb_into( 'arg.pdb', bonds_by_distance=True, serial_reindex = True, resseq_reindex=False)
arg = pymolecule.Molecule()
arg.fileio.load_pdb_into( 'arg.pdb', bonds_by_distance=True, serial_reindex = True, resseq_reindex=False)

my_peel = peel.peel(arg, my_params)
my_peel.write_vmd_script('visualize_arg.vmd', peel.defaultParams)


my_feature_maps = my_peel.create_feature_maps([-10,15,-5,15,-10,15], 1)
my_feature_maps['hbondAcceptor'].write_pdb('HBA.pdb')
my_feature_maps['hbondAcceptor'].write_dx_file('HBA.dx')
my_feature_maps['hbondDonor'].write_pdb('HBD.pdb')
my_feature_maps['hbondDonor'].write_dx_file('HBD.dx')
my_feature_maps['occupancy'].write_dx_file('OCC.dx')
#my_feature_maps['aromatic'].write_pdb('ARO.pdb') #don't bother with this
my_feature_maps['hydrophobic'].write_pdb('HBC.pdb')
my_feature_maps['hydrophilic'].write_pdb('HPL.pdb')
#my_feature_maps['hydrophobicity'].write_pdb('HPBTY.pdb')
#my_feature_maps['hydrophobicity'].write_dx_file('HPBTY.dx')
#HBAMap = my_feature_maps[0].data
Exemplo n.º 5
0
import packages.binana.peel as peel
import packages.pymolecule.pymolecule as pymolecule

part_1 = pymolecule.Molecule()
part_1.fileio.load_pdb_into('helixPt1.pdb')

part_2 = pymolecule.Molecule()
part_2.fileio.load_pdb_into('helixPt2.pdb')

#peel_1.write_vmd_script_file('peel1.vmd'')

peel_1 = peel.peel(part_1, peel.defaultParams)
fmaps_1 = peel_1.create_feature_maps([25, 55, -25, 5, -15, 15], 1,
                                     ['hbondDonor', 'hbondAcceptor'])
peel_2 = peel.peel(part_2, peel.defaultParams)
fmaps_2 = peel_2.create_feature_maps([25, 55, -25, 5, -15, 15], 1,
                                     ['hbondDonor', 'hbondAcceptor'])

#peel_1.write_vmd_script_file('peel_1.vmd')
#peel_2.write_vmd_script_file('peel_2.vmd')

fmaps_1['hbondDonor'].write_dx_file('hbd1.dx')
fmaps_1['hbondAcceptor'].write_dx_file('hba1.dx')
fmaps_2['hbondDonor'].write_dx_file('hbd2.dx')
fmaps_2['hbondAcceptor'].write_dx_file('hba2.dx')

my_algebra = peel.algebra()
my_algebra.setScoreFuncs(
    ['hbondAcceptor_A * hbondDonor_B', 'hbondAcceptor_B * hbondDonor_A'])
my_score_maps, my_scores = my_algebra.scoreAll(fmaps_1, fmaps_2)
Exemplo n.º 6
0
import packages.binana.peel as peel
import packages.pymolecule.pymolecule as pymolecule
import numpy
features = ['aromatic','hbondDonor','hbondAcceptor','hydrophobic','hydrophilic','hydrophobicity','occupancy']

mostly_empty = pymolecule.Molecule()
mostly_empty.fileio.load_pdb_into('mostly_empty.pdb')

my_peel = peel.peel(mostly_empty, peel.defaultParams)

one_point_fmaps_1 = my_peel.create_feature_maps([0,0,0,0,0,0], 1, features)
one_point_fmaps_2 = my_peel.create_feature_maps([0,0,0,0,0,0], 1, features)

print
print '======Beginning scoring ======'
for i in range(len(features)):
    #So the point of featuremap_1 for aromatic will be set to 0, hBondDonor 2, etc...
    one_point_fmaps_1[features[i]].setData(numpy.array([[[2*i]]]))
    #So the point of featuremap_2 for aromatic will be set to 1, hBondDonor 3, etc...
    one_point_fmaps_2[features[i]].setData(numpy.array([[[(2*i)+1]]]))
    print 'Setting %s to be %i for featuremap_A and %i for featuremap_B' %(features[i], i*2, (i*2)+1)


my_algebra = peel.algebra()
my_score_funcs = ['hbondAcceptor_A * hbondDonor_B', 'hbondAcceptor_B * hbondDonor_A']
my_algebra.setScoreFuncs(my_score_funcs)
my_score_maps, my_scores = my_algebra.scoreAll(one_point_fmaps_1, one_point_fmaps_2)
print '\n'.join(['%.5e\t%s'%(score, func) for func, score in zip(my_score_funcs, my_scores)])


Exemplo n.º 7
0
import packages.binana.peel as peel
import packages.pymolecule.pymolecule as pymolecule

part_1 = pymolecule.Molecule()
part_1.fileio.load_pdb_into('helixPt1.pdb')

part_2 = pymolecule.Molecule()
part_2.fileio.load_pdb_into('helixPt2.pdb')

#peel_1.write_vmd_script_file('peel1.vmd'')

peel_1 = peel.peel(part_1, peel.defaultParams)
fmaps_1 = peel_1.create_feature_maps([25,55,-25,5,-15,15], 1, ['hbondDonor','hbondAcceptor'])
peel_2 = peel.peel(part_2, peel.defaultParams)
fmaps_2 = peel_2.create_feature_maps([25,55,-25,5,-15,15], 1, ['hbondDonor','hbondAcceptor'])

#peel_1.write_vmd_script_file('peel_1.vmd')
#peel_2.write_vmd_script_file('peel_2.vmd')

fmaps_1['hbondDonor'].write_dx_file('hbd1.dx')
fmaps_1['hbondAcceptor'].write_dx_file('hba1.dx')
fmaps_2['hbondDonor'].write_dx_file('hbd2.dx')
fmaps_2['hbondAcceptor'].write_dx_file('hba2.dx')

my_algebra = peel.algebra()
my_algebra.setScoreFuncs(['hbondAcceptor_A * hbondDonor_B',
                          'hbondAcceptor_B * hbondDonor_A'])
my_score_maps, my_scores = my_algebra.scoreAll(fmaps_1, fmaps_2)

my_score_maps[0].write_dx_file('term1.dx')
my_score_maps[1].write_dx_file('term2.dx')
Exemplo n.º 8
0
import packages.binana.peel as peel
#import packages.pymolecule.pymolecule as pymolecule
#import numpy
my_params = peel.defaultParams
#my_protein = pymolecule.Molecule()
ligand = peel.PDB()

ligand.LoadPDB('3CZ_reduced.pdb')
#my_protein.fileio.load_pdb_into('3CZ_reduced.pdb', bonds_by_distance=True, serial_reindex=True, resseq_reindex=False)


my_peel = peel.peel(ligand, my_params, isLigand=True)
my_peel.write_vmd_script('visualize_lig.vmd', peel.defaultParams)

#povmeMap = numpy.ones((13,13,13))

#my_peel.color_povme_map(povmeMap, [0,13,0,13,0,13], 1)
my_feature_maps = my_peel.create_feature_maps([50,70,-30,-10,45,65], 1)

my_feature_maps['occupancy'].write_dx_file('OCC.dx')
my_feature_maps['hbondAcceptor'].write_pdb('HBA.pdb')
#There are no hbond donor groups on the ligand
#my_feature_maps['hbondDonor'].write_pdb('HBD.pdb') 
my_feature_maps['aromatic'].write_pdb('ARO.pdb')
my_feature_maps['aromatic'].write_dx_file('ARO.dx')
my_feature_maps['hydrophobic'].write_pdb('HBC.pdb')
my_feature_maps['hydrophilic'].write_pdb('HPL.pdb')
#This is a bad feature
#my_feature_maps['hydrophobicity'].write_pdb('HPBTY.pdb')
#my_feature_maps['hydrophobicity'].write_dx_file('HPBTY.dx')
Exemplo n.º 9
0
receptorData = {}
#ligandData = {}
for feature in features:
    #thisReceptorName = 'proteinFM/%s%s_.npy' %(receptorName, feature)
    thisReceptorName = '%s%s_.npy' % (receptorName, feature)
    thisReceptorData = numpy.load(thisReceptorName)
    receptorData[feature] = peel.featureMap.fromPovmeList(thisReceptorData, 1.)

#with open('ligandFM/%s_featureMaps.cPickle' %(ligandName)) as my_file:
#    ligandData = cPickle.load(my_file)

my_params = peel.defaultParams

ligand_molecule = peel.PDB()
ligand_molecule.LoadPDB(ligandName)
ligand_peel = peel.peel(ligand_molecule, my_params, isLigand=True)
my_algebra = peel.algebra()

#scoreMaps, scores = my_algebra.scoreAll(receptorData, ligandData)

number = str(5)
nsteps = str(500)

outputFile = number + "_" + nsteps
#os.system('/lv_scratch/j5wagner/projects/POVME_docking_inputs/points_on_sphere/4d_points_on_sphere.o ' + number + " " + nsteps + " > " + outputFile + '.out')
spherePoints = numpy.genfromtxt(outputFile + '.out',
                                skip_header=3,
                                skip_footer=0,
                                usecols=(4, 5, 6, 7),
                                comments='}')
#spherePoints = [[0,1,0,0]]
Exemplo n.º 10
0
import packages.binana.peel as peel
import packages.pymolecule.pymolecule as pymolecule
my_params = peel.defaultParams
trp = pymolecule.Molecule()
trp.fileio.load_pdb_into( 'trp.pdb', bonds_by_distance=True, serial_reindex = True, resseq_reindex=False)
my_peel = peel.peel(trp, my_params)
my_peel.write_vmd_script('visualize_trp.vmd', peel.defaultParams)


my_feature_maps = my_peel.create_feature_maps([-20,20,-20,20,-20,20], 0.5)
my_feature_maps['hbondAcceptor'].write_pdb('HBA.pdb')
my_feature_maps['hbondDonor'].write_pdb('HBD.pdb')
my_feature_maps['aromatic'].write_pdb('ARO.pdb')

print "Done!"
Exemplo n.º 11
0
import packages.binana.peel as peel
import packages.pymolecule.pymolecule as pymolecule
import numpy
features = [
    'aromatic', 'hbondDonor', 'hbondAcceptor', 'hydrophobic', 'hydrophilic',
    'hydrophobicity', 'occupancy'
]

mostly_empty = pymolecule.Molecule()
mostly_empty.fileio.load_pdb_into('mostly_empty.pdb')

my_peel = peel.peel(mostly_empty, peel.defaultParams)

one_point_fmaps_1 = my_peel.create_feature_maps([0, 0, 0, 0, 0, 0], 1,
                                                features)
one_point_fmaps_2 = my_peel.create_feature_maps([0, 0, 0, 0, 0, 0], 1,
                                                features)

print
print '======Beginning scoring ======'
for i in range(len(features)):
    #So the point of featuremap_1 for aromatic will be set to 0, hBondDonor 2, etc...
    one_point_fmaps_1[features[i]].setData(numpy.array([[[2 * i]]]))
    #So the point of featuremap_2 for aromatic will be set to 1, hBondDonor 3, etc...
    one_point_fmaps_2[features[i]].setData(numpy.array([[[(2 * i) + 1]]]))
    print 'Setting %s to be %i for featuremap_A and %i for featuremap_B' % (
        features[i], i * 2, (i * 2) + 1)

my_algebra = peel.algebra()
my_score_funcs = [
    'hbondAcceptor_A * hbondDonor_B', 'hbondAcceptor_B * hbondDonor_A'
Exemplo n.º 12
0
receptorData = {}
#ligandData = {}
for feature in features:
    #thisReceptorName = 'proteinFM/%s%s_.npy' %(receptorName, feature)
    thisReceptorName = '%s/%s%s_.npy' % (receptorDir, receptorName, feature)
    thisReceptorData = numpy.load(thisReceptorName)
    receptorData[feature] = peel.featureMap.fromPovmeList(thisReceptorData, 1.)

#with open('%s/%s.pdb' %(ligandDir, ligandName)) as my_file:
#ligandData = cPickle.load(my_file)

ligandFile = '%s/%s' % (ligandDir, ligandName)
ligandObj = peel.PDB()
ligandObj.LoadPDB(ligandFile)
ligandPeel = peel.peel(ligandObj, peel.defaultParams, isLigand=True)

my_algebra = peel.algebra()

#scoreMaps, scores = my_algebra.scoreAll(receptorData, ligandData)

number = str(5)
nsteps = str(500)

outputFile = number + "_" + nsteps
#os.system('/lv_scratch/j5wagner/projects/POVME_docking_inputs/points_on_sphere/4d_points_on_sphere.o ' + number + " " + nsteps + " > " + outputFile + '.out')
spherePoints = numpy.genfromtxt(outputFile + '.out',
                                skip_header=3,
                                skip_footer=0,
                                usecols=(4, 5, 6, 7),
                                comments='}')
Exemplo n.º 13
0
receptorData = {}
#ligandData = {}
for feature in features:
    #thisReceptorName = 'proteinFM/%s%s_.npy' %(receptorName, feature)
    thisReceptorName = '%s/%s%s_.npy' %(receptorDir, receptorName, feature)
    thisReceptorData = numpy.load(thisReceptorName)
    receptorData[feature] = peel.featureMap.fromPovmeList(thisReceptorData, 1.)


#with open('%s/%s.pdb' %(ligandDir, ligandName)) as my_file:
    #ligandData = cPickle.load(my_file)

ligandFile = '%s/%s' %(ligandDir,ligandName)
ligandObj = peel.PDB()
ligandObj.LoadPDB(ligandFile)
ligandPeel = peel.peel(ligandObj, peel.defaultParams, isLigand=True)

my_algebra = peel.algebra()

#scoreMaps, scores = my_algebra.scoreAll(receptorData, ligandData)



number = str(5)
nsteps = str(500)

outputFile = number + "_" + nsteps
#os.system('/lv_scratch/j5wagner/projects/POVME_docking_inputs/points_on_sphere/4d_points_on_sphere.o ' + number + " " + nsteps + " > " + outputFile + '.out')
spherePoints = numpy.genfromtxt(outputFile + '.out',skip_header=3, skip_footer=0, usecols=(4,5,6,7), 
comments='}')
spherePoints[0,:] = numpy.array([0.,1.,0.,0.])
Exemplo n.º 14
0
     ]
     # Generate the PDB map
     sideLength = 30
     protein_boundaries = [
         centerCoords[proteinPdbPrefix][0] - sideLength,
         centerCoords[proteinPdbPrefix][0] + sideLength,
         centerCoords[proteinPdbPrefix][1] - sideLength,
         centerCoords[proteinPdbPrefix][1] + sideLength,
         centerCoords[proteinPdbPrefix][2] - sideLength,
         centerCoords[proteinPdbPrefix][2] + sideLength
     ]
     protein_molecule = pymolecule.Molecule()
     protein_molecule.fileio.load_pdb_into(pdbFileName,
                                           serial_reindex=True,
                                           resseq_reindex=False)
     protein_peel = peel.peel(protein_molecule, my_params)
     protein_feature_maps = protein_peel.create_feature_maps(
         protein_boundaries, gridResolution, features=features)
     # Now save the featureMaps for this protein
     #with gzip.open('%s/%s_featureMaps.cPickle.gz' %(proteinFmOutputDir, proteinPdbPrefix),'wb') as my_file:
     my_file = gzip.open(
         '%s/%s_featureMaps.cPickle.gz' %
         (proteinFmOutputDir, proteinPdbPrefix), 'wb')
     cPickle.dump(protein_feature_maps, my_file, protocol=2)
     my_file.close()
 else:
     #If the job is marked as started, let's see if it's finished. If so, load that receptor map
     if os.path.exists('%s/%s_featureMaps.cPickle.gz' %
                       (proteinFmOutputDir, proteinPdbPrefix)):
         #with gzip.open('%s/%s_featureMaps.cPickle.gz' %(proteinFmOutputDir, proteinPdbPrefix),'rb') as my_file:
         my_file = gzip.open(
Exemplo n.º 15
0
import packages.binana.peel as peel
import packages.pymolecule.pymolecule as pymolecule
#import numpy
my_params = peel.defaultParams
my_protein = pymolecule.Molecule()
my_protein.fileio.load_pdb_into('2gfc_reduced.pdb',
                                serial_reindex=True,
                                resseq_reindex=False)

my_peel = peel.peel(my_protein, my_params)
my_peel.write_vmd_script('visualize_2gfc.vmd', peel.defaultParams)

#povmeMap = numpy.ones((13,13,13))

#my_peel.color_povme_map(povmeMap, [0,13,0,13,0,13], 1)
# If given no "features" argument, create_feature_maps will create maps of all features
my_feature_maps = my_peel.create_feature_maps([10, 80, -30, 45, -30, 30], 1)

my_feature_maps['hbondAcceptor'].write_pdb('HBA.pdb')
my_feature_maps['hbondAcceptor'].write_dx_file('HBA.dx')
my_feature_maps['hbondDonor'].write_pdb('HBD.pdb')
my_feature_maps['hbondDonor'].write_dx_file('HBD.dx')
my_feature_maps['aromatic'].write_pdb('ARO.pdb')
my_feature_maps['aromatic'].write_dx_file('ARO.dx')
my_feature_maps['hydrophobic'].write_pdb('HPB.pdb')
my_feature_maps['hydrophobic'].write_dx_file('HPB.dx')
my_feature_maps['hydrophilic'].write_pdb('HPL.pdb')
my_feature_maps['hydrophilic'].write_dx_file('HPL.dx')
#my_feature_maps['hydrophobicity'].write_pdb('HPBTY.pdb')
#my_feature_maps['hydrophobicity'].write_dx_file('HPBTY.dx')
Exemplo n.º 16
0
import packages.pymolecule.pymolecule as pymolecule
import packages.binana.peel as peel
import sys
#print sys.modules

my_params = peel.defaultParams

#DEFAULT
#arg = pymolecule.FileIO.load_pdb_into( 'arg.pdb', bonds_by_distance=True, serial_reindex = True, resseq_reindex=False)
arg = pymolecule.Molecule()
arg.fileio.load_pdb_into('arg.pdb',
                         bonds_by_distance=True,
                         serial_reindex=True,
                         resseq_reindex=False)

my_peel = peel.peel(arg, my_params)
my_peel.write_vmd_script('visualize_arg.vmd', peel.defaultParams)

my_feature_maps = my_peel.create_feature_maps([-10, 15, -5, 15, -10, 15], 1)
my_feature_maps['hbondAcceptor'].write_pdb('HBA.pdb')
my_feature_maps['hbondAcceptor'].write_dx_file('HBA.dx')
my_feature_maps['hbondDonor'].write_pdb('HBD.pdb')
my_feature_maps['hbondDonor'].write_dx_file('HBD.dx')
my_feature_maps['occupancy'].write_dx_file('OCC.dx')
#my_feature_maps['aromatic'].write_pdb('ARO.pdb') #don't bother with this
my_feature_maps['hydrophobic'].write_pdb('HBC.pdb')
my_feature_maps['hydrophilic'].write_pdb('HPL.pdb')
#my_feature_maps['hydrophobicity'].write_pdb('HPBTY.pdb')
#my_feature_maps['hydrophobicity'].write_dx_file('HPBTY.dx')
#HBAMap = my_feature_maps[0].data
#print HBAMap