Electrostatics / pdb2pqr

PDB2PQR - determining titration states, adding missing atoms, and assigning charges/radii to biomolecules.
http://www.poissonboltzmann.org/
Other
117 stars 34 forks source link

Allow using hexadecimal ATOM id #370

Closed SSchott closed 6 months ago

SSchott commented 10 months ago

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?

sobolevnrm commented 10 months ago

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

SSchott commented 10 months ago

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.

speleo3 commented 8 months ago

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 commented 8 months ago

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 commented 6 months ago

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