Skip to content

Commit

Permalink
More correct way of finding alpha-carbons
Browse files Browse the repository at this point in the history
  • Loading branch information
charnley committed Nov 24, 2024
1 parent 1850878 commit 21972dd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions rmsd/calculate_rmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1459,11 +1459,16 @@ def get_coordinates(


def _parse_pdb_alphacarbon_line(line: str) -> bool:
"""Try to read Alpha carbons based on PDB column-based format"""

tokens = line.split()
atom: str = tokens[2]
atom_col = line[12:16]
atom = atom_col[0:2]
atom = re.sub(r"\d", " ", atom)
atom = atom.strip()
atom = atom.capitalize()
location = atom_col[2]

if atom == "CA":
if atom == "C" and location == "A":
return True

return False
Expand Down

0 comments on commit 21972dd

Please sign in to comment.