Skip to content

Commit

Permalink
fix peptide bonds for all atom graphs (#254)
Browse files Browse the repository at this point in the history
* fix peptide bonds for all atom graphs

* update changelog

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
a-r-j and pre-commit-ci[bot] committed Jan 26, 2023
1 parent 47c4d0e commit 4634887
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
### 1.5.3 - UNRELEASED


#### Improvements
* [Logging] - [#221](https://github.com/a-r-j/graphein/pull/221) Adds global control of logging with `graphein.verbose(enabled=False)`.
* [Logging] - [#242](https://github.com/a-r-j/graphein/pull/242) Adds control of protein graph construction logging. Resolves [#238](https://github.com/a-r-j/graphein/issues/238)

#### Protein

* [Bugfix] - [#254](https://github.com/a-r-j/graphein/pull/254) Fix peptide bond addition for all atom graphs.
* [Bugfix] - [#223](https://github.com/a-r-j/graphein/pull/220) Fix handling of insertions in protein graphs. Insertions are now given IDs like: `A:SER:12:A`. Contribution by @manonreau.
* [Bugfix] - [#226](https://github.com/a-r-j/graphein/pull/226) Catches failed AF2 structure downloads [#225](https://github.com/a-r-j/graphein/issues/225)
* [Feature] - [#229](https://github.com/a-r-j/graphein/pull/220) Adds support for filtering KNN edges based on self-loops and chain membership. Contribution by @anton-bushuiev.
Expand Down
9 changes: 9 additions & 0 deletions graphein/protein/edges/distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@ def add_sequence_distance_edges(
(n, v) for n, v in G.nodes(data=True) if v["chain_id"] == chain_id
]

# Subset to only N and C atoms in the case of full-atom
# peptide bond addition
if G.graph["config"].granularity == "atom" and name == "peptide_bond":
chain_residues = [
(n, v)
for n, v in chain_residues
if v["atom_type"] in {"N", "C"}
]

# Iterate over every residue in chain
for i, residue in enumerate(chain_residues):
try:
Expand Down

0 comments on commit 4634887

Please sign in to comment.