Ok, to sum up, OBDepictPrivate::SetWedgeAndHash(OBMol*) is the function I want
to use,
which essentially amounts to copying it into my application. This function
seems to be "dead
code" (in the sense that it is not referenced anywhere) -- but still very
useful for my scenario
to have. Why not make it a public function somewhere in stereo/stereo.h?
Best,
Hendrik
On Saturday, June 10, 2017 21:14:08 Hendrik Vennekate wrote:
> Hi Noel,
>
> thanks again for the quick reply and my apologies for my newb-ish mistakes
> in this field (on an unrelated note: inspecting the code, I realized that
> if anything I should have checked IsWedge() and IsHash() separately). So,
> IsChiral() is indeed true for the one relevant atom.
>
> My goal in this, however, would have been to arrive at an OBMol with hash
> and/or wedge bonds. It seems there is some way to accomplish that using
> what is around in stereo/perception.cpp, but documentation seems to be
> rather scarce. I'm guessing I'll have to eventually mimic what
> OBDepict::DrawMolecule() does (or TetStereoToWedgeHash() called therein).
>
> I'll keep exploring, but thanks again for clearing up that stereo-chemistry
> _is_ indeed processed.
>
> Best,
>
> Hendrik
>
> On Friday, June 09, 2017 13:12:31 Noel O'Boyle wrote:
> > The first question to check is whether we are reading the stereo
> > correctly:
> >
> > obabel -iinchi
> > -:"InChI=1S/C3H7NO2/c1-2(4)3(5)6/h2H,4H2,1H3,(H,5,6)/t2-/m1/s1" -osmi
> > C[C@H](C(=O)O)N
> >
> > This SMILES does indeed represent D-Alanine.
> >
> > The problem is that you have generated a 0D mol file:
> > e.g. obabel -iinchi
> > -:"InChI=1S/C3H7NO2/c1-2(4)3(5)6/h2H,4H2,1H3,(H,5,6)/t2-/m1/s1" -omol
> > ...where the tetrahedral stereo is stored on the atom rather than on the
> > bonds.
> >
> > In other words, gen2D didn't work for you (all the atoms have 0
> > coordinates I'm guessing). I'm not familiar with DoTransformations,
> > but it should work fine via OBOp.FindType("gen2D") or so.
> >
> > - Noel
> >
> > On 8 June 2017 at 21:37, Hendrik Vennekate <hvennek...@gmx.de> wrote:
> > > Hi Noel,
> > >
> > >
> > >
> > > thanks for the quick reply. Actually, I was trying it through the
> > > library
> > > directly (approximately like below):
> > >
> > > using namespace OpenBabel;
> > >
> > > OBConversion conversion;
> > >
> > > conversion.SetInFormat("INCHI");
> > >
> > > OBMol molecule;
> > >
> > > conversion.ReadString(&molecule,
> > > "InChI=1S/C3H7NO2/c1-2(4)3(5)6/h2H,4H2,1H3,(H,5,6)/t2-/m1/s1");
> > >
> > > std::map<std::string, std::string> options;
> > >
> > > options["gen2D"] = "";
> > >
> > > molecule.DoTransformations(&options, &conversion);
> > >
> > > FOR_BONDS_OF_MOL(obbond, molecule)
> > >
> > > cout << obbond->IsWedgeOrHash() << endl;
> > >
> > > ... and the output indicated that no bond was a wedge or hash, as I
> > > would
> > > have expected.
> > >
> > >
> > >
> > > Alternatively, I put the above InChI string into a file and did the
> > > following:
> > >
> > > obabel -i inchi /tmp/d-alanine.inchi -Otestout.mol
> > >
> > > To the best of my understanding of the MOL format, the fourth column of
> > > the
> > > bond block should contain the stereo info if any. The output bond block
> > > reads:
> > >
> > > 1 2 1 0 0 0 0
> > >
> > > 2 3 1 0 0 0 0
> > >
> > > 2 4 1 0 0 0 0
> > >
> > > 3 5 2 0 0 0 0
> > >
> > > 3 6 1 0 0 0 0
> > >
> > > so all zeros.
> > >
> > >
> > >
> > > Again, I'm curious what I'm missing...
> > >
> > >
> > >
> > > Best wishes,
> > >
> > >
> > >
> > > Hendrik
> > >
> > > On Thursday, June 08, 2017 20:30:09 you wrote:
> > >> Hi there,
> > >>
> > >>
> > >>
> > >> The wiki is out of date. Stereo works fine. What was the specific
> > >> command
> > >>
> > >> you used that you feel didn't work?
> > >>
> > >>
> > >>
> > >> Noel
> > >>
> > >>
> > >>
> > >> On 8 Jun 2017 8:08 p.m., "Hendrik Vennekate" <hvennek...@gmx.de> wrote:
> > >>
> > >>
> > >>
> > >> Hello OpenBabel list,
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> a quick question regarding InChI support: on the corresponding wiki
> > >> page
> > >> it
> > >>
> > >> reads, "Experimental InChI read support was added in version 2.1,
> > >> although
> > >>
> > >> this does not always support stereochemistry." Has this been improved
> > >>
> > >> meanwhile?
> > >>
> > >>
> > >>
> > >> In a little experiment with wikidata's InChI string for D-alanine
> > >>
> > >> (1S/C3H7NO2/c1-2(4)3(5)6/h2H,4H2,1H3,(H,5,6)/t2-/m1/s1), I could not
> > >> seem
> > >>
> > >> to successfully reproduce the stereochemistry.
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> Any support is greatly appreciated.
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> Kind regards,
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >>
> > >> Hendrik
> > >>
> > >>
> > >>
> > >> ------------------------------------------------------------
> > >>
> > >> ------------------
> > >>
> > >> Check out the vibrant tech community on one of the world's most
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss