Skip to content

Commit

Permalink
Fix handling of positive formal charge when writing SDF. [closes #274]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jan 17, 2025
1 parent 964a670 commit 50dc2de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions corelib/src/libs/SireIO/sdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,13 @@ SDFMolecule parseMolecule(const Molecule &molecule, QStringList &errors, const P
sdfmol.addProperty("CHG", i + 1, QString::number(charge));
charge = 0;
}
else if (charge > 0)
{
if (charge < 4)
{
charge = 4 - charge;
}
}
else if (charge < 0)
{
switch (charge)
Expand Down
2 changes: 2 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.

* Add support for Replica Exchange with Solute Tempering (REST2) simulations.

* Fix handling of positive formal charge when writing SDF files.

`2024.3.1 <https://github.com/openbiosim/sire/compare/2024.3.0...2024.3.1>`__ - December 2024
--------------------------------------------------------------------------------------------

Expand Down

0 comments on commit 50dc2de

Please sign in to comment.