graphein icon indicating copy to clipboard operation
graphein copied to clipboard

`graphein.protein.edges.distance.add_distance_threshold` should allow computing distance by "any to any" atomistic even with "residue" granularity set

Open kamurani opened this issue 2 years ago • 0 comments
trafficstars

I'm wondering if there's a way to create a graph using residue granularity (i.e. coords from the alpha-carbon; applying node features per in-sequence residue of the protein etc.) but use distance threshold edges (i.e. add_distance_threshold) that do NOT use the alpha-carbon coordinates only.

I would like to create an edge between nodes (residues) if ANY of their constituent atoms are within the threshold distance of eachother.

new_edge_funcs = {"edge_construction_functions": [
    partial(
    add_distance_threshold, long_interaction_threshold=LONG_INTERACTION_THRESHOLD, threshold=NODE_DISTANCE_THRESHOLD)
]}
config = ProteinGraphConfig(
    granularity="CA",
    **new_edge_funcs,
)
# Edge construction function relies on alpha carbon coordinates alone and won't create edges between certain nodes

Is there a clean way to do this?

kamurani avatar Sep 13 '23 03:09 kamurani