Skip to content

Commit

Permalink
contacts: handle rare cases where a residue itself can be disordered
Browse files Browse the repository at this point in the history
  • Loading branch information
avivrosenberg committed Mar 3, 2024
1 parent 8269403 commit 8d7dabe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/pp5/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import pandas as pd
from Bio.PDB import NeighborSearch
from Bio.PDB.Atom import Atom
from Bio.PDB.Residue import Residue
from Bio.PDB.Residue import Residue, DisorderedResidue

import pp5
from pp5.codons import ACIDS_3TO1, UNKNOWN_AA
Expand Down Expand Up @@ -184,6 +184,12 @@ def __init__(

def assign(self, res: Residue) -> Dict[str, Optional[ResidueContacts]]:

# In rare cases, a residue may be disordered and contain other residues.
# This means there's a point mutation and both original and mutated residues
# are present in the crystal. We ignore this and just use the selected residue.
if isinstance(res, DisorderedResidue):
res = res.disordered_get()

# Get all atoms from within the residue, including side chain atoms
all_atoms = tuple(res.get_atoms())

Expand Down

0 comments on commit 8d7dabe

Please sign in to comment.