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

Allow using hexadecimal ATOM id #370

Closed
wants to merge 1 commit into from

Conversation

SSchott
Copy link

@SSchott SSchott commented Sep 6, 2023

Was facing issues parsing too big PDBs. I adapted the parsing for the serial entry for ATOM to allow hexadecimal notation, as when PDBs are rewritten by VMD. I don't know how much it would be necessary to include this for other atom id dependent entries. If so, making a function for it might be necessary. Anything that goes against such a move?

Allow using hexadecimal ATOM IDs
@sobolevnrm
Copy link
Member

Can you please provide more information, including links to references, about PDB files using hexademical numbering? I'm unfamiliar with this. Thank you!

@SSchott
Copy link
Author

SSchott commented Sep 10, 2023

I didn't find "official" documentation, aside the mailing list here , but is already used by other packages, e.g. here . Seems like adding it for resnumbers is also an option.

Copy link
Member

@sobolevnrm sobolevnrm left a comment

Choose a reason for hiding this comment

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

Hello --

I'm hesitant to add this functionality to PDB2PQR because it is a non-standard format. However, if we do add it, can you please add some tests to make sure it doesn't break other functionality, particularly when parsing PDB entries with chain IDs or insertion codes?

In general, all new functionality in PDB2PQR should include tests to demonstrate when the code works, when it breaks, and how it integrates with other features in the code.

Thank you,

Nathan

@speleo3
Copy link
Contributor

speleo3 commented Oct 28, 2023

VMD's solution will produce many "hex" numbers which are digit-only, and thus will not be parsed back correctly and will produce non-unique atom IDs. So I wonder how useful this really is, and if it is any better than to just write zeros or 99999 for overflowing numbers.

>>> int("%05x" % 100096)
18700

@SSchott
Copy link
Author

SSchott commented Oct 30, 2023

Hi,
Thanks for the comments. @sobolevnrm I'll see what I can do regarding a test. In any case, any standard PDB should never trigger the except section, as ATOM IDs should always be int, but we know how the PDB-space looks like.... @speleo3 I don't follow what you mean. The try and except should ensure only hex numbers are transformed into a decimal number. It should ensure traceability in the long term.

@SSchott
Copy link
Author

SSchott commented Jan 3, 2024

Finally got around this. I made a draft in #383 . Let me know if it goes in line with what you were looking for.

@SSchott SSchott closed this Jan 3, 2024
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.

4 participants