{"action":"created","issue":{"url":"https://api.github.com/repos/openbabel/openbabel/issues/1300","repository_url":"https://api.github.com/repos/openbabel/openbabel","labels_url":"https://api.github.com/repos/openbabel/openbabel/issues/1300/labels{/name}","comments_url":"https://api.github.com/repos/openbabel/openbabel/issues/1300/comments","events_url":"https://api.github.com/repos/openbabel/openbabel/issues/1300/events","html_url":"https://github.com/openbabel/openbabel/issues/1300","id":209581124,"number":1300,"title":"bond type 4 in SDF gives wrong Implicit-H count","user":{"login":"openbabel-bot","id":25939323,"avatar_url":"https://avatars0.githubusercontent.com/u/25939323?v=3","gravatar_id":"","url":"https://api.github.com/users/openbabel-bot","html_url":"https://github.com/openbabel-bot","followers_url":"https://api.github.com/users/openbabel-bot/followers","following_url":"https://api.github.com/users/openbabel-bot/following{/other_user}","gists_url":"https://api.github.com/users/openbabel-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/openbabel-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openbabel-bot/subscriptions","organizations_url":"https://api.github.com/users/openbabel-bot/orgs","repos_url":"https://api.github.com/users/openbabel-bot/repos","events_url":"https://api.github.com/users/openbabel-bot/events{/privacy}","received_events_url":"https://api.github.com/users/openbabel-bot/received_events","type":"User","site_admin":false},"labels":[{"id":545069043,"url":"https://api.github.com/repos/openbabel/openbabel/labels/auto-migrated","name":"auto-migrated","color":"ededed","default":false},{"id":245402776,"url":"https://api.github.com/repos/openbabel/openbabel/labels/bug","name":"bug","color":"e11d21","default":true},{"id":545640493,"url":"https://api.github.com/repos/openbabel/openbabel/labels/low%20priority","name":"low priority","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"openbabel-bot","id":25939323,"avatar_url":"https://avatars0.githubusercontent.com/u/25939323?v=3","gravatar_id":"","url":"https://api.github.com/users/openbabel-bot","html_url":"https://github.com/openbabel-bot","followers_url":"https://api.github.com/users/openbabel-bot/followers","following_url":"https://api.github.com/users/openbabel-bot/following{/other_user}","gists_url":"https://api.github.com/users/openbabel-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/openbabel-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openbabel-bot/subscriptions","organizations_url":"https://api.github.com/users/openbabel-bot/orgs","repos_url":"https://api.github.com/users/openbabel-bot/repos","events_url":"https://api.github.com/users/openbabel-bot/events{/privacy}","received_events_url":"https://api.github.com/users/openbabel-bot/received_events","type":"User","site_admin":false},"assignees":[{"login":"openbabel-bot","id":25939323,"avatar_url":"https://avatars0.githubusercontent.com/u/25939323?v=3","gravatar_id":"","url":"https://api.github.com/users/openbabel-bot","html_url":"https://github.com/openbabel-bot","followers_url":"https://api.github.com/users/openbabel-bot/followers","following_url":"https://api.github.com/users/openbabel-bot/following{/other_user}","gists_url":"https://api.github.com/users/openbabel-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/openbabel-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openbabel-bot/subscriptions","organizations_url":"https://api.github.com/users/openbabel-bot/orgs","repos_url":"https://api.github.com/users/openbabel-bot/repos","events_url":"https://api.github.com/users/openbabel-bot/events{/privacy}","received_events_url":"https://api.github.com/users/openbabel-bot/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2014-04-15T18:21:16Z","updated_at":"2017-05-31T05:53:58Z","closed_at":null,"body":"In an SDF, bond type \"4\" (aromatic) is not legal but is widely used. OpenBabel seems to parse it correctly (e.g. it will produce a correct SMILES or SDF), but atom->ImplicitHydrogenCount() returns the wrong value. See the attached C++ program. Here is the output of the program; note that impH is different in the two molecules even though both are benzene.\r\n\r\natom 1:  impH: 1, bond orders: 2 1\r\natom 2:  impH: 1, bond orders: 2 1\r\natom 3:  impH: 1, bond orders: 1 2\r\natom 4:  impH: 1, bond orders: 2 1\r\natom 5:  impH: 1, bond orders: 1 2\r\natom 6:  impH: 1, bond orders: 2 1\r\n\r\natom 1:  impH: 0, bond orders: 2 1\r\natom 2:  impH: 0, bond orders: 2 1\r\natom 3:  impH: 0, bond orders: 1 2\r\natom 4:  impH: 0, bond orders: 2 1\r\natom 5:  impH: 0, bond orders: 1 2\r\natom 6:  impH: 0, bond orders: 2 1\r\n\n\nReported by: @cjames53\n\nOriginal Ticket: [openbabel/bugs/920](https://sourceforge.net/p/openbabel/bugs/920)"},"comment":{"url":"https://api.github.com/repos/openbabel/openbabel/issues/comments/305090855","html_url":"https://github.com/openbabel/openbabel/issues/1300#issuecomment-305090855","issue_url":"https://api.github.com/repos/openbabel/openbabel/issues/1300","id":305090855,"user":{"login":"baoilleach","id":45337,"avatar_url":"https://avatars2.githubusercontent.com/u/45337?v=3","gravatar_id":"","url":"https://api.github.com/users/baoilleach","html_url":"https://github.com/baoilleach","followers_url":"https://api.github.com/users/baoilleach/followers","following_url":"https://api.github.com/users/baoilleach/following{/other_user}","gists_url":"https://api.github.com/users/baoilleach/gists{/gist_id}","starred_url":"https://api.github.com/users/baoilleach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baoilleach/subscriptions","organizations_url":"https://api.github.com/users/baoilleach/orgs","repos_url":"https://api.github.com/users/baoilleach/repos","events_url":"https://api.github.com/users/baoilleach/events{/privacy}","received_events_url":"https://api.github.com/users/baoilleach/received_events","type":"User","site_admin":false},"created_at":"2017-05-31T05:53:58Z","updated_at":"2017-05-31T05:53:58Z","body":"Here's the .cpp file from the original bug report:\r\n<pre>\r\n\r\n#include <openbabel/babelconfig.h>\r\n#include <openbabel/mol.h>\r\n#include <openbabel/obconversion.h>\r\n#include <openbabel/plugin.h>\r\n\r\nusing namespace std;\r\nusing namespace OpenBabel;\r\n\r\nconst char *benzenes[] = {\r\n\r\n  // Normal Kekule form\r\n  \"[NO NAME]\\n\"\r\n  \"  CHEMW2  04151411042D                              \\n\"\r\n  \"Created with ChemWriter - http://chemwriter.com\\n\"\r\n  \"  6  6  0  0  0  0            999 V2000\\n\"\r\n  \"  -15.8305   -2.0277    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"  -11.5003   -4.5277    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"   -7.1702   -2.0277    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"   -7.1702    2.9723    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"  -11.5003    5.4723    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"  -15.8305    2.9723    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"  1  2  2  0  0  0  0\\n\"\r\n  \"  2  3  1  0  0  0  0\\n\"\r\n  \"  3  4  2  0  0  0  0\\n\"\r\n  \"  4  5  1  0  0  0  0\\n\"\r\n  \"  5  6  2  0  0  0  0\\n\"\r\n  \"  6  1  1  0  0  0  0\\n\"\r\n  \"M  END\\n\",\r\n\r\n  // Nonstandard aromatic (bond type 4) form\r\n  \"[NO NAME]\\n\"\r\n  \"  CHEMW2  04151411042D                              \\n\"\r\n  \"Created with ChemWriter - http://chemwriter.com\\n\"\r\n  \"  6  6  0  0  0  0            999 V2000\\n\"\r\n  \"  -15.8305   -2.0277    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"  -11.5003   -4.5277    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"   -7.1702   -2.0277    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"   -7.1702    2.9723    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"  -11.5003    5.4723    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"  -15.8305    2.9723    0.0000 C   0  0  0  0  0  0  0  0  0  0  0  0\\n\"\r\n  \"  1  2  4  0  0  0  0\\n\"\r\n  \"  2  3  4  0  0  0  0\\n\"\r\n  \"  3  4  4  0  0  0  0\\n\"\r\n  \"  4  5  4  0  0  0  0\\n\"\r\n  \"  5  6  4  0  0  0  0\\n\"\r\n  \"  6  1  4  0  0  0  0\\n\"\r\n  \"M  END\\n\",\r\n\r\n  NULL\r\n};\r\n\r\nmain(int argc, char **argv) {\r\n\r\n  OBConversion conv;\r\n  OBMol mol;\r\n  const char **p;\r\n\r\n  conv.SetInAndOutFormats(\"sdf\", \"sdf\");\r\n\r\n  for (p = benzenes; *p; p++) {\r\n    cout << \"\\n\";\r\n    conv.ReadString(&mol, *p);\r\n    FOR_ATOMS_OF_MOL(atom, &mol) {\r\n      int idx = atom->GetIdx();\r\n      cout << \"atom \" << idx << \": \";\r\n      cout << \" impH: \" << atom->ImplicitHydrogenCount() << \", bond orders:\";\r\n      FOR_BONDS_OF_ATOM(b, &(*atom)) {\r\n\tint border = b->GetBO();\r\n\tcout << \" \" << border;\r\n      }\r\n      cout << \"\\n\";\r\n    }\r\n  }\r\n}\r\n\r\n</pre>"}}
{"actor":{"display_login":"baoilleach"}}