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++) {
  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));

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:

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


const Conformer &conf = mol.getConformer();

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?

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

Reply via email to