a-r-j / graphein

Protein Graph Library
https://graphein.ai/
MIT License
1.03k stars 131 forks source link

Sequence-based Edge function #115

Closed a-r-j closed 2 years ago

a-r-j commented 2 years ago

Describe the solution you'd like Currently, we add sequence-based edges in the form of graphein.protein.edges.distance.add_peptide_bonds, which joins adjacent residues with an edge (e.g. separation=0). It would be useful to generalise this function to add edges at a specified interval. E.g:

g = construct_graph(pdb_code="3eiy")
g = add_peptide_bonds(g, step = 1)

Would add edges between nodes:

1 - 3
2 - 4
3 - 5
4 - 6
5 - 7
...

and

g = construct_graph(pdb_code="3eiy")
g = add_peptide_bonds(g, step = 5)

Would add edges between nodes:

1 - 6
2 - 7
3 - 8
4 - 9
5 - 10
...