Hi,
Sorry I haven't followed up on the github questions yet. Between travel and
getting the release ready I've been pretty busy.
I think this code snippet is mostly correct:
Kekulize(mol);
assignChiralTypesFrom3D(mol);
assignStereochemistry(mol,true,true);
compute2DCoords(mol);
const Conformer = mol.getConformer();
WedgeMolBonds(mol,);
though I would also call sanitizeMol at the beginning of all of that in
order to make sure that implicit properties are there and that rings have
been found.
I think that where you're getting confused is with what
assignStereochemistry() is doing.
The second argument "cleanIt" (
http://rdkit.org/docs/cppapi/namespaceRDKit_1_1MolOps.html#abae38bdd181c070deee55a4d3ee12885)
tells the RDKit to remove stereochemistry specifications on atoms/bonds
that cannot have stereochemistry (the documentation says "bonds", but it's
actually both atoms and bonds). So if you have an atom that cannot be a
chiral center, you will end up with no wedging.
That's why this molecule:
[image: Inline image 1]
ends up losing the wedging on the ring to the right: that atom cannot be a
chiral center.
If you really want the wedging to be there, even if it's chemically
unreasonable, you should be able to get that like this:
assignStereochemistry(mol,false,true);
Best,
-greg
On Thu, Apr 6, 2017 at 4:22 PM, Shubbey McBean
wrote:
> 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 mol.addAtom(new Atom(atom[i].element));
> }
>
> for(int i=0;i mol.addBond(bond[i].atom1,bond[i].atom2,type);
> }
> Conformer *confp = new Conformer(atom.size());
> for(int i=0;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 = mol.getConformer();
> WedgeMolBonds(mol,);
>
> 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
>
>
--
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