Can anyone shed some light on this?  If I use Gen2D and then try to write
out an InChI, the stereo layer is wiped out.

#include <string>
#include <sstream>

#include <openbabel/mol.h>
#include <openbabel/obconversion.h>
#include <openbabel/op.h>

using namespace std;
using namespace OpenBabel;

/*----------------------------------------------------------------------
 * FUNCTION: emol_mk_init
 *      Initialize some static variables.
 ----------------------------------------------------------------------*/

int main(int argc, char **argv)
{
  char *smiles;
  int smilen;

  OBConversion *pconv_smi = new OBConversion();
  OBConversion *pconv_ich = new OBConversion();
  pconv_smi->SetInAndOutFormats("smi", "can");
  pconv_ich->SetOutFormat("inchi");

  OBMol *pmol = new OBMol;;
  pconv_smi->ReadString(pmol, "C[C@H](Br)Cl");

  cout << pconv_ich->WriteString(pmol, true) << "\n";
  cout << pconv_smi->WriteString(pmol, true) << "\n";

  OBOp* pOp = OBOp::FindType("gen2D");
  pOp->Do(pmol);

  cout << pconv_ich->WriteString(pmol, true) << "\n";
  cout << pconv_smi->WriteString(pmol, true) << "\n";

}

The output is:

InChI=1S/C2H4BrCl/c1-2(3)4/h2H,1H3/t2-/m1/s1

C[C@H](Br)Cl

==============================

*** Open Babel Warning  in InChI code

  #0 :Omitted undefined stereo

InChI=1S/C2H4BrCl/c1-2(3)4/h2H,1H3

C[C@H](Br)Cl



Notice that the stereo layer "/t2-/m1/s1" of the InChI is gone after
applying Gen2D to it. I would have imagined that Gen2D would add
coordinates, but not actually alter the molecule itself. But the chiral
center is still OK in the SMILES string.

I can only guess that some stereo flag is getting reset, and InChI pays
attention while SMILES ignores it.

Thanks!
Craig
------------------------------------------------------------------------------
Full-scale, agent-less Infrastructure Monitoring from a single dashboard
Integrate with 40+ ManageEngine ITSM Solutions for complete visibility
Physical-Virtual-Cloud Infrastructure monitoring from one console
Real user monitoring with APM Insights and performance trend reports 
Learn More http://pubads.g.doubleclick.net/gampad/clk?id=247754911&iu=/4140
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to