Re: [Open Babel] Explicit H as property

2023-02-22 Thread Noel O'Boyle
Indeed - Andrew's approach is all you can do at the moment. I've often thought it would be a useful option to add, and just a one or two line change to the C++ (just skip the part where the "organic subset" is treated as special). Regarding SMARTS, given that "CC" is also a valid SMARTS that

Re: [Open Babel] Explicit H as property

2023-02-22 Thread Thomas
Thank you Andrew, your script does the job. Apparently, this was the original behaviour of OB back in 2011, then it has been preferred to write H as atoms instead ( https://sourceforge.net/p/openbabel/mailman/message/26960761/). I would include your script under GPL license if you don't mind.

Re: [Open Babel] Explicit H as property

2023-02-22 Thread Andrew Dalke
On Feb 21, 2023, at 19:23, Thomas wrote: > Is it possible to get SMILES with explicit hydrogens as a "property" of > another atom? > For example from the SMILES "CC" I'd like to get '[CH3][CH3]' instead of > '[H]C(C([H])([H])[H])([H])[H]' I don't see a direct way to do it. I wrote

[Open Babel] Explicit H as property

2023-02-21 Thread Thomas
I am including OpenBabel as an alternative chemical library in a software that uses RDKit, but I'm missing some functions. Is it possible to get SMILES with explicit hydrogens as a "property" of another atom? For example from the SMILES "CC" I'd like to get '[CH3][CH3]' instead of