LPDI-EPFL / masif

MaSIF- Molecular surface interaction fingerprints. Geometric deep learning to decipher patterns in molecular surfaces.
Apache License 2.0
582 stars 154 forks source link

Getting "docked" coordinates from masif_ppi #9

Closed SenyorDrew closed 4 years ago

SenyorDrew commented 4 years ago

I have two proteins and would like to get the "docked" coordinates from masif_ppi. It looks like source/masif_ppi_search/second_stage_alignment.py perfoms an alignment of points, but I was wondering if there's another function or script that can apply the best N transformations to the input ligand in order to generate a set of N docked poses.

pablogainza commented 4 years ago

Hi! so first I recomend you do it on the source/masif_ppi_search/second_stage_alignment_nn.py file (the one that uses a neural network for scoring.)

So there are two issues, the first is how to save the PDBs.

For this you can do is go to the test_alignments function /masif/source/masif_ppi_search/alignment_utils_masif_search.py, and then add something like this:

    `structure_coords_full = np.array(
    [
        atom.get_coord() for atom in source_structure.get_atoms()
    ]
)
structure_coord_pcd_full = PointCloud()
structure_coord_pcd_full.points = Vector3dVector(structure_coords_full)`

Then you can save this:

`structure_coord_pcd_full.transform(random_transformation)
structure_coord_pcd_full.transform(transformation)`

Finally you can save this using biopython (please see https://biopython.org/DIST/docs/api/Bio.PDB.PDBIO%27.PDBIO-class.html)

Regarding your question about the best N transformations, what I suggest is that in test_aligments you only save those that have a score greater than X, something like:

if all_source_scores[j] > 0.5: rmsd, clashing, structure_coord_pcd, structure_coord_pcd_notTransformed = test_alignments( res.transformation, random_transformation, gt_source_struct, target_ca_pcd_tree, target_atom_pcd_tree, radius=0.5, )

So that it only saves hi