Hi Jason,

There's no direct way to do this.

The easiest way that I can think of to approximate it would be to set the
ChiralTag on the possibly chiral atoms to CHI_TETRAHEDRAL_CW, call
assignStereoChemistry(), and then loop over the possibly chiral atoms again
to see if they have the absolute chirality you want. If not, flip the
ChiralTag to CHI_TETRAHEDRAL_CCW. At the end you should call
assignStereoChemistry() again (make sure that you set the `force` argument
to true) to confirm that everything worked.

This will not work in cases where you have dependent stereochemistry (i.e.
the absolute chirality of one atom is dependent on the absolute chirality
of another), but that is, fortunately, not super common.

-greg




On Thu, Jul 27, 2017 at 6:14 PM, Jason Biggs <jasondbi...@gmail.com> wrote:

> When creating a molecule, I can set a stereocenter by setting the
> chiralTag to be clockwise or counterclockwise, and get back the absolute
> chirality
>
> int atoms [5] = {7, 6, 6, 8, 9};
> RDKit::RWMol *mol = new RDKit::RWMol();
> for (int i : atoms) {
> RDKit::Atom atom(i);
> mol->addAtom(&atom);
> }
> mol->addBond(0, 1, RDKit::Bond::SINGLE);
> mol->addBond(1, 2, RDKit::Bond::SINGLE);
> mol->addBond(1,3, RDKit::Bond::SINGLE);
> mol->addBond(1, 4, RDKit::Bond::SINGLE);
>
> std::cout << RDKit::MolToSmiles(*mol, true) << std::endl;
>
>
> mol->getAtomWithIdx(1)->setChiralTag(RDKit::Atom::CHI_TETRAHEDRAL_CW);
> RDKit::MolOps::sanitizeMol(*mol);
> RDKit::MolOps::assignStereochemistry(*mol);
> std::cout << RDKit::MolToSmiles(*mol, true) << std::endl;
> std::string cipCode;
> mol->getAtomWithIdx(1)->getProp(RDKit::common_properties::_CIPCode,
> cipCode);
> std::cout << cipCode << std::endl;
>
> returns
>
> CC(N)(O)F
> C[C@](N)(O)F
> S
>
>
> How could I do the reverse?  Given the absolute chirality in terms of the
> CIP code, how can I assign the chirality such that it propagates to the
> smiles string?  If I replace the line with "setChiralTag" with
>
> mol->getAtomWithIdx(1)->setProp(RDKit::common_properties::_ChiralityPossible,
> 1);
> mol->getAtomWithIdx(1)->setProp(RDKit::common_properties::_CIPCode, "S");
>
> then I see no chirality in the returned smiles string.
>
>
> Jason
>
>
> ------------------------------------------------------------
> ------------------
> 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

Reply via email to