-
-
Notifications
You must be signed in to change notification settings - Fork 139
Description
I have found quite a severe bug in construct_graph when using the add_distance_threshold edge construction function.
Essentially, spurious edges are added to the graph that should not appear, based on the provided threshold distance in Angstroms.
I have decided to make an issue here ASAP before I can diagnose this but I intend to track down why this is happening.
This is potentially a very serious bug as using threshold_distance edges is a common protein graph construction technique and may result in people being unaware of the true structure of their data.
Version
- MacOSX
- Python 3.12.4
import graphein
graphein.__version__
# '1.7.7'Steps to reproduce bug
Download AlphaFold predicted structure here
uniprot_id = "P04629"
from functools import partial
from graphein.protein import construct_graph
from graphein.protein.config import ProteinGraphConfig
from graphein.protein.edges.distance import add_distance_threshold
u, v = 'A:MET:1', 'A:LEU:526'
new_edge_funcs = {"edge_construction_functions": [partial(add_distance_threshold, long_interaction_threshold=5, threshold=10.)]}
config = ProteinGraphConfig(**new_edge_funcs)
g_dist_all = construct_graph(
path = f"{uniprot_id}.pdb",
config=config,
)
g_dist_all.get_edge_data(u, v)
# {'kind': {'distance_threshold'}, 'distance': 48.41152358823357}Note that this edge mysteriously appears, despite the node-node distance being well over the threshold distance specified!
Metadata
Metadata
Assignees
Labels
No labels