Exemple #1
0
def combine_score(pdbfile,
                  recepChain,
                  ligChain,
                  statpotrun=True,
                  vdwrun=True,
                  electrorun=True,
                  shaperun=True,
                  pH=True,
                  depth="msms",
                  dist=8.6):
    combined_dict = {}
    my_struct = pdbtools.read_pdb(pdbfile)
    depth_dict = pdb_resdepth.calculate_resdepth(structure=my_struct,
                                                 pdb_filename=pdbfile,
                                                 method=depth)
    distmat = matrice_distances.calc_distance_matrix(structure=my_struct,
                                                     depth=depth_dict,
                                                     chain_R=recepChain,
                                                     chain_L=ligChain,
                                                     dist_max=dist,
                                                     method=depth)

    combined_dict["pdb"] = pdbfile.split("/")[-1]
    if statpotrun == True:
        statpot = knowledge.parse_distance_mat(distmat, method=["glaser"])
        combined_dict["statpot"] = statpot
    if vdwrun == True:
        vdw = Lennard_Jones.lennard_jones(dist_matrix=distmat)
        combined_dict["vdw"] = vdw
    if electrorun == True:
        electro = electrostatic.electrostatic(inter_resid_dict=distmat, pH=pH)
        combined_dict["electro"] = electro
    if shaperun == True:
        shape = shape_complement.runshape(structure=my_struct,
                                          recepChain=recepChain,
                                          depth_dict=depth_dict,
                                          ligChain=ligChain,
                                          method=depth)
        combined_dict["shape"] = shape
    # foldx = TOADD

    return (combined_dict)
               input2 (BioPDB Structure): Complex's structure
        OUPUT:
               result(List): atom coordinates
    """

    chain = aa[0]
    code = aa[1]
    position = aa[2]
    coord = None

    if code == 'GLY':
        atom = structure[0][chain][int(position)]['CA']

        return atom.get_coord()
    elif code in [
            'PRO', 'ALA', 'VAL', 'LEU', 'ILE', 'MET', 'CYS', 'PHE', 'TYR',
            'TRP', 'HIS', 'LYS', 'ARG', 'GLN', 'ASN', 'GLU', 'ASP', 'SER',
            'THR'
    ]:
        atom = structure[0][chain][position]['CB']
        return atom.get_coord()
    return 'Error'


if __name__ == '__main__':

    structure = pdbt.read_pdb("2za4_modified.pdb")
    depth = resd.calculate_resdepth(structure, "2za4_modified.pdb")
    dist_matrix = calc_distance_matrix(structure, depth, ["A"], ["B"])
    parse_distance_mat(dist_matrix, ['glaser', 'pons_surf'])
Exemple #3
0
    '''
        Calculating Lennard-Jones potential

        INPUT:
               input1(Dictionary): Distances dictionary. Output of calc_distance_matrix() function
               input2 (Float): sigma value for Lennard-Jones function. Default value: 3.9
               input3 (Int): epsilon value for Lennard-Jones function. Default value: 10
        OUPUT:
               result(Float): Lennard-Jones energy value for the complex

    '''

    energy = 0

    for dist in dist_matrix.values():
        frac = pow((sigma / dist), 6)
        part_energy = 4 * epsilon * (pow(frac, 2) - frac)
        energy += part_energy

    return energy


if __name__ == "__main__":

    filename = sys.argv[1]
    structure = pdbt.read_pdb(filename)
    depth = resd.calculate_resdepth(structure, filename)
    dist_matrix = distm.calc_distance_matrix(structure, depth, chain_recp,
                                             chain_lig)
    lennard_jones(dist_matrix)
Exemple #4
0
    rec_grid = dict_to_mat(grid_dict=rec_grid_dict,
                           L=grid_parameters[0],
                           resolution=resolution)
    lig_grid = dict_to_mat(grid_dict=lig_grid_dict,
                           L=grid_parameters[0],
                           resolution=resolution)

    result = multi_mat(rec_grid=rec_grid, lig_grid=lig_grid)
    return (result)


if __name__ == "__main__":
    """
    Usage for testing
        shape_complement.py path/to/complex.pdb recepChain1,recepChainN ligChain1,ligChainN
    """
    myfile = sys.argv[1]
    recepChain = sys.argv[2].split(",")
    ligChain = sys.argv[3].split(",")
    my_struct = pdbtools.read_pdb(myfile)
    depth_dict = pdb_resdepth.calculate_resdepth(structure=my_struct,
                                                 pdb_filename=myfile)
    tmp = runshape(structure=my_struct,
                   recepChain=recepChain,
                   ligChain=ligChain,
                   depth_dict=depth_dict,
                   resolution=2,
                   depthCutoff=4,
                   resScale="atom")
    print(tmp)