Hello again!

RDKit nicely provides several functions to accept molecule input under the
FileParsers module.  For example, we have MolFileToMol(), MolBlockToMol(),
Mol2FileToMol(), and so forth.  Each of these parses the input and then
does various cleanup to generate stereochemistry and such.

In my case, my input is passed simply as raw molecule information (elems +
3D coordinates). So I generate the molecule manually, as follows:

RWMol mol;
// my info in atom and bond structs
for(int i=0;i<atom.size();i++) {
    mol.addAtom(new Atom(atom[i].element));
  }

  for(int i=0;i<bond.size();i++) {
    mol.addBond(bond[i].atom1,bond[i].atom2,type);
  }
  Conformer *confp = new Conformer(atom.size());
  for(int i=0;i<atom.size();i++) {
    confp->setAtomPos(i, RDGeom::Point3D(atom[i].x,atom[i].y,atom[i].z));
  }
  mol.addConformer(confp,true);

At this point I have a molecule but it isn't cleaned up.  My question is,
what is the most concise order of operations I need to generate a 2D
depiction, including wedge information, from this setup?  I have tried a
few different approaches and am getting mixed results-- some approaches
produce better results than others, but it isn't consistent (one method may
get a better result on one molecule, but worse on another).  I posted more
about this in a bug report (may not be a bug) here:
https://github.com/rdkit/rdkit/issues/1379

So here is an example of something I've tried:

Kekulize(mol);
assignChiralTypesFrom3D(mol);
assignStereochemistry(mol,true,true);
compute2DCoords(mol);

const Conformer &conf = mol.getConformer();
WedgeMolBonds(mol,&conf);

As noted in the github post, the assignStereochemistry() part can sometimes
cause wedging to disappear completely.  I chose this particular order by
groking through the FileParser routines to see how they handled molecules
post-3D input.

I feel like I am overcomplicating this.  Is there a recommended approach?

Thanks!
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to