From f186a811f9756998bcdb653ffadcdbeaa31b1695 Mon Sep 17 00:00:00 2001 From: David van der Spoel Date: Mon, 15 Jan 2024 22:34:45 +0100 Subject: [PATCH] Implemented code to support the Alexandria force field. The Alexandria Chemistry Toolkit for building force fields will be released shortly. It relies on the OpenBabel software to support it for generating atom types. In this patch the forcefieldalexandria is introduced as a child class to forcefieldgaff in an effort to change as little code as possible. There are many changes to bondtyp.txt which admittably will be hard to check. These will affect any force field typing in OpenBabel. --- data/CMakeLists.txt | 1 + data/alexandria.prm | 509 +++++++++++++++++++++++ data/bondtyp.txt | 160 ++++++- data/ringtyp.txt | 3 + src/CMakeLists.txt | 1 + src/bondtyper.cpp | 48 ++- src/forcefields/forcefieldalexandria.cpp | 39 ++ src/forcefields/forcefieldalexandria.h | 50 +++ src/forcefields/forcefieldgaff.cpp | 12 +- src/forcefields/forcefieldgaff.h | 8 + 10 files changed, 816 insertions(+), 15 deletions(-) create mode 100644 data/alexandria.prm create mode 100644 src/forcefields/forcefieldalexandria.cpp create mode 100644 src/forcefields/forcefieldalexandria.h diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt index 78a181acff..bb4d847a61 100644 --- a/data/CMakeLists.txt +++ b/data/CMakeLists.txt @@ -1,6 +1,7 @@ # Open Babel data files set(to_install + alexandria.prm atomization-energies.txt atomtyp.txt babel_povray3.inc diff --git a/data/alexandria.prm b/data/alexandria.prm new file mode 100644 index 0000000000..7006174ae1 --- /dev/null +++ b/data/alexandria.prm @@ -0,0 +1,509 @@ +// +// Copyright (C) 2009 by Frank Peters +// +// This is a SMARTS template-file for GAFF-atom types +// +// It is attempted to obey the typing given in the "ATOMTYPE_GFF.DEF" +// file included with the antechamber package of amber10. +// There is no 1-to-1 correspondence between the ATD format and SMARTS. +// Therefore the current definitions need to be tested and possibly changed +// +// +// +// GAFF atomtypes defined using SMARTS +// [SMARTS] [atomtype id number] [description] +// must be sorted according to the ELEMENT and COMPLEXITY OF THE TYPERULE! +// +// Upadted (2016) by Mohammad Mehdi Ghahremanpour +// Updated (2019) by Mohammad Mehdi Ghahremanpour +// Updated (2021) by David van der Spoel for usage with alexandria +// +// Be careful lines do not exceed the maximum length of 150! + + +// SMARTS rules for hydrogens + +atom [*] X +atom [#1] hc "other hydrogen e.g. on aromatic C" +atom [#1X1] ha "other hydrogen e.g. on aromatic C" +atom [#1X1]O ho "H on oxygen" +atom [#1X1][#9,#17,#35,#53] ho "H on halogen" +atom [#1X1][OD2]-[#1X1] hw "H on water" +atom [#1X1]N hn "H on nitrogen" +atom [#1X1]n hn "H on nitrogen" +atom [#1X1]S hs "H on sulphur" +atom [#1X1]P hp "H on phosphor" +atom [#1X1][CX4] hc "H on aliphatic C" +atom [#1X1][#6X4] hc "H on aliphatic C" +atom [#1X1][#6X3]=[#6] ha "H on conjugate carbon" +atom [#1X1][#6X3](=[#6])[#6] ha "H on conjugate carbon" +atom [#1X1][#6X3](=[#6])[#1] ha "H on conjugate carbon" +atom [#1X1][#6X2]#[#6] ha "H on carbon with a triple bond" +atom [#1X1][#6](-[#6]=[#7])(=[#6]) ha "H on conjugate carbon" +atom [#1X1][#6X4]([#6])([#6])[#1] hc "H on aliphatic C" +atom [#1X1][C][#7,#8,#9,#16,#17,#35,#53] h1 "H on carbon in a chain with 1 electron-withdrawal group" +atom [#1X1][C]=[#7,#8,#9,#16] h1 "H on carbon in a chain with 1 electron-withdrawal group" +atom [#1X1][C][F,Cl,Br,I] h1 "H on carbon in a chain with 1 electron-withdrawal group" +atom [#1X1][C]([#6])([F,Cl,Br,I])[#1] h1 "H on carbon in a chain with 1 electron-withdrawal group" +atom [#1X1][C](=[#6])[F,Cl,Br,I] h1 "H on carbon in a chain with 1 electron-withdrawal group" +atom [#1X1][C]([#7,#8,#9,#16,#17,#35,#53])[#7,#8,#9,#16,#17,#35,#53] h2 "H on carbon in a chain with 2 electron-withdrawal group" +atom [#1X1][C]([#6])([F,Cl,Br,I])[F,Cl,Br,I] h2 "H on carbon in a chain with 2 electron-withdrawal group" +atom [#1X1][C]([F,Cl,Br,I])[F,Cl,Br,I] h2 "H on carbon in a chain with 2 electron-withdrawal group" +atom [#1X1][C](=[#7,#8,#9,#16])([#7,#8,#9,#16]) h2 "H on carbon in a chain with 2 electron-withdrawal group" +atom [#1X1][C]([#7,#8,#16,#17,#35,#53])([#7,#8,#16,#17,#35,#53])[#7,#8] h3 "H on carbon in a chain with 3 electron-withdrawal group" +atom [#1X1][C]([#7,#8,#16,#17,#35,#53])([#7,#8,#16,#17,#35,#53])[#16,#17] h3 "H on carbon in a chain with 3 electron-withdrawal group" +atom [#1X1][C]([#7,#8,#16,#17,#35,#53])([#7,#8,#16,#17,#35,#53])[#35,#53] h3 "H on carbon in a chain with 3 electron-withdrawal group" +atom [#1X1][C]([F,Cl,Br,I])([F,Cl,Br,I])[F,Cl,Br,I] h3 "H on carbon in a chain with 3 electron-withdrawal group" +atom [#1X1][C]([F,Cl,Br,I])([F,Cl,Br,I])[O,F,Cl,Br,I] h3 "H on carbon in a chain with 3 electron-withdrawal group NEW" +atom [#1X1][c](=[#7,#8,#16]) h4 "H on carbon in a ring with 1 electron-withdrawal group" +atom [#1X1][c]([#7,#8,#16,#17,#35,#53])(=[#6]) h4 "H on carbon in a ring with 1 electron-withdrawal group" +atom [#1X1][c]([#7,#8,#16])(=[#6]) h4 "H on carbon in a ring with 1 electron-withdrawal group" +atom [#1X1][c][#7,#8,#16,#17,#35,#53] h4 "H on carbon in a ring with 1 electron-withdrawal group" +atom [#1X1][c][#7,#8,#16,#17,#35,#53] h4 "H on carbon in a ring with 1 electron-withdrawal group" +atom [#1X1][c]-[#15X3] h4 "H on carbon in a ring with 1 electron-withdrawal group" +atom [#1X1][c]([#7,#8,#9,#16,#17,#35,#53])(=[#7,#8,#16]) h5 "H on carbon in a ring with 2 electron-withdrawal group" +atom [#1X1][c](=[#7,#8,#16])([#7,#8,#9,#16,#17,#35,#53]) h5 "H on carbon in a ring with 2 electron-withdrawal group" +atom [#1X1][c]([#7,#8,#16,#17,#35,#53])[#7,#8,#16,#17,#35,#53] h5 "H on carbon in a ring with 2 electron-withdrawal group" +atom [#1X1][Ge] DU "H on Ge" + +// SMARTS rules for carbons + +atom [c] ca "sp2 C in aromatic ring" +atom [#6X1] c1 "sp C" +atom [#6X2] c1 "sp C" +atom [#6X2](#*)-*=* cg "sp C in conjugated system" +atom [#6X2](#*)-*#* cg "sp C in conjugated system" +atom [#6X2](#[#7])[#6X3] cg "sp C in conjugated system" +atom [#6X2](#[#6])[#1] c1 "sp C" +atom [#6X2](#[#6X2])(-[#7X3]) c1 +atom [#6X3] c2 "sp2 C in aliphatic system" +//atom [#6X3](=[#7X3])(-[#8X1]) c "C-O- in resonance structure of amide" +atom [#6X3](=[#6X3])([#6X4])[#6X3] c2 "sp2 C in aliphatic system" +atom [#6X3;!R](=[#6])([#1])[#1] c2 "sp2 C in aliphatic system" +atom [#6X3;!R](=[#6])([#6])[#1] c2 "sp2 C in aliphatic system" +atom [#6X3;!R](=[#7X3])([#7X3])[#7X3] cz "guanidinium carbon" +atom [#6X3;!R](=[*&!O,S])-*=* ce "sp2 C conjugated chain" +atom [#6X3;!R](#*)-*=* ce "sp2 C conjugated chain" +atom [#6X3;!R](#*)-*#* ce "sp2 C conjugated chain" +atom [#6X3;!R](=*)-*#* ce "sp2 C conjugated chain" +atom [#6X3;H&!R](=*)-*~[R;a] ce "sp2 C conjugated chain" +atom [#6X3;!R](=[#7X3])([#7X3])[#7X2](=[#6X3;!R]) cz "guanidinium carbon" +atom [#6X3;R](=[#6,#7,#8])(-[#6,#7,#8])(-[#1]) ca "sp2 C in aromatic ring" +atom [#6X3;R]([#6]=[#6]-[#6]) cc "sp2 C in conjugated ring NEW" +atom [#6X3;R](:[#6])[#6] ca "sp2 C in aromatic ring" +atom [#6X3;R](=[#6])([#6])[#1] ca "sp2 C in aromatic ring" +//atom [#6X3;R](=*)-*=* ca "sp2 C in aromatic ring" +atom [#6X3;R](=[#6X3])([#6])[#1] ca "sp2 C in aromatic ring" +atom [#6X3;R](=[#6])([#6])[F,Cl,Br,I] c2 "sp2 C in a ring with 1 electron-withdrawal group" +atom [#6X3;R](=[#6X3])([#6X4])[#6] c2 "sp2 C in a ring" +atom [#6X3;R](=*)-*#* cc "sp2 C in a conjugated ring" +atom [#6X3;R](#*)-*#* cc "sp2 C in a conjugated ring" +atom [#6X3;R]:[#7,#8,#16] cc "sp2 C in a ring with 1 electron-withdrawal group" +atom [#6X3;R]([#7,#8,#16])[#1] cc "sp2 C in a ring with 1 electron-withdrawal group" +atom [#6X3;R](=[#7])(-[#6,#7])[#1] cc "sp2 C in a ring" +atom [#6X3;R](=[#6])([#8X2,#16X2])[#6] cc "sp2 C in a ring" +atom [#6X3;R]([#7,#8,#16])[#7,#8,#16] cc "sp2 C in a ring with 2 electron-withdrawal group" +atom [#6X3]=[O,S] c "C=O or C=S" +atom [#6X3](=[#7X3])(-[#8X1]) c "C-O- in resonance structure of amide" +atom [#6X3](-[OD1])=[O] cm "COO- NEW" +atom [#6X3;R]([#7,#8,#16])([#7,#8,#16])[#1] cc "sp2 C in a ring with 2 electron-withdrawal group" +atom [#6X3;R](=[#6])([#7,#8,#16])[#1] cc "sp2 C in a ring with 1 electron-withdrawal group" +atom [#6X3;R](=[#6,#7])(@[#7,#8,#16]) cc "sp2 C in a ring with 2 electron-withdrawal group" +atom [#6X3;R](=[#7])(@[#6,#7,#8,#16]) cc "sp2 C in a ring with 2 electron-withdrawal group" +atom [#6X3;R](=[#6,#7])(@[#7,#8,#16])[#1] cc "sp2 C in a ring with 2 electron-withdrawal group" +atom [#6X3;R](=[#7])(@[#6,#7,#8,#16])[#1] cc "sp2 C in a ring with 2 electron-withdrawal group" +atom [#6X3;R](=[#6X3])(-[#6X3]=[#8X1])[#1] cc "sp2 C in a conjugated ring" +atom [#6X3;R](:[#6][#8X2])[#6]=[#16X1] cc +atom [#6X3r3] cu "sp2 C 3-membered ring" +atom [#6X3r3]=O c "sp2 C 3-membered ring" +atom [#6X3r4] cv "sp2 C 4-membered ring" +atom [#6X3r4]=*-*=* cc "NEW" +atom [#6X3r4]-*=*-* cc "NEW" +atom [#6X3r4]=O c +atom [#6X3r5](:[#6][#7,#8,#16])[#6] cd "CHANGED" +atom [cr5]o cc +atom [cr5]n cc +atom [cr5]([nX2]) cd +atom [cr5]([nX3]) cc +atom [cX3r5](=[O])([nX3])[nX3] c +atom [#6X3r5](-[#6]=[#6]-[#6]) cc "sp2 C fulvene" +atom [#6X3r5](=[#6])([#6])[#1] c2 "sp2 C in aliphatic ring of size 5 with 1 electron-withdrawal group" +atom [#6X3r5](=[#6X3])(-[#6X3]=[#8X1])[#1] cc "sp2 C in a conjugated ring of size 5" +atom [#6X3r5](:[#6X3])(-[#16X2])[#1] cc "sp2 C in a conjugated ring of size 5" +atom [#6X3r5](:[#6X3]-[#16X2])([#6X3])[#1] cd "sp2 C in a conjugated ring of size 5" +atom [#6X3r5](=[#6X3][#6X3])[#6X3]=[#8X1] cc +atom [#6X3r5](=[#6X3][#6X3]=[#8X1])[#6X3] cc +atom [#6X3r5](=[#6X3]-[#6X3])[#6X3]=[#8X1] cc +atom [#6X3r5](-[#6X3])(=[#6X3]-[#6X4])[#1] cc +atom [#6X3r5](-[#6X4])(=[#6X3]-[#6X3])[#1] cc +atom [#6X3r5](=[#6X3][#8X2])([#6X3])[#1] cc +atom [#6X3r5](=[#6X3])(-[#6X4]-[#8])[#1] c2 +atom [#6X3r5](=[#6X3])(-[#6X4]-[#8])[#1] c2 +atom [#6X3r5]([#6X4])(=[#6X3]-[#8])[#1] c2 +atom [#6X3r5](=[#6])([#7,#8,#16])[#1] c2 "sp2 C in aliphatic ring of size 5" +atom [#6X3r5](-[#6X3]=[#6X3])(=[#6X3]-[#6X4])[#1] cd +atom [#6X3r5](=[#6X3][#8X2])([#6X4]-[#6X3])[#1] c2 +atom [#6X3r5](=[#6X3]-[#6X4])([#6X4]-[#6X4])[#1] c2 +atom [#6X3r5](=[#6X3]-[#6X3])(@[#8]@[#6X3]([#1]))[#1] cc +atom [#6X3r5](=[#6X3]-[#16X2])(-[#6X4]-[#6X4])[#1] c2 +atom [#6X3r5]=[O,S] c +atom c-c cp "bridge aromatic c" +atom [#6X3r6](=[#6])([#6X4])[#1] c2 "sp2 C in aliphatic ring of size 6" +atom [#6X3r6](=[#6X3])([#6X4])[#6X4] c2 "sp2 C in a ring of size 6" +atom [#6X3r6](=[#6X3])([#6X3])[Br] ca +atom [#6X3r6](=[#6X3])([#6X3])[Cl] ca +atom [#6X3r6](=[#6X3])([#6X3])[F] ca +atom [#6X3r6](:[#6])([#6]@[#7])[#1] cc +atom [#6X3r6](=[#6X3]-[#6X3]=[#8X1])([#6X3])[#1] cd "sp2 C in a conjugated ring of size 6" +atom [#6X3r6](=[#6]@[#7,#8,#16])[#6] cd "CHANGED" +atom [#6X3r6](=[#6]-[#6X4])([#8]-[#6X4])[#1] c2 +atom [#6X3r6](=[#6X3]-[#6X4])([#8]-[#6X3])[#1] c2 +atom [#6X3r6](=[#6X3]-[#6X4])([#6X3]=[#8])[#1] c2 +atom [#6X3r6]([#6X4])(=[#6X3]-[#6X3])[#1] c2 +atom [#6X3r6](=[#6X3]@[#6X4])([#6X3])[#1] c2 +atom [#6X3r6](=[#6X3]-[F])([#6X4]-[#6X4])[#1] c2 +atom [#6X3r6](-[#6X4]-[#6X4])(=[#6X3]-[#8])[#1] c2 +atom [#6X3r6]([#6X4]-[#6X3])(=[#6X3]-[#8])[#1] c2 +atom [#6X3r6](=[#6X3][#7])([#6X3]=[#7])[#1] cc +atom [#6X3r6](=[#6X3])([#6X3](=[O])[O])[#6X3]=[O] cc +atom [#6X3r6](=[#6X3][#6X3](=[O])[O])([#6X3]=[O])[#1] cc +atom [cr6]n ca +atom [cr6]([c][n]) ca +atom [cX3r6]=O c +atom [cX3r6](:[n][c]=[O])([NX3])[c] cd "SP2 carbon in cytosine-like rings" +atom [cX3r6](:[c][nX3])([c][NX3]) cd "SP2 carbon in cytosine-like rings" +atom [cX3r6](:[c][cX3][NX3])([nX3]) cc "SP2 carbon in cytosine-like rings" +atom [cX3r6]([cX3]=O) cd +atom [cX3r6]([nX3])([cX3][cX3]=O) cc +atom [#6X3r7](=[#6])([#6])[#1] c2 +atom [#6X3r7][#6]=[#6]-[#15] cc +atom [#6X3r7](=[#6][#15])([#6])[#1] cc +atom [#6X3r7](=[#6X3])([#15X3])[#1] cc "sp2 C in a conjugated ring of size 7" +atom [#6X3r7](!:[#6])([#6]=[#6]) cc "sp2 C in a non-aromatic conjugated ring of size 7" +atom [#6X3r7](=[#6][#15])([#6])[#1] cc +atom [#6X3r7](:[#6X3])([#6X3]=[O])[#1] cc +atom [#6X3r7](:[#6X3][#6X3]=[O])[#6X3][#1] cc +atom [#6X3r7]([#6X3]:[#6X3][#6X3]=[O])[#6X3][#1] cc +atom [#6X3r8](=[#6]-*)(-[#6]=*)[#1] cc +atom [#6X3r8](=[#6])([#6])[#1] c2 "sp2 C in a ring of size 8" +atom [#6X3r8]=*-*=* cc "sp2 C in a ring of size 8" +atom [#6X4] c3 "other sp3 C" +atom [#6X4](-*)(-*)(-*)-* c3 "other sp3 C" +atom [#6X4]([#6])([#6])([#1])[#1] c3 "sp3 carbon" +atom [#6X4]([#6X3])([#6X3])([#1])[#1] c3 +atom [#6X4]([#6X4])([#6X4])([#1])[#1] c3 +atom [#6X4]([#6X3])([#8X2])([#1])[#1] c3 +atom [#6X4]([#6])([#6])([#6])[#6] c3 +atom [#6X4;R]([#6])([#6])([#1])[#1] c3 "sp3 carbon in aliphatic ring" +atom [#6X4;R]([#6])([#6])([#6])[#6] c3 +atom [#6X4;R]([#6])([#6])([#6])[#8] c3 +atom [#6X4;R]([#6])([#6])([#6])[F] c3 +atom [#6X4;R]([#6])([#6])([F])[F] c3 +atom [#6X4&H;R] cc +atom [#6X4&H0;R][#7] cc +atom [#6X4r3] cx "3-membered ring atom" +atom [#6X4r4] cy "4-membered ring atom" +atom [#6X4r5] c3 +atom [#6X4r5]([#7])([#6])[#6] cc +atom [cX3r5] ca +atom [cX3r6] ca +atom [#6X4r5] c3 +atom [#6X4r5]([#6X4])([#6X4r5])([#6X3r5])[#1] c3 +atom [#6X4r5]([#6X3]=[#8X1])([#6X3])([#6X4])[#1] c3 +atom [#6X4r5]([#6X4])([#6X3]=[#8])([#7X3])[#1] c3 +atom [#6X4r5]([#6X4])([#6X3])([#6X3])[#1] c3 +atom [#6X4r6] c3 +atom [#6X4r6]([#6X3])([#6X3])[#6X4] cc +atom [#6X4r6]([#6X4])([#8X2])([#6X2])[#1] c3 +atom [#6X4r6]([#6X4][#8X2])([#7])([#1])[#1] c3 +atom [#6X4r7] c3 +atom [#6X4r8] c3 +atom [CX3r5]1=[CX3r5][CX3r5]=[CX3r5][NX3r5]1 ca "sp2 N pyrrole" + +// SMARTS rules for halogens + +atom [#9]~* f (-*) "general fluorine" +atom [#17]~* cl (-*) "general chlorine" +atom [#35]~* br (-*) "general bromine" +atom [#53]~* i (-*) "general iodine" + +// SMARTS rules for phosphorous + +atom [#15X1] p2 "other sp2 P" +atom [#15X1]#[#6,#7,#8,#16,#15] p1 "sp P" +atom [#15X2] p2 "other sp2 P" +atom [#15X2;R](=*)-*=* pc "sp2 P of conjugated ring" +atom [#15X2;R](=*)-*#* pc "sp2 P of conjugated ring" +atom [#15X2;R](=[#6])[#8] pc "sp2 P of conjugated ring" +atom [#15X2;R](#*)-*#* pc "sp2 P of conjugated ring" +atom [#15X2;!R](=*)-*=* pe "sp2 P of conjugated chain" +atom [#15X2;!R](=*)-*#* pe "sp2 P of conjugated chain" +atom [#15X2;!R](#*)-*#* pe "sp2 P of conjugated chain" +atom [#15;a] pb "aromatic P" +atom [#15X3] p3 "other sp3 P" +atom [#15X3](=[#8])(=[#8])[#8] p4 "" +atom [#15X3]=[O,S] p4 "hypervalent P" +atom [#15X3](=*)-*=* px "sp2 P of conjugated system" +atom [#15X3](=*)-*#* px "sp2 P of conjugated system" +atom [#15X4] p5 "hypervalent P" +atom [#15X4](=*)-*=* py "P of conjugated system" +atom [#15X4](=*)-*#* py "P of conjugated system" +atom [#15X5] p6 "sp3d P, hypervalent P" +atom [#15X6] p7 "sp3d2 P, hypervalent P" + + +// SMARTS rules for nitrogens + +atom [#7X1;!R] n1 "sp1 N" +atom [#7X1]=[#8] n1 "sp1 N" +atom [#7X2] n2 "sp2 N" +atom [#7X2](=[#6])[#1] n2 "sp2 N" +atom [#7X2](=[#8])[F,Cl,Br,I] n2 "sp2 N" +atom [#7X2](=[#7X2]=[#7X2]) n1 "sp1 N" +atom [#7X2](=[#7X2])(=[#7X2]) n1 "sp1 N" +atom [#7X2](=[#8X1])(=[#8X1]) n1 "sp1 N in NO2^+" +atom [#7X2](#*)-* n1 "sp1 N" +atom [#7X2](=[#7X2])-* n2 "sp1 N" +atom [nX2] nb "aromatic N" +#atom [#7X2;R](=*)=* nb "aromatic N; MMW: Aromatic?" +#atom [#7X2;R](=*)(-*) nb "aromatic N; MMW: Aromatic?" +atom [#7X2;R](=[#7])[#16] nd "sp2 N of conjugated ring" +atom [#7X2;R](:[#6])[#7] nd "sp2 N of conjugated ring" +atom [#7X2;R]=[#6][#7] nd "sp2 N of conjugated ring" +atom [#7X2;R]=[#6][#8] nd "sp2 N of conjugated ring" +atom [#7X2;R]=[#6][#16] nd "sp2 N of conjugated ring" +atom [#7X2r5](:[#6])[#6] nb "N in aromatic ring due to lone pairs of size 5" +atom [nX2r6](:[#6X3][NX3])([#6X3]=[O]) nd "N in Cytosine" +atom [nX2r5]([#6])[#8,#16] nc "N in aromatic ring due to lone pairs of size 5" +atom [#7X2;R](-[#7X3]-[#6X3])=[#6X3] nc "sp2 N of conjugated ring" +atom [#7X2;R](=*)-*=* nc "sp2 N of conjugated ring" +atom [#7X2;R](=*)-*#* nc "sp2 N of conjugated ring" +atom [#7X2;R](#*)-*#* nc "sp2 N of conjugated ring" +atom [#7X2;R](:[#7])[#7] nc "sp2 N of conjugated ring" +atom [#7X2;R](:[#7])[#16X2] nc "sp2 N of conjugated ring" +atom [#7X2;R]([#7])[#7] nc "sp2 N of conjugated ring" +atom [#7X2;R]=[#6]([#7])[#7] nc "sp2 N of conjugated ring" +atom [#7X2;!R](=*)-*=* ne "sp2 N of conjugated chain" +atom [#7X2;!R](=*)-*#* ne "sp2 N of conjugated chain" +atom [#7X2;!R](#*)-*#* ne "sp2 N of conjugated chain" +atom [#7X3] n3 "sp3 N" +atom [#7X3&H0](=[#7])[F,Cl,Br,I] n2 "sp2 N" +atom [#7X3]([#7])([F,Cl,Br,I])[F,Cl,Br,I] n3 "sp3 N" +atom [#7X3;R](-*)=*-* na "sp2 N with 3 subst" +atom [#7X3;R](=[#6])([#6])[#6] na "sp2 N with 3 subst" +atom [#7X3r6]([#6])([#6])[#6] n3 "sp3 N" +atom [#7X3r6]([#6])([#6])[#1] n3 "sp3 N" +atom [#7X3r5]([#6])([#6])[#6] n3 "sp3 N" +atom [#7X3r5]([#6])([#6])[#1] n3 "sp3 N" +atom [nX3;R]([#6])([#6])[#6] na "sp2 N with 3 subst" +atom [nX3&H;R] na "sp2 N with 3 subst" +atom [nX3] nb "sp2 N with 3 subst" +atom [nX3](=[#6])([#6])[#1] na "sp2 N with 3 subst" +atom [#7X3](=[#6])([#6])[#1] na "sp2 N with 3 subst" +atom [nX2r5,nX3r5,nX2r6,nX3r6] nb "sp2 N in aromatic r5, like imidazole and analogs" +atom [#7X3r6]([#6])([#6])[#1] n3 "sp3 N" +atom [nX2r6,nX3r6] nb "sp2 N in aromatic r6, like pyridine and analogs" +atom [#7X3](=[*])(-[*])-[*] na "sp2 N with 3 subst" +//atom [#7X3H2] nh "Amine Nitrogen" +atom [#7X3H2]-[R;a] nh "Amine Nitrogen" +atom [#7X3H2]-[r6;a] nh "Amine Nitrogen" +atom [#7X3]-[R;a] nh "amine N next to aromatic ring" +atom [#7X3]-[CX3]=[O,S] n "sp2 N in amides" +atom [#7X3]=[#6X3]-[#8X1] n "sp2 N+ in resonance structure of amide" +atom [#7D3]-[#6X3]=[#6,#7,#8,#16,#15] n "sp2 N in amides and other analogs" +atom [#7D3]=[#6X3]-[#6,#7,#8,#16,#15] n "sp2 N in amides and other analogs" +atom [#7X3r5]([#6X3]=[#8])([#6X3])[#1] n "sp2 N in amides" +atom [#7X3r5]([#6X3]=[#8])([#6X3])[#6X4] n "sp2 N in amides" +atom [#7X3r6]([#6X3]=[#8])([#6X3]=[#8])[#1] n "sp2 N in amides" +atom [#7X3r6]([#6X3]=[#8])([#6X3]=[#8])[#6X4] n "sp2 N in amides" +atom [#7X3r6]([#6X3]=[#8])([#6X3])[#1] n "sp2 N in amides" +atom [#7X3r6]([#6X3]=[#8])([#6X3])[#6X4] n "sp2 N in amides" +atom [#7D4] n4 "sp3 N" +#atom [ND3](=*)(-*)(-*) n4 "sp3 N" +//atom [ND3](=O)(=O)-* no "N in nitro group" +atom [NX3](-[OX1])(=[OX1])-* no "N in nitro group" +atom [NX3r5]1[CX3r5]=[CX3r5][CX3r5]=[CX3r5]1 nb "sp2 N pyrrole" + +// SMARTS rules for oxygens + +atom [OD1] o +//atom [$([#8D1]~[#6^2]~[#8D1])] o +atom [OD1]=[#6] o "O in C=O" +atom [OD1]=[#7] o "O in N=O" +atom [OD1]=[#16] o "O in S=O" +atom [#8X1]#[#6,#7,#8,#16,#15] o1 "sp oxygen" +atom [#8X1]=[#6,#7,#8,#16,#15] o "sp2 oxygen" +atom [#8X1]-[#1,#6,#7,#8,#16,#15] o3 "sp3 oxygen" +atom [#8X1]-[#6X3]=[#7X3] o "O- in amide resonance structure" +//atom [OD1]-[CD3] om "O in O=C-O like acetate" +//atom [OD1]=[CD3]-[OD1] om "O in O=C-O like acetate" +//atom [OD1]-[PD4] om "O in O=P-O like fosfate" +//atom [OD1]=[PD4]-[OD1] om "O in O=P-O like fosfate" +//atom [OD1]-[SD4] om "O in O=S-O like sulfate" +//atom [OD1]=[SD4]-[OD1] om "O in O=S-O like sulfate" +atom [#8D1]-[#6,#15,#16]=[#8D1] om "O in O=C-O (acetate), O=P-O (fosfate), O=S-O (sulfate) +atom [#8D1]=[#6,#15,#16]-[#8D1] om "O in O=C-O (acetate), O=P-O (fosfate), O=S-O (sulfate) +atom [OX2]([#6,#7])[#6,#7] os "O in esters and ethers" +atom [OX2&H0] os "O in esters and ethers" +atom [#8X2&H0] os "O in esters and ethers" +atom [OX2;R]([#6])[#6] os "O in esters and ethers" +atom [OX2&H0]([#6])[#6] os "O in esters and ethers" +atom [OX2]([#6])[#6] os "O in esters and ethers" +atom [OX2r5](-[#6X3]=[#6X3])[#15X3] os "O in esters and ethers" +atom [OX2&H0][#15X4]=[OX1] o "O" +atom [OX2&H0][#16X4]=[OX1] o "O" +atom [OX2&H0][#16X4]-[#6X4] o "O" +atom [OX2&H0]([#15X4])[#6] os "sp3 O in esters and ethers" +atom [OX2r5]([#15X3][Cl])[#6] os "sp3 O in esters and ethers" +atom [OX2&H0]([#16X4])[#6] os "sp3 O in esters and ethers" +atom [OX2]([#1])* oh "sp3 O in hydroxyl group" +atom [OX2]([#1])[#1] ow "O in water" +atom [OX2&H0;!R][CX3]=[OX1] o "O" +atom [OX2&H0;!R][NX2]=[OX1] o "O" +atom [OX2&H0;!R][NX3]=[OX1] o "O" +atom [OX2&H0;!R]([#6X4])([NX3]=[OX1]) os "O in esters and ethers" +atom [OX2&H0;!R]([#6X3])([CX3]=[OX1]) os "O in esters and ethers" +atom [OX2]([#6X3]=[OX1])[#6X4] os "O in esters and ethers" +atom [OX2]([#6X3]=[OX1])[#6X3]=[OX1] os "O in esters and ethers" +atom [OX3&H0] os "O in esters and ethers" +atom [#8X2!H]-[#6X3]=[#6,#7,#8,#16,#15] o2 "sp2 oxygen, like in ester and other analogs" +atom [OX3H] oh "O in hydroxyl group" +atom [#8X1]-[#1] om "O in hydroxide ion" +atom [oX2r5] o2 "sp2 O, aromatic 5r" +atom [oX2r6] o2 "sp2 O, aromatic 6r" +//atom [OD1]=[ND3]=[OD1] on "N in nitro group" +atom [#8X1]=[#7X3]-[#8X1] on "N in nitro group" +atom [#8X1]-[#7X3]=[#8X1] on "N in nitro group" + + +// SMARTS rules for sulfur + +atom [SX1] s "sp2 sulfur" +atom [#16X1] s "sp2 sulfur" +atom [#16X1](=[C,O]) s "sp2 sulfur" +atom [#16X1]#[#6,#7,#8,#16,#15] s1 "sp sulfur" +atom [#16X1]=[#6,#7,#8,#16,#15] st "sp2 sulfur, t=two" +atom [#16X1]-[#6,#7,#8,#16,#15] s3 "sp3 sulfur" +atom [SX2] ss "sp3 sulphur" +atom [#16X2] ss "sp3 sulphur" +atom [sX2r5] st "sp2 S, aromatic 5r" +atom [sX2r6] st "sp2 S, aromatic 6r" +atom [#16X2]-[#6X3]=[#6,#7,#8,#16,#15] st "sp2 sulfur, like in thiolester and other analogs" +atom [SX2]=* s2 "sp2 sulphur" +atom [SX2]#* s2 "sp2 sulphur" +atom [SX2H] sh "sp3 S in thiol" +atom [#16X2H1]-[#6X3]=[#6,#7,#8,#16,#15] st "sp2 sulfur, like in carbothioic S-acid and other analogs" +atom [SX3] s4 "hypervalent S" +atom [SX3](=*)-*=* sx "conjugated S" +atom [SX3](=*)-*#* sx "conjugated S" +atom [SX4] s6 "hypervalent S" +atom [SX4](=*)-*=* sy "conjugated S" +atom [SX4](=*)-*#* sy "conjugated S" +atom [SX5] s7 "sp3d S, hypervalent S" +atom [SX6] s8 "sp3d2 S, hypervalent S" + + +atom [He] He "" +atom [Li] Li "" +atom [Be] Be "" +atom [B] B "" +atom [Ne] Ne "" +atom [Na] Na "" +atom [Mg] Mg "" +atom [Al] Al "" +atom [Si] Si "" +atom [Ar] Ar "" +atom [K] K "" +atom [Ca] Ca "" +atom [Sc] Sc "" +atom [Ti] Ti "" +atom [V] V "" +atom [Cr] Cr "" +atom [Mn] Mn "" +atom [Fe] Fe "" +atom [Co] Co "" +atom [Ni] Ni "" +atom [Cu] Cu "" +atom [Zn] Zn "" +atom [Ga] Ga "" +atom [Ge] Ge "" +atom [As] As "" +atom [Se] Se "" +atom [Kr] Kr "" +atom [Rb] Rb "" +atom [Sr] Sr "" +atom [Y] Y "" +atom [Zr] Zr "" +atom [Nb] Nb "" +atom [Mo] Mo "" +atom [Tc] Tc "" +atom [Ru] Ru "" +atom [Rh] Rh "" +atom [Pd] Pd "" +atom [Ag] Ag "" +atom [Cd] Cd "" +atom [In] In "" +atom [Sn] Sn "" +atom [Sb] Sb "" +atom [Te] Te "" +atom [Xe] Xe "" +atom [Cs] Cs "" +atom [Ba] Ba "" +atom [La] La "" +atom [Ce] Ce "" +atom [Pr] Pr "" +atom [Nd] Nd "" +atom [Pm] Pm "" +atom [Sm] Sm "" +atom [Eu] Eu "" +atom [Gd] Gd "" +atom [Tb] Tb "" +atom [Dy] Dy "" +atom [Ho] Ho "" +atom [Er] Er "" +atom [Tm] Tm "" +atom [Yb] Yb "" +atom [Lu] Lu "" +atom [Hf] Hf "" +atom [Ta] Ta "" +atom [W] W "" +atom [Re] Re "" +atom [Os] Os "" +atom [Ir] Ir "" +atom [Pt] Pt "" +atom [Au] Au "" +atom [Hg] Hg "" +atom [Tl] Tl "" +atom [Pb] Pb "" +atom [Bi] Bi "" +atom [Po] Po "" +atom [At] At "" +atom [Rn] Rn "" +atom [Fr] Fr "" +atom [Ra] Ra "" +atom [Ac] Ac "" +atom [Th] Th "" +atom [Pa] Pa "" +atom [U] U "" +atom [Np] Np "" +atom [Pu] Pu "" +atom [Am] Am "" +atom [Cm] Cm "" +atom [Bk] Bk "" +atom [Cf] Cf "" +atom [Es] Es "" +atom [Fm] Fm "" +atom [Md] Md "" +atom [No] No "" +atom [Lr] Lr "" + +// SMART rules for alkali halides +atom [#3D0] Li+ "lithium ion" +atom [#11D0] Na+ "sodium ion" +atom [#19D0] K+ "potassium ion" +atom [#37D0] Rb+ "rubidium ion" +atom [#55D0] Cs+ "caesium ion" +atom [#9D0] F- "fluoride" +atom [#17D0] Cl- "chloride" +atom [#35D0] Br- "bromide" +atom [#53D0] I- "iodide" diff --git a/data/bondtyp.txt b/data/bondtyp.txt index 51c04e912f..fe4d0d1765 100644 --- a/data/bondtyp.txt +++ b/data/bondtyp.txt @@ -31,49 +31,178 @@ #0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [X2,X3]1[#6]([#7]2)[#6][#6][#6]2[X2,X3][#6]([#7]3)[#6][#6][#6]3[X2,X3][#6]([#7]4)[#6][#6][#6]4[X2,X3][#6]([#7]5)[#6][#6][#6]51 0 1 2 1 2 1 1 3 1 3 4 2 4 5 1 5 2 1 5 6 2 6 7 1 7 8 2 7 9 1 9 10 2 10 11 1 11 8 1 11 12 2 12 13 1 13 14 1 13 15 2 15 16 1 16 17 2 17 14 1 17 18 1 18 19 2 19 20 1 19 21 1 21 22 2 22 23 1 23 20 2 +# N-methylmethanesulfinimidic-acid +[#6X4][#7X2][#16X3] 0 1 1 1 2 2 +# amino--diaminomethylideneamino-methylidene--ethylazanium and analogs +[#6X3]([#7X3])([#7X3])([#7X2][#6X3]([#7X3])([#7X3]([#6]))) 0 1 1 0 2 1 0 3 2 3 4 1 4 5 1 4 6 2 6 7 1 +# cyanoimino-methylene-azanide N#C-N-C#N +[#7X1][#6X2][#7X2][#6X2][#7X1] 0 1 3 1 2 1 2 3 1 3 4 3 +# fulvene analogs +[#6X3]1([#6X3]([#1])([#1]))([#6X3][#6X3][#6X3][#6X3]1) 0 1 2 1 2 1 1 3 1 0 4 1 4 5 2 5 6 1 6 7 2 0 7 1 +[#6X3]1([#7X2])([#6X3][#6X3][#6X3][#6X3]1) 0 1 2 0 2 1 2 3 2 3 4 1 4 5 2 0 5 1 +# CR3-N=N-CH=CH +[#6X4][#7X2][#7X2][#6X3][#6X3] 0 1 1 1 2 2 2 3 1 3 4 2 +#CR2=N-N=CH2 +[#6X3][#7X2][#7X2][#6X3]([#1])([#1]) 0 1 2 1 2 1 2 3 2 3 4 1 3 5 1 +# C2=N-NO2 +[#6X3][#7X2][#7X3]([#8X1])([#8X1]) 0 1 2 1 2 1 2 3 1 2 4 2 +#1-3-oxazole analogs +[#8X2]1[#6X3][#7X2][#6X3][#6X3]1 0 1 1 1 2 2 2 3 1 3 4 2 0 4 1 +#N=C=N-C#N +[#7X1][#6X2][#7X2][#6X2][#7X1] 0 1 2 1 2 2 2 3 1 3 4 3 +#pyridinium analogs +[#7X3]1([#6])([#6X3][#6X3][#6X3][#6X3][#6X3]1) 0 1 1 0 2 1 2 3 2 3 4 1 4 5 2 5 6 1 0 6 2 +[#7X3]1([#1])([#6X3][#6X3][#6X3][#6X3][#6X3]1) 0 1 1 0 2 2 2 3 1 3 4 2 4 5 1 5 6 2 0 6 1 +#Pyrrol-imine analogs +[#6X3]1([#7X2][#1,#6])([#7X2][#6X3][#6X3][#6X3]1) 0 1 2 1 2 1 0 3 1 3 4 2 4 5 1 5 6 2 0 6 1 +#1H-pyrimidin-2-one analogs +[#6X3]1([#8X1])([#7X3][#6X3][#6X3][#6X3][#7X2]1) 0 1 2 0 2 1 2 3 1 3 4 2 4 5 1 5 6 2 0 6 1 +# 5-methylideneimidazol-2-one analogs, 5-methylimidazol-4-one analogs +[#6X3]1([#8X1])([#7X3][#6X3]([#6X3])[#6X3][#7X2]1) 0 1 2 0 2 1 2 3 1 3 4 2 3 5 1 5 6 2 0 6 1 +[#6X3]1([#8X1])([#7X2][#6X3][#7X2][#6X3]1) 0 1 2 0 2 1 2 3 2 3 4 1 4 5 2 0 5 1 +# C/N-N=CH2 +[#6X3]([#1])([#1])[#7X2][#7X2,#7X3,#6X3,#6X4] 0 1 1 0 2 1 0 3 2 3 4 1 +# Imines +[#6X3]([#7X2][#1])([#7X3][#6X3]([#1])[#6X3]) 0 1 2 1 2 1 0 3 1 3 4 1 4 5 1 4 6 2 +[#6X3]([#7X2][#1])([#7X2][#6X3]([#1])[#6X3]) 0 1 2 1 2 1 0 3 1 3 4 2 4 5 1 4 6 1 +[#6X3]([#7X2][#1,#6])([#7X3])([*]) 0 1 2 1 2 1 0 3 1 0 4 1 # Azide [#7D2][#7D2^1][#7D1] 0 1 2 1 2 2 # Nitro -[#8D1][#7D3^2]([#8D1])* 0 1 2 1 2 2 1 3 1 - +# [#8D1][#7D3^2]([#8D1])* 0 1 2 1 2 2 1 3 1; old code +[#8D1][#7D3^2]([#8D1])* 0 1 1 1 2 2 1 3 1 +# nitronium +[#8X1][#7X2]([#8X1]) 0 1 2 1 2 2 +# Dimethyl(methylidene)azanium and analogs +[#7X3]([#6X4])([#6X4])([#6X3]([#1])([#1])) 0 1 1 0 2 1 0 3 2 3 4 1 3 5 1 +[#7X3]([#6X3]([#7X3])([#7X3]))([#6X4])([#6X4]) 0 1 2 1 2 1 1 3 1 0 4 1 0 5 1 +# N2O +[#7X1][#7X2][#8X1] 0 1 3 1 2 1 +# nitroso R-N=O +[#8X1][#7X2][#7X2][#6X3] 0 1 2 1 2 1 2 3 2 +[#8X1][#7X2]([*;!#6]) 0 1 2 1 2 1 +[#8X1][#7X2]([#6X3]([*])([*])) 0 1 2 1 2 1 2 3 1 2 4 1 +# H-N=P(-O)3 +[#7X2]([#1])([#15X4]([#8X1])([#8X1])([#8X1])) 0 1 1 0 2 2 2 3 1 2 4 1 2 5 1 +# NR2-C=C-C=O +[#7X3][#6X3][#6X3][#6X3][#8X1] 0 1 1 1 2 2 2 3 1 3 4 2 +# NR2-C=C-C +[#7X3][#6X3][#6X3]([#6X4,#1])[#6X2] 0 1 1 1 2 2 2 3 1 2 4 1 +# C=CH-NR-CR=O +[#6X3][#6X3]([#1])[#7X3][#6X3][#8X1] 0 1 2 1 2 1 1 3 1 3 4 1 4 5 2 +# bis-methylamino-methylidene-methylazaniumyl--sulfate analogs +[#7X3]([#8X2])([#6X4])([#6X3]([#7X3])([#7X3])) 0 1 1 0 2 1 0 3 2 3 4 1 3 5 1 +# NO2H=CH-CR3 +[#7X3]([#8X2])([#8X1])([#6X3][#6X4]) 0 1 1 0 2 1 0 3 2 3 4 1 +# CR2=N-N(CR3)2 +[#6X3][#7X2][#7X3]([#6X4])([#6X4]) 0 1 2 1 2 1 2 3 1 2 4 1 +#1-2-4-thiadiazole +[#6X3]1([#7X2][#6X3]([#1])[#7X2][#16X2]1) 0 1 2 1 2 1 2 3 1 2 4 2 4 5 1 0 5 1 +# cyanoimino-methylene-azanide N#C-N-C#N +#[#7X1][#6X2][#7X2][#6X2][#7X1] 0 1 3 1 2 1 2 3 1 3 4 3 + +# CR2=CH2 +[#6X3]([#1])([#1])[#6X3] 0 1 1 0 2 1 0 3 2 + +#R-C#N-S +[#16X1][#7X2][#6X2] 0 1 1 1 2 3 +# R(RO)S=O +[#16X3]([#8X1])([#8X2])([*!#8]) 0 1 2 0 2 1 0 3 1 +#R-N=S=O +[#8X1][#16X2][#7X2][*] 0 1 2 1 2 2 2 3 1 +[#8X1][#16X4]([#7X2][#1])([*])([*]) 0 1 2 1 2 2 2 3 1 1 4 1 1 5 1 # Sulfones [#16D4]([#8D1])([#8D1])([*!#8])([*!#8]) 0 1 2 0 2 2 0 3 1 0 4 1 # Sulfates [#16D4]([#8D1])([#8D1])([#8-,#8D1])([#8-,#8D1]) 0 1 2 0 2 2 0 3 1 0 4 1 # Thiosulfates -[#16D4]([#16D1])([#8D1])([#8-,#8])([#8-,#8]) 0 1 2 0 2 2 0 3 1 0 4 1 +#[#16D4]([#16D1])([#8D1])([#8-,#8])([#8-,#8]) 0 1 2 0 2 2 0 3 1 0 4 1 +[#16D4]([#16D1])([#8D1])([#8])([#8-,#8]) 0 1 1 0 2 2 0 3 2 0 4 1 +# Sulfonyl analogs +[#16X3]([#8X1])([#8X1])([#6^2,#7^2]) 0 1 2 0 2 2 0 3 2 +# Sulfinic acid and analogs +[#16X3]([#8X1])([#8X1,#8X2])([#6]) 0 1 2 0 2 1 0 3 1 # Sulfoxides [#16D3]([#8D1])([*!#8])([*!#8]) 0 1 2 0 2 1 0 3 1 # Sulfite [#16D3]([#8D1])([#8D1-])([#8D1-]) 0 1 2 0 2 1 0 3 1 # Sulfur trioxide -[#16D3^2]([#8D1])([#8D1])([#8D1]) 0 1 2 0 2 2 0 3 2 +[#16D3^2]([#8D1])([#8D1])([#8D1]) 0 1 2 0 2 2 0 3 2 # Sulfites [#16D3]([#8D1])([#8])([#8]) 0 1 2 0 2 1 0 3 1 +# 1-Sulfinylethane and analogs C=S=O +[#8X1][#16X2][#6X3] 0 1 2 1 2 2 +#H2C=S=O +[#16X4]([#8X1])([#6X3]([#1])([#1])) 0 1 2 0 2 2 2 3 1 2 4 1 +# Sulfonic acid and sulfonic ester +[#16X4]([#8X1])([#8X1])([#8])* 0 1 2 0 2 2 0 3 1 0 4 1 # Disulfur monoxide [#16D2]([#8D1])([#16D1]) 0 1 2 0 2 2 # Sulfmonoxides [#16D2]([#8D1])([*!#8]) 0 1 2 0 2 1 +# S=N-H +[#16X2,#16X4][#7X2][#1] 0 1 2 1 2 1 # Sulfur dioxide [#16D2]([#8D1])([#8D1]) 0 1 2 0 2 2 - +# S=S=S, S=S +[#16X1][#16X2][#16X1] 0 1 2 1 2 2 +[#16X1][#16X1] 0 1 2 +# S=CH2 +[#16X2][#6X3]([#1])([#1]) 0 1 2 1 2 1 1 3 1 +# dimethyl-oxido-sulfanylidene-lambda5-phosphane and analogs +[#16X1][#15] 0 1 2 +# dihydroxy-sulfanylidene--lambda4-sulfane and analogs +[#16X1;!-][#16X3,#16X4] 0 1 2 +# thiopyrylium +[#16X2]1[#6X3][#6X3][#6X3]([#1])[#6X3][#6X3]1 0 1 1 1 2 2 2 3 1 3 4 1 3 5 2 5 6 1 0 6 2 +# dithiol-1-ium analogs +[#16X2]1[#6X3][#6X3][#6X3][#16X2]1 0 1 2 1 2 1 2 3 2 3 4 1 0 4 1 +# O=S=CR2 +[#8X1][#16X2][#6X3] 0 1 2 1 2 2 + +# 4-methylidenetriphosphole +[#6X3]1([#6X3])([#15X2][#15X2][#15X2][#6X3]1) 0 1 2 0 2 1 2 3 2 3 4 1 4 5 2 0 5 1 +# C=P-H +[#6X3]1([#15X2][#1])([#6X3][#15X2][#6X3][#15X2]1) 0 1 2 1 2 1 0 3 1 3 4 2 4 5 1 5 6 2 0 6 1 +[#6X3]1[#15X2][#6X3][#6X3][#6X3]1 0 1 1 1 2 2 2 3 1 3 4 2 0 4 1 +[#6X3,#6X2,#16X2][#15X2][#1] 0 1 2 1 2 1 +# 3-4-dihydrophosphol-2-one analogs +[#6X3]1[#15X2][#6X3][#6X4][#6X4]1 0 1 1 1 2 2 2 3 1 3 4 1 0 4 1 +# C=P-C +[#6X3][#15X2][#6;!r6] 0 1 2 1 2 1 #Phosphite [#15D3]([#8D1])([#8D1])([#8D2]) 0 1 2 0 2 2 0 3 1 - +#Methylphosphinate and analogs +[#15X3^2]([#8X1;!-])([#8X1;!-])([#6]) 0 1 2 0 2 2 0 3 1 #oxophosphane -#[#15D2]([#8D1])([#1]) 0 1 2 0 2 1 +[#15D2]([#8D1])([#1]) 0 1 2 0 2 1 +#phosphaalkene and analogs +[#15X2;!R]([#6X3,#6X4])([#6X3]) 0 1 1 0 2 2 +[#15X2]([#6X3;!H,#6X4])([#6X3;!H]) 0 1 1 0 2 2 +# P=O +[#15X2][#8X1] 0 1 2 #Nitrosyl Hydride [#7D2]([#8D1])([#1]) 0 1 2 0 2 1 +#Nitrite +[#8X1][#7X2][#8X2][*] 0 1 2 1 2 1 2 3 1 +# chloro-hydroxy-dioxidophosphanium; not working right now +#[#15X4]([#8X1])([#8X1])([#8X2])([*]) 0 1 1 0 2 1 0 3 1 0 4 1 +#[#15X4]([#8X1])([#8X1])([#17])([*]) 0 1 1 0 2 1 0 3 1 0 4 1 # Phosphone -[#15D4]([#8D1])(*)(*)(*) 0 1 2 0 2 1 0 3 1 0 4 1 - +[#15X4]([#8X1])([*])([*])([*]) 0 1 2 0 2 1 0 3 1 0 4 1 +# diphospholes and analogs +[#6][#15X2][#15X2][#6] 0 1 1 1 2 2 2 3 1 +# C-P=O +[#15X2]([#8X1])([#6]) 0 1 2 0 2 1 # Carboxylic Acid, ester, etc. [#6D3^2]([#8D1])([#8])* 0 1 2 0 2 1 0 3 1 # Carbon dioxide [#8D1][#6D2^1][#8D1] 0 1 2 1 2 2 +# Carbon monoxide +[#8X1][#6X1] 0 1 3 # Amide C(=O)N - no negative charge on O (2aix_u1k.sdf) [#6D3^2]([#8D1;!-])([#7])* 0 1 2 0 2 1 0 3 1 # Seleninic acid Se(=O)OH @@ -86,14 +215,26 @@ # avoid aromatics (pdb_ligands_sdf/1yry_msg.sdf) [CD3^2]([#16D1])([N])* 0 1 2 0 2 1 0 3 1 +# C=C=C=CH2 +[#6X3][#6X2][#6X2][#6X3]([#1])([#1]) 0 1 2 1 2 2 2 3 2 3 4 1 3 5 1 # allene C=C=C # (this is problematic -- need to make sure the center carbon is sp) [#6^2][#6D2^1][#6^2] 0 1 2 1 2 2 + +# ethenolate +[#6X3]([#1])([#1])[#6X3]([#8])([#1]) 0 1 1 0 2 1 0 3 2 3 4 1 3 5 1 +# acetylenoate +[#6X2]([#1])[#6X2]([#8]) 0 1 1 0 2 2 2 3 1 + # ene-one C=C=O [#6^2][#6D2^1][#8D1] 0 1 2 1 2 2 # isonitrile / isocyano [#6D1][#7D2^1]* 0 1 3 1 2 1 +# NR2 in ring with hybridized carbon neighbors, do not apply to aromatic N +# valence insted of degree used to fix pdb_ligands_sdf/3dcv_55e.sdf +[Nv2R][#6v3^2][#8v2] 0 1 2 1 2 1 +[Nv2R][#6v3^2][Nv2] 0 1 2 1 2 1 # if three N are present in R-N-guanidine-ish, prefer double bond to the # non-terminal N (i.e. D2 if present) @@ -111,3 +252,4 @@ ### other potential functional groups that may (or may not) be useful to add # imidines ( N=C/N\C=N + diff --git a/data/ringtyp.txt b/data/ringtyp.txt index 3474b3ea51..88342be7e8 100644 --- a/data/ringtyp.txt +++ b/data/ringtyp.txt @@ -12,6 +12,9 @@ # # ############################################################################## +# 3 membered rings +RINGTYP thiirene S1C=C1 + # # 5 membered rings # diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e610799948..d7d951a60d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -45,6 +45,7 @@ set(fingerprints ) set(forcefields + forcefields/forcefieldalexandria.cpp forcefields/forcefieldgaff.cpp forcefields/forcefieldghemical.cpp forcefields/forcefieldmmff94.cpp diff --git a/src/bondtyper.cpp b/src/bondtyper.cpp index 8f40401263..361775654e 100644 --- a/src/bondtyper.cpp +++ b/src/bondtyper.cpp @@ -115,8 +115,8 @@ namespace OpenBabel OBSmartsPattern *currentPattern; OBBond *b1, *b2; - OBAtom *a1,*a2, *a3; - double angle, dist1, dist2; + OBAtom *a1,*a2, *a3, *a4; + double angle, angle1, angle2, dist1, dist2; vector assignments; vector > mlist; vector >::iterator matches, l; @@ -207,6 +207,50 @@ namespace OpenBabel } } // thione + // Imidazole [nD3]1c=[nD3]c=c1 + OBSmartsPattern imidazolium; imidazolium.Init("[#7D3][#6][#7D3][#6][#6]"); + + if (imidazolium.Match(mol)) + { + mlist = imidazolium.GetUMapList(); + for (l = mlist.begin(); l != mlist.end(); ++l) + { + a1 = mol.GetAtom((*l)[1]); + a2 = mol.GetAtom((*l)[2]); + a2->SetFormalCharge(1); + + angle1 = a2->AverageBondAngle(); + dist1 = a1->GetDistance(a2); + + if (angle1 > 115 && angle < 150 && dist1 < 1.72) { + + if ( !a1->HasDoubleBond() ) {// no double bond already assigned + b1 = a1->GetBond(a2); + + if (!b1 ) continue; + b1->SetBondOrder(2); + } + } + + a3 = mol.GetAtom((*l)[3]); + a4 = mol.GetAtom((*l)[4]); + + angle2 = a3->AverageBondAngle(); + dist2 = a3->GetDistance(a4); + + // imidazolium geometries ? + if (angle2 > 115 && angle2 < 150 && dist2 < 1.72) { + + if ( !a3->HasDoubleBond() ) {// no double bond already assigned + b2 = a3->GetBond(a4); + + if (!b2 ) continue; + b2->SetBondOrder(2); + } + } + } + } // imidazolium + // Isocyanate N=C=O or Isothiocyanate bool dist1OK; OBSmartsPattern isocyanate; isocyanate.Init("[#8,#16;D1][#6D2][#7D2]"); diff --git a/src/forcefields/forcefieldalexandria.cpp b/src/forcefields/forcefieldalexandria.cpp new file mode 100644 index 0000000000..357f1ca93e --- /dev/null +++ b/src/forcefields/forcefieldalexandria.cpp @@ -0,0 +1,39 @@ +/********************************************************************** +forcefieldalexandria.cpp - Alexandria force field. + +Copyright (C) 2009 by Frank Peters +Copyright (C) 2006-2007 by Tim Vandermeersch +Copyright (C) 2021 by David van der Spoel + +This file is part of the Open Babel project. +For more information, see + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +***********************************************************************/ + +#include + +#include "forcefieldalexandria.h" + +#include + +using namespace std; + +namespace OpenBabel +{ + //*********************************************** + //Make a global instance + OBForceFieldAlexandria theForceFieldAlexandria("Alexandria", true); + //*********************************************** + +} // end namespace OpenBabel + +//! \file forcefieldalexandria.cpp +//! \brief Alexandria force field diff --git a/src/forcefields/forcefieldalexandria.h b/src/forcefields/forcefieldalexandria.h new file mode 100644 index 0000000000..1e8946649b --- /dev/null +++ b/src/forcefields/forcefieldalexandria.h @@ -0,0 +1,50 @@ +/********************************************************************** +forcefieldalexandriaf.h - Alexandria force field. + +Copyright (C) 2009 by Frank Peters +Copyright (C) 2006 by Tim Vandermeersch +Copyright (C) 2021 by David van der Spoel + +This file is part of the Open Babel project. +For more information, see + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation version 2 of the License. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +***********************************************************************/ + +#include +#include +#include + +#include +#include +#include + +#include "forcefieldgaff.h" + +namespace OpenBabel +{ + + // Class OBForceFieldAlexandria + // class introduction in forcefieldalexandria.cpp + class OBForceFieldAlexandria: public OBForceFieldGaff + { + public: + //! Constructor + explicit OBForceFieldAlexandria(const char* ID, bool IsDefault=true) : OBForceFieldGaff(ID, IsDefault) + { + SetPrmFile("alexandria.prm"); + } + + }; // class OBForceFieldAlexandria + +}// namespace OpenBabel + +//! \file forcefieldalexandria.h +//! \brief Alexandria force field diff --git a/src/forcefields/forcefieldgaff.cpp b/src/forcefields/forcefieldgaff.cpp index b1b07d8cf0..cc9b1317eb 100644 --- a/src/forcefields/forcefieldgaff.cpp +++ b/src/forcefields/forcefieldgaff.cpp @@ -1229,10 +1229,12 @@ namespace OpenBabel SetPartialChargesBeforeAtomTyping(); _mol.SetAtomTypesPerceived(); - // open data/gaff.prm + // open _prmfile ifstream ifs; - if (OpenDatafile(ifs, "gaff.prm").length() == 0) { - obErrorLog.ThrowError(__FUNCTION__, "Cannot open gaff.prm", obError); + if (OpenDatafile(ifs, _prmfile.c_str()).length() == 0) { + std::string msg("Cannot open "); + msg += _prmfile; + obErrorLog.ThrowError(__FUNCTION__, msg.c_str(), obError); return false; } @@ -1249,7 +1251,9 @@ namespace OpenBabel else { delete sp; sp = nullptr; - obErrorLog.ThrowError(__FUNCTION__, " Could not parse atom type table from gaff.prm", obInfo); + std::string msg(" Could not parse atom type table from "); + msg += _prmfile; + obErrorLog.ThrowError(__FUNCTION__, msg.c_str(), obInfo); return false; } } diff --git a/src/forcefields/forcefieldgaff.h b/src/forcefields/forcefieldgaff.h index f7e26416b8..7ceb2acd1e 100644 --- a/src/forcefields/forcefieldgaff.h +++ b/src/forcefields/forcefieldgaff.h @@ -82,6 +82,8 @@ namespace OpenBabel class OBForceFieldGaff: public OBForceField { protected: + //! Name of the parameter file + std::string _prmfile; //! Parses the parameter file bool ParseParamFile() override; //! Sets atomtypes to Gaff types in _mol @@ -130,11 +132,17 @@ namespace OpenBabel _pairfreq = 10; _cutoff = false; _linesearch = LineSearchType::Newton2Num; + _prmfile = "gaff.prm"; } //! Destructor virtual ~OBForceFieldGaff(); + //! Set the new parameter file name + void SetPrmFile(const std::string &prm) + { + _prmfile = prm; + } //! Assignment OBForceFieldGaff &operator = (OBForceFieldGaff &);