Dative ring systems cannot be created from SMILES. #1255

Open
janholstjensen opened this Issue Jan 9, 2017 · 0 comments

Projects

None yet

1 participant

@janholstjensen
Contributor
>>> m1 = Chem.MolFromSmiles('[Fe]->1->[Cu]->[Fe]<-[Cu]<-[Fe]->1')
[17:01:57]

****
Incomplete Code
This routine is still under development
Violation occurred on line 253 in file /home/jhje/rdkit/Code/GraphMol/Bond.cpp
Failed Expression: Bad bond type
****

Fix that works for my purposes:

jhje@tempdev:~/rdkit/Code/GraphMol$ git diff Bond.cpp
diff --git a/Code/GraphMol/Bond.cpp b/Code/GraphMol/Bond.cpp
index 4f5c8d3..cf11c24 100644
--- a/Code/GraphMol/Bond.cpp
+++ b/Code/GraphMol/Bond.cpp
@@ -176,6 +176,8 @@ double Bond::getBondTypeAsDouble() const {
       return 1.0;
       break;  // FIX: this should probably be different
     case DATIVE:
+    case DATIVEL:
+    case DATIVER:
       return 1.0;
       break;  // FIX: again probably wrong
     case ZERO:
@@ -241,6 +243,8 @@ double Bond::getValenceContrib(const Atom *atom) const {
         return 0.0;
       break;
     case DATIVE:
+    case DATIVEL:
+    case DATIVER:
       if (atom->getIdx() == getEndAtomIdx())
         return 1.0;
       else
jhje@tempdev:~/rdkit/Code/GraphMol$ 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment