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

RDKit's Chem.MolFromPDBBlock ignores atoms if AltLoc is not ' ' or 'A' or '1' #181

Open
rwxayheee opened this issue Oct 1, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@rwxayheee
Copy link

Currently, atom lines are ignored 😭 if AltLoc is not ' ' (space), 'A' or '1'?
https://github.com/rdkit/rdkit/blob/a44cbe86994583da3a828bed3df97804ef48fb59/Code/GraphMol/FileParsers/PDBParser.cpp#L62-L64

A check somewhere near this might be helpful:

for line in pdb_string.splitlines(True):
if line.startswith("TER") and reskey is not None:
_add_if_new(blocks_by_residue, reskey, pdb_block, interrupted_residues)
blocks_by_residue[reskey] = pdb_block
pdb_block = ""
reskey = None
buffered_reskey = None
if line.startswith("ATOM") or line.startswith("HETATM"):
# Generating dictionary key
resname = line[17:20].strip()
resid = int(line[22:26].strip())
chainid = line[21].strip()
icode = line[26:27].strip()

We can print the atom PDB line if unexpected AltLoc is encountered, and a warning message that this atom will not go through Chem.MolFromPDBBlock

It seems like prody's parsePDB also defaults to ' ' or 'A'

@rwxayheee rwxayheee self-assigned this Oct 1, 2024
@rwxayheee rwxayheee added the enhancement New feature or request label Oct 1, 2024
@diogomart diogomart added this to the v0.6.0 milestone Oct 1, 2024
@diogomart diogomart self-assigned this Oct 1, 2024
@rwxayheee rwxayheee removed their assignment Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants