Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an additional kwarg to parse_ccd_residue to remove atoms named 'O… #93

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/boltz/data/parse/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def parse_ccd_residue(
name: str,
ref_mol: Mol,
res_idx: int,
remove_oxt_atom: bool = False
) -> Optional[ParsedResidue]:
"""Parse an MMCIF ligand.

Expand Down Expand Up @@ -273,6 +274,11 @@ def parse_ccd_residue(
for i, atom in enumerate(ref_mol.GetAtoms()):
# Get atom name, charge, element and reference coordinates
atom_name = atom.GetProp("name")

# Drop OXT atoms for non-canonical amino acids.
if remove_oxt_atom and atom_name == 'OXT':
continue

charge = atom.GetFormalCharge()
element = atom.GetAtomicNum()
ref_coords = conformer.GetAtomPosition(atom.GetIdx())
Expand Down Expand Up @@ -385,6 +391,7 @@ def parse_polymer(
name=res_corrected,
ref_mol=ref_mol,
res_idx=res_idx,
remove_oxt_atom=True,
)
parsed.append(residue)
continue
Expand Down