Hi Nick,
Thank you the quick response. I have two methods that I called when they are enabled. One standardizes the molecules by iteratively applying a number of applicable reactions so as to adjust charges, etc.. It uses preprocessing method if enabled, and just convert implicit Hs to explicit, if not.
This is the preprocessing code:
AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(molecule);
// Aromaticity aromaticity = new Aromaticity( ElectronDonation.cdk(), Cycles.cdkAromaticSet());
Aromaticity aromaticity = new Aromaticity(ElectronDonation.daylight(), Cycles.or(Cycles.all(), Cycles.all(6)));
for (IBond bond : molecule.bonds()) {
if (bond.isAromatic() && bond.getOrder() == IBond.Order.UNSET) {
bond.setFlag(CDKConstants.ISAROMATIC, true);
bond.getAtom(0).setFlag(CDKConstants.ISAROMATIC, true);
bond.getAtom(1).setFlag(CDKConstants.ISAROMATIC, true);
}
}
// aromaticity.apply(molecule);
// Kekulization.kekulize(molecule);
AtomContainerManipulator.convertImplicitToExplicitHydrogens(molecule);
StructureDiagramGenerator sdg = new StructureDiagramGenerator();
sdg.setMolecule(molecule);
sdg.generateCoordinates();
IAtomContainer layedOutMol = sdg.getMolecule();
return layedOutMol;
I do not really use any postprocessing. I use the flag settings that I mentioned yesterday. For post-processing, I live it to AMBIT by setting smrkMan.setFlagProcessResultStructures(true).
You will also notice that I have commented out the aromatization and kekulization of the molecule. Even when enabling either, I have the sme problem.
Another bizarre thing I realized is that sometimes when I apply a chain of reactions, it happens that one intermediate will not undergo a reaction for which it qualifies. However, if I take the very same compound with its structure are returned in the previous iteration, and run it separately (as a starting molecule and not just an intermediate), the transformation will work fine.
Anyway, may be solving the first issue, and it might point to a solution to the apparently unrelated second issue (that I could describe in more detail later).
Thanks,
Yannick
On Fri, Jun 9, 2017 at 4:33 AM, Nikolay Kochev nick@uni-plovdiv.net wrote:
Hi Yannick,
I did some tests at my site and the SMIRKS transformation looks to be working.
Stereo is preserved in both cases
smrkMan.setFlagApplyStereoTransformation(true)
and
smrkMan.setFlagApplyStereoTransformation(false)
Here are the results:
(1) case: smrkMan.setFlagApplyStereoTransformation(true)
C[C@H]1C@@HO)C)O)O)O)O)O -->
C[C@H]1C@@HO)O)O)O.C[C@H]1C@@HO)O)O
Here is a web link that depicts the reactant
https://apps.ideaconsult.net/ambit2/depict?search=C%5BC%40H%5D1%5BC%40%40H%5D%28%5BC%40H%5D%28%5BC%40H%5D%28%5BC%40%40H%5D%28O1%29O%5BC%40%40H%5D2%5BC%40%40H%5D%28%5BC%40H%5D%28%5BC%40%40H%5D%28O%5BC%40H%5D2OC3%3DCC%3DC%28C%3DC3%29C4CC%28%3DO%29C5%3DC%28C%3DC%28C%3DC5O4%29O%29O%29C%29O%29O%29O%29O%29O&smarts=#
Here is a web link that depicts the obtained product
https://apps.ideaconsult.net/ambit2/depict?search=C%5BC%40H%5D1%5BC%40%40H%5D%28%5BC%40H%5D%28%5BC%40H%5D%28%5BC%40%40H%5D%28O1%29Oc2ccc%28cc2%29C3CC%28%3DO%29c4c%28cc%28cc4O3%29O%29O%29O%29O%29O.C%5BC%40H%5D1%5BC%40%40H%5D%28%5BC%40H%5D%28%5BC%40H%5D%28%5BC%40%40H%5D%28O%29O1%29O%29O%29O&smarts=#
(2)It also works good enough for this case smrkMan.setFlagApplyStereoTransformation(false)
Only one stereo center is lost (9 chiral atom remain out of 10)
C[C@H]1C@@HO)C)O)O)O)O)O --> C[C@H]1C@@HO)O)O)O.C[C@H]1C@@HO)O)O
In order to be more helpful to you,
please, can you sent us the java code that performs the reaction including the molecule pre-processing and post-processing?
With best regards
Nick
On 2017-06-08 22:38, Yannick .Djoumbou wrote:
Hi all,
I have an issue with the transformation of compounds while handling
stereochemistry.
I have the following compound CID54424913 (PubChem) with SMILES
"C[C@H]1C@@HO)C)O)O)O)O)O".
I would like to transform it, and obtain the product that also has the
correct isomeric information.
1) These are the settings for my SMIRKSManager:
this.smrkMan.setFlagApplyStereoTransformation(true);
this.smrkMan.setFlagCheckResultStereo(true);
this.smrkMan.setFlagFilterEquivalentMappings(true);
this.smrkMan.setFlagProcessResultStructures(true);
2) This is my SMIRKSReaction
"[H:20][#8:9][C@@:5]1([H:18])C@:6([#8:8]-[#6:23])[#8:7]C@@:2(C:1([H:13])[H:14])C@:3([#8:11][H:22])[C@@:4]1([H:17])[#8:10][H:21]>>[H][#8]-[#6:23].[H][#8:8][C@@:6]1([H:19])[#8:7]C@@:2(C:1([H:13])[H:14])C@:3([#8:11][H:22])C@@:4([#8:10][H:21])[C@@:5]1([H:18])[#8:9][H:20]".
It implements the removal of the rhamnose moiety from a
alpha-L-rhamnoside. The compound is a valid substrate, as it matches
the SMARTS string from the reactant/substrate. When I apply the
following reaction to the compound, I do not get any result. However,
I do get results when I set the FlagApplyStereoTransformation to false
( as in this.smrkMan.setFlagApplyStereoTransformation(false) ), I get
the following results:
(a) InChI=1S/C6H12O5/c1-2-3(7)4(8)5(9)6(10)11-2/h2-10H,1H3
(b)
InChI=1S/C21H22O9/c1-9-18(25)19(26)20(27)21(28-9)29-12-4-2-10(3-5-12)15-8-14(24)17-13(23)6-11(22)7-16(17)30-15/h2-7,9,15,18-23,25-27H,8H2,1H3
As you can see, the resulting structures do no include any
stereochemical information at all. In an earlier e-mail exchange a
long time ago, I got the confirmation that AMBIT now supports
stereochemistry in the transformations.
Is there anything that I am missing in my settings? If yes, what?
How can I get the resulting products with stereochemical information?
Thank you for your help.
Best,
Yannick
Hi all,
I actually did some more digging, and realized that because my molecule preprocessing function adds explicit hydrogens, this causes AMBIT to return transforms without seterochemistry.Here are two scenarios:
I create a molecule mol and a SMIRKS reaction sr that can transform mol.
SMIRKSManager smrkMan = new SMIRKSManager(SilentChemObjectBuilder.getInstance());
IAtomContainer mol = em.smiParser.parseSmiles("OC[C@H]1OC(OC2=CC(OS([O-])(=O)=O)=C([N-][N+]#N)C(OP([O-])([O-])=O)=C2)C@HC@@H[C@@H]1O");
SMIRKSReaction sr = em.smrkMan.parse("[#8;X1-:3]P;X4:2(=[O;X1:5])[#8;X2:1]-[*,#1:6]>>[H][#8;X2:3]P;X4:2([#8;X2:4][H])[#8;X2:1]-[*,#1:6]");
1) When I transform the molecule without adding explicit hydrogen, AMBIT returns the molecule transformed correctly, and with stereochemistry
IAtomContainerSet transforms = smrkMan.applyTransformationWithSingleCopyForEachPos(mol, null, sr)
returns: "OC[C@H]1OC(OC2=CC(OS([O-])(=O)=O)=C([N-][N+]#N)C(OP(O[H])(O[H])=O)=C2)C@HC@@H[C@@H]1O"
2) When I first add explicit atoms before applying the reaction,
So, it looks like AMBIT has issues conserving stereochemistry when we have explicit hydrogens. I had similar functions with others. Because my SMIRKS strings need to have hydrogens explicitly described in a lot of cases, I need to also make sure that the molecules they are applied to have explicit hydrogens. How can I solve this situation?
Thank you for replying.
Best,
Yannick
Hi Nick,
How are you doing? Have you had time to look at my previous email from June 16th? I provided you with some of the results I found. It seems there are issues when we first add explicit hydrogens before transforming the molecule. Please could anyone help me out here?
Thanks,
Yannick
Hi Yannick,
I am sorry for the delayed answer. Also this ticked was not assigned to me I did not receive e-mails directly from sourcefordge. For future cases you could assign the tickets to someone when submitting them.
I am not sure whether I did the test with the right smirks frome above (since it was not posted as "code" and some parts of it were corrupted, I had to 'restore' some parts in the smirks).
From my preliminary test I got following:
I had some thoughts concerning your case but before commenting,
please send me the exact SMIRKS and target molecule. Paste them as "code" section (see in the bug-tracker editor the tool called "code" designated as
I would like to be sure that we are talking about the same thing
Last edit: Nikolay Kochev 2017-07-20