LPDI-EPFL / masif

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

some questions about " compute_iface" #55

Open pearl-rabbit opened 1 year ago

pearl-rabbit commented 1 year ago

Hello,@FreyrS .Could you answer the following two questions for me?Thank you in advance. ① In "01-pdb_extract_and_triangulate.py",what are the functions oflines 90-110? ② What is the meaning of d >= 2.0?Can it be set to other values? ③ What's the meaning of 'iface'.Can I set the value of "masif_opts ['compute_iface ']" to False?

Here are 90-110 lines of code: if 'compute_iface' in masif_opts and masif_opts['compute_iface']:

Compute the surface of the entire complex and from that compute the interface.

v3, f3, _, _, _ = computeMSMS(pdb_filename,\
    protonate=True)
# Regularize the mesh
mesh = pymesh.form_mesh(v3, f3)
# I believe It is not necessary to regularize the full mesh. This can speed up things by a lot.
full_regular_mesh = mesh
# Find the vertices that are in the iface.
v3 = full_regular_mesh.vertices
# Find the distance between every vertex in regular_mesh.vertices and those in the full complex.
kdt = KDTree(v3)
d, r = kdt.query(regular_mesh.vertices)
d = np.square(d) # Square d, because this is how it was in the pyflann version.
assert(len(d) == len(regular_mesh.vertices))
iface_v = np.where(d >= 2.0)[0]
iface[iface_v] = 1.0
# Convert to ply and save.
save_ply(out_filename1+".ply", regular_mesh.vertices,\
                    regular_mesh.faces, normals=vertex_normal, charges=vertex_charges,\
                    normalize_charges=True, hbond=vertex_hbond, hphob=vertex_hphobicity,\
                    iface=iface)
maxy0617 commented 1 year ago

Hi! 'iface' stands for 'interaction face', for Q2, d is the distance between the two interacting subelements. According to my using experience, for your Q3, if you are running masif on a single chain, it's ok to set masif_opts ['compute_iface '] = False, as for a single chain the output will be all zeros. Hope this is helpful.