37 Commits

Author SHA1 Message Date
Greg Landrum
724716b2c6 Switch to isoelectronic valence model (#7491)
* change valence model to use isolobal analogy

Remove support for five-coordinate C+ and, by analogy, five-coordinate N+2

Removes support for charge states that take atoms past the end of the periodic table
  i.e. [Lv-4] is no longer supported

* update the tests for that

* remove valence state of 6 for Al

* fix representation of phosphate in the mol2 parser

this is a correction of what was done during #5973

* cleanup the exceptions for P, S, As, and Se

* drop valence states:

Si 6, P 7, As 7

* a couple of additional changes from #7397

* update java tests

* fix an inconsistency: Rb now supports valence -1

* documentation

* - replace operator[] with at() for bounds check
- extract some code into a function to avoid duplication
- use TAB as separator throughout in the periodic table data for consistency

* removing the .at() usage

We know that these vectors aren't empty, so there's no need for the bounds check.

---------

Co-authored-by: ptosco <paolo.tosco@novartis.com>
2024-06-25 15:38:49 +02:00
Greg Landrum
31f11952e0 Fix #7311: problem with InChI for phosphinic acid (#7419)
* backup

* remove default valence for Tl
2024-05-03 21:23:37 +02:00
Greg Landrum
029b1e3789 Fixes #7162 (#7220) 2024-03-09 15:40:51 -05:00
Greg Landrum
ce1a90e47d Fixes #6961 (#6971)
Change the Rcov values used
do some format modernizations
2023-12-09 06:17:53 +01:00
Greg Landrum
9184a143d8 Fixes #6638 (#6656)
Isotope info:
https://github.com/BlueObelisk/bodr/blob/master/bodr/isotopes/isotopes.xml#L2684
Exact mass:
https://github.com/BlueObelisk/bodr/blob/master/bodr/elements/elements.xml#L568
2023-08-26 05:26:04 +02:00
David Cosgrove
5fe20d270f Improved handling of organometallics (#6139)
* First stab at disconnecting organometallics the Syngenta way.

* Add support for Li and Na compounds, with tests.

* Correct docstrings.

* Add -1 valence to sodium.

* Add changes from PR 5997.

* Move declaration of disconnectOrganometallics.

* Re-factor tests for disconnectOrganometallics to read V3000 files rather than hard-code in file.

* Add optional options to constructor.

* Python wrapping for disconnectOrganometallics.

* Python tests.

* Correct docString.

* Test using in place overload of disconnect free function.

* options_ should not be a reference.

* Re-work the wrappers.

* Added test MOL files.

* Correct charge on iron atoms.

* Fix tests for charged iron.

* Added some more test complexes.

* Port Marco's oxidation number Python to C++ Descriptor.

* Rename functions.

* Another test.

* Python wrappers.

* Comment in test.

* Throws exception if atom-based function called with non-kekulized parent.

* Fix typo.

* Allow potassium as well.

* Whole molecule calculations for oxidation number only.
Rename prop to OxidationNumber.

* Add OxidationNumber to common_properties.

* Extra comment.

* When deleting atom, update any ENDPTS props on bonds.
Copied in from stale PR ExtraDoc.

* Added hapticBondsToDative with python wrapper.

* Extra test.

* Re-factor endpts parsing.

* Typo.

* Add function for haptic end points inc. Python wrapper.

* Add dative bonds in separate step.

* C++ version of dativeBondstoHaptic.

* Update test mols.

* Python wrapper.

* Fix indents in Python test script.

* Corrected expected test result.

* Only do non-metal to metal conversion of single bond to dative if the explicit valence of the non-metal allows it.

* Fix test broken in a non-material way by previous change.

* Export for DLL.

* Remove redundant function declaration.

* Dave hates Windows.

* Move hapticBondEndpoints to Molops::details.

* And take it out of the Python wrappers.

* Run yapf on reformatted test script.

* Get the DLL builds going.

* addDativeBond -> addHapticBond.

* Batch edits.

* Position arithmetic.

* setQuery.

* Dummy positions for all confs.

* Fix tests for dummy positions for all confs.

* Move tests to catch_organometallics.cpp.

* Modern docString.

* Change member variable names.

* sProp length, bonus batchEdit.

* Add options object to disconnectOrganometallics.

* Tidied license.
Atom precondition.

* GetIntProp.

* Test opts aren't defaults.

* Python wrapper for disconnectOrganometallics with options.

* Minor edit.

* Slightly random attempt to fix Java build.

* Response to review.

* Another stab at the doc strings.

---------

Co-authored-by: David Cosgrove <david@cozchemix.co.uk>
Co-authored-by: Greg Landrum <greg.landrum@gmail.com>
2023-03-18 04:36:38 +01:00
Greg Landrum
b817f29eb8 extend the allowed valences of the alkali earths (#5786)
make it possible to have preferred and arbitrary valence states (I thought this already worked)
2022-11-25 04:50:36 +01:00
Greg Landrum
1f4584b2ca run clang_format (#5676) 2022-11-01 04:14:26 +01:00
Rachel Walker
70753df28e Include element name in atomic data (#5524) 2022-09-06 14:35:29 +02:00
Greg Landrum
f1bbc319b5 Fixes #3531 (#3545)
* Fixes #3531

* remove the new Br valences too
2020-11-08 07:17:37 +01:00
Greg Landrum
b86b2364c2 add new oxidation states for Cl, Br, I, Xe, Po, At (#3486)
* add new oxidation states for Br, I, Xe, Po, At

Changes the allowed value 2->3 for I

* add Cl too

* update expected test results
2020-10-12 15:26:18 +02:00
Greg Landrum
47d8813358 Fixes #2784 (#2787)
* Fixes #2784

* changes in response to review.

* clarifying comment
2019-11-15 07:53:42 -05:00
Greg Landrum
7ffd863c9b A collection of bug fixes (#2608)
* Fixes #2602

* Fixes #2605

* Remove vestigial isEarlyAtom() definition in Kekulize.cpp

* Fixes #2606

* Fixes #2607

adds allowed valence 2 for Sn and Pb

* Fixes #2610

* update in response to review
2019-08-15 04:53:23 +02:00
Francois Berenger
7ec8ec0bb9 Vdv radii from blue obelisk (#2154)
* updated atomic radii to follow the Blue Obelisk Data Repository

Ubuntu package bodr version 10-1; radii are from file
/usr/share/bodr/elements.xml

* typo

* use 2.0 as default VDW radius instead of 1.7

for elements missing from the Blue Obelisk Data Repository

* Document the atomic_data

* update expected test results

* update java tests

* allow a bit more slop when comparing confs

For cross-platform stability
2019-05-29 09:23:27 +02:00
Greg Landrum
8d72034367 Add an allowed valence of 3 for Al (#2425)
Fixes #2423
2019-05-09 10:49:14 -04:00
Greg Landrum
b1e255f470 Fixes #1668 (#1669)
* Fixes #1668

* add test for the additional Bi valence
2017-12-21 05:45:24 +01:00
Greg Landrum
c21605dbea SMILES lexer optimization/enhancement (#1575)
* needs testing

* add some tests, update periodic table

* update isotope data from NIST
2017-09-17 09:12:53 -04:00
Greg Landrum
97916ef894 Fixes #1204 (#1212) 2016-12-19 12:50:28 -05:00
Greg Landrum
9f9f2cd2d2 support additional trans-uranic elements (#1134)
* support additional trans-uranic elements
- update the atomic data and isotope lists
- update the SMILES and SMARTS parsers

* rebreak an input file
2016-11-03 11:48:31 -04:00
Greg Landrum
dee0215886 Fixes #694 2016-02-16 15:38:02 +01:00
Greg Landrum
e08e0d16d8 first pass, using google style 2015-11-14 14:58:11 +01:00
Greg Landrum
672f8ea200 Fixes #510 2015-05-20 05:19:40 +02:00
Greg Landrum
04edaa3380 add Darmstadtium isotope support in honor of the UGM 2014-10-24 13:55:03 +02:00
Greg Landrum
3f90cecd9c Fixes #164 2013-12-31 08:27:09 +01:00
Greg Landrum
3f6d82a4d1 start to take a swing at the locale problem; this still needs testing on non-linux 2012-12-12 03:24:54 +00:00
Greg Landrum
6bdd87e1c5 fix and test sf.net issue 267;
this removes default valence info from dummy atoms
2012-11-21 04:05:37 +00:00
Greg Landrum
16e2a04d2c patch from Roger Sayle to improve valence handling of
transition metals and lanthanides
2012-10-10 10:14:42 +00:00
Greg Landrum
b327ab5b23 get this building with MSVC++ 2012-04-25 03:11:07 +00:00
Greg Landrum
162662186d not working yet 2012-04-19 06:15:40 +00:00
Greg Landrum
24bbcec6fd typo 2011-04-18 11:27:41 +00:00
Greg Landrum
37c342046a add isotopic mass information; add molecular formula calculation; add isotopic mass calculator; expose additional descriptors to java 2011-04-18 10:11:09 +00:00
Greg Landrum
f3fbef45c5 update copyright statements 2010-09-26 17:04:37 +00:00
Greg Landrum
052ec66542 cleanups:
remove x bit from headers and sources;
remove a couple empty files from Code/GraphMol
2010-09-08 04:25:57 +00:00
Greg Landrum
0ff4b1646b since there's not really a right answer about default valence for transition metals, we might as well be consistent 2009-03-30 07:15:46 +00:00
Greg Landrum
eb3d720010 Fixes for sf.net bugs 1942657 : square brackets in smiles allow invalid valences
http://sourceforge.net/tracker/index.php?func=detail&aid=1942657&group_id=160139&atid=814650

This was handled by adding error/consistency checking to Atom.calcExplicitValence()

This includes another pretty big scale modification:
the allowed valence list for atoms (in atomic_data.cpp) can now contain a -1 at the end. If this is the case, the atom will tolerate valences above the ones listed.
This is done to allow "flexible" atoms (i.e. transition metals and the like) to accept arbitrary coordination numbers without generating errors.
2008-04-17 05:09:02 +00:00
Greg Landrum
bc60f17b91 make the next step towards completing feature request (186217);
display deprecation warnings for [X] dummies, output [*] by default
2008-04-06 10:41:14 +00:00
Greg Landrum
75a79b6327 initial import 2006-05-06 22:20:08 +00:00