Repository navigation
Conversation
|
Will fix the tests once you signal interest in this contribution! |
The Atom class previously only supported atom/element charges for PQR file formats. However, charges can also be indicated at the very end of a line in PDB files such as: ``` ATOM 1 N THR A 1 -17.147 31.805 -43.528 1.00 0.46 N1+ ``` This commit enables parsing of these charges and also takes them into consideration when writing PDB files using the `PDBIO` class. This leads to more consistent results if a user reads a PDB file and then exports it as PDB again (since they will expect the same ATOM lines).
Duplicate atoms in residues happen frequently and Biopython used to simply delete them silently without informing the user. This behaviour is unexpected and leads to difficult to debug problems. This commit adds an `if` statement which raises a `PDBConstructionException` in case of duplicate atoms with same names.
|
There's a lot of test failures, quoting AppVeyor (Windows) here: Also something in the tests needs to silence |
|
Not having looked at the file contents, this is likely a naive question - but do we really need pdb_charge and pqr_charge, can they not be combined? |
@peterjc I don't think these can be combined since the I haven't had time to fix the tests yet but will definitely do next week! |
|
PQR charges are partial charges, while PDB charges are formal charges (integers). They've got different meanings. |
|
Thanks for the clarification - adding something like that to the docstrings would be great 👍 |
|
hello, may I enquire on the status of this? this is a much needed feature for my use-case, and I'll be happy to help if possible |
|
Perhaps you (@linminhtoo) can pickup where @markf94 left off? The tests need working on, and I'd like the meaning of the two different charges explained in the docstring. Are you familiar enough with git to handle updating a copy of this branch with the changes on the master branch? |
|
For those eager to have the PDB charge available as atom (and residue) attribute, you can use the following function. Its' pretty self explanatory. Both The ` ` |
The Atom class previously only supported atom/element charges for PQR
file formats. However, charges can also be indicated at the very end of
a line in PDB files such as:
This MR enables parsing of these charges and also takes them into
consideration when writing PDB files using the
PDBIOclass. This leadsto more consistent results if a user reads a PDB file and then exports
it as PDB again (since they will expect the same ATOM lines). Closes #3856
To verify that this MR does what it is supposed to do, you can simply repeat the steps outlined in #3856 and verify that
example-out.pdbnow indeed contains the 1+ charge on the nitrogen atom.Additionally, I added an
ifstatement which throws aPDBConstructionExceptionin case of duplicate atoms in PDB files. This is required since the current Biopython code silently deletes them without informing the user which can lead to difficult-to-debug scenarios and unexpected behaviours.I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rstfile, have runpre-commitlocally, and understand that continuous integration checks will be used to
confirm the Biopython unit tests and style checks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)