-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Formal charges #831
Formal charges #831
Conversation
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Here are the build results |
The other part of this would be writing to CJSON since we're now using that preferentially over CML. See |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the question would be more on the generality - whether it's worth expanding beyond the simple cations to a slightly larger formal charge perception method.
I also don't remember if I added formal charges to the native mdlformat
code -- it looks like not.
This fixes your problems for sure, but it would be great to have a slightly broader patch to address CJSON and SDF support too and ideally also handle negative formal charges. |
Regarding CJSON and SDF... How are new features introduced in CJSON; can I just send a Pull Request to them? Also, I'm not familiar with SDF at all; never used it. Where could I find the specification? |
For CJSON, you're just adding an extension for atom formal charges, so it's backwards-compatible still. In
In
|
For SDF, there are two parts - in the atom block itself and the M CHG parts: atom block:
The "ccc" part is the formal charge code (characters 36-38): 0 = uncharged or other, 1 = +3, 2 = +2, 3 = +1, 5 = -1, 6 = -2, 7 = -3 M CHG fields indicate the number of formal charges on the line (up to 8), then the atom number and the charge, e.g.
So 2 atoms with charges, atom 8 has a -1 charge, atom 10 has a +1 charge. |
Here are the build results |
75380c7
to
c6c05fa
Compare
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
c6c05fa
to
b6c32b7
Compare
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Here are the build results |
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
01bd64c
to
c2e8dd5
Compare
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
c2e8dd5
to
4f977f2
Compare
Here are the build results |
Otherwise, this looks good. I was able to read in the test file, and adding hydrogens generated R-NH3+ and R-CO2- properly, which is great. |
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Here are the build results |
Well, there's that thing with halogen-substituted anions, but at this point it would only be added to PDB, and I'm not aware of any drugs or research ligands with such structures... So... yes, good to merge! |
Well, maybe I should add support in CJSON? Looks small enough to me that you could merge it with that support tomorrow... |
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
b3705a3
to
e5ad0fa
Compare
Here are the build results |
Signed-off-by: Aritz Erkiaga <aerkiaga3@gmail.com>
Here are the build results |
This Pull Requests improves Avogadro's support for formal charges. First of all, it implements reading them from CML, which also extends to other formats (e.g. SMILES, which is internally converted to CML). Those charges are then passed down the class hierarchy. Secondly, since PDB files can contain quaternary ammonium (e.g. acetylcholine, various drug ligands) or tertiary sulfonium (S-adenosylmethionine), or even quaternary arsonium (https://www.rcsb.org/structure/5NXY) groups, and those cannot be eliminated by hydrogen adjustment, specific code was added to detect those.
Then, the code was made more convergent with other paths so as to allow the various optimization PRs to act on it.
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.