Skip to content

Conversation

@sg-s
Copy link
Collaborator

@sg-s sg-s commented Jan 12, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes ligand extraction from CIF files by implementing proper CIF-to-PDB conversion before HETATM parsing, and enhances water molecule filtering to include additional water residue names (WAT, H2O) beyond just HOH.

Changes:

  • Enhanced extract_ligand() to handle CIF files by temporarily converting them to PDB format
  • Expanded default water molecule exclusion to include HOH, WAT, and H2O residue names
  • Added uppercase normalization for residue name comparisons to ensure consistent filtering
  • Added comprehensive test coverage for water filtering and CIF file ligand extraction

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/drug_discovery/structures/protein.py Implemented CIF-to-PDB conversion for ligand extraction, added uppercase normalization for residue names, and expanded default water exclusion list
tests/test_protein.py Added three new tests covering water filtering, custom exclude_resnames, and CIF file ligand extraction scenarios
docs/dd/how-to/proteins.md Added documentation note explaining automatic water exclusion and the exclude_resnames parameter usage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


# Count water molecules before extraction
# Convert to PDB to count HETATMs
import os
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This import of module os is redundant, as it was previously imported on line 1.

Suggested change
import os

Copilot uses AI. Check for mistakes.
@sg-s sg-s merged commit 11db7ab into main Jan 12, 2026
15 of 16 checks passed
@sg-s sg-s deleted the ligand-from-cif branch January 12, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants