Re: [Rdkit-discuss] fragments aromaticity
On Wed, Oct 21, 2009 at 12:08 PM, Evgueni Kolossov ekolos...@gmail.com wrote: Sorry Greg, Actually I found the problem - in this case to pass structure into the viewer I been using MolToMolBlock(*mol, true, -1, false) instead of SDWriter function write(*mol) and this is what making the difference - write(*mol) doing it OK but MolToMolBlock producing an effect I described to you. I have moved into write(*mol) now and everything is OK. I can only suggest you take a look at MolToMolBlock function. MolToMolBlock is fine, in fact it's what the SDWriter is using (look at line 75 of SDWriter.cpp). The problem that you are having is maybe the last argument you provide to MolToMolBlock, which tells it that the molecule should *not* be kekulized on output. The default value for this (which is what the SDWriter uses) is true. None of this explains why you are getting double bonds in the output. Are you *sure* that there are double bonds? The bond type flag in the output mol blocks is really equal to 2? Could it be that your viewer is seeing aromatic bonds in the output (bond type 4) and drawing them as double bonds? -greg -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] fragments aromaticity
just to close this thread off -- Forwarded message -- From: Evgueni Kolossov ekolos...@gmail.com Date: Wed, Oct 21, 2009 at 12:26 PM Subject: Re: [Rdkit-discuss] fragments aromaticity To: Greg Landrum greg.land...@gmail.com Greg, I think I just described it wrong - it was VISUALIZED as double bonds... Because everything is Ok now I think that the problem was in the way I been passing it to the viewer as string - in case of using MolToMolBlock the argument was wrong and it was unkekulized and in this way passed to the viewer which was displaying it as a double bonds. Regards, Evgueni -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] fragments aromaticity
Evgueni, On Tue, Oct 20, 2009 at 7:56 PM, Evgueni Kolossov ekolos...@gmail.com wrote: Just try to copy any aromatic ring the way I described it and at the end do: fragMol-updatePropertyCache(); MolOps::sanitizeMol(fragMol); I believe aromaticity suppose to be set in sanitize and I do not need to call MolOps::setAromaticity Here's a test case I just did that copies one molecule atom-for-atom and bond-for-bond into another: std::string smi=c1c1; RWMol *m = SmilesToMol(smi,0,false); RWMol m2; for(unsigned int i=0;i6;++i){ m2.addAtom(m-getAtomWithIdx(i)-copy(),false,true); } for(unsigned int i=0;i6;++i){ Bond *newBond=m-getBondWithIdx(i)-copy(); newBond-setOwningMol(m2); newBond-setBeginAtomIdx(m-getBondWithIdx(i)-getBeginAtomIdx()); newBond-setEndAtomIdx(m-getBondWithIdx(i)-getEndAtomIdx()); m2.addBond(newBond,true); } m2.updatePropertyCache(); MolOps::sanitizeMol(m2); for(unsigned int i=0;i6;++i){ TEST_ASSERT(m2.getAtomWithIdx(i)-getIsAromatic()); TEST_ASSERT(m2.getBondWithIdx(i)-getIsAromatic()); TEST_ASSERT(m2.getBondWithIdx(i)-getBondType()==Bond::AROMATIC); } delete m; This runs without problems and does more or less what you seem to be doing. In order to be able to figure out what the problem is with your approach (or if it's caused by a bug in the RDKit), I need code that I can compile and run that shows the problem. Send that along and I'll take a look at it. -greg -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] fragments aromaticity
Hi Greg, I got a small problem with the fragments - aromatic cycles coming with all bonds as double. If I save it into SDF and open SDF than it all Ok. I believe I saw somewhere fix for this. Can you please point me to the right place? Regards, Evgueni -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] fragments aromaticity
Yes, it is reproducible every time... Actually code is quite simple: iterate through the rings, bonds, atoms for each bond and add atoms and bonds to a new mol like: Atom *begAtom = mol.getAtomWithIds(begIdx)-copy(); newBegIdx = fragMol-AddAtom(begAtom, false, true); the same for an endAtom etc... Bond *pNewBond = pBond-copy(); pNewBond-setOwningMol(fragMol); pNewBond -setBeginAtomIdx(newBegIdx); pNewBond -setEndAtomIdx(newEndIdx); int nNewBondIdx = fragMol-addBond(pNewBond, true); Regards, Evgueni 2009/10/19 Greg Landrum greg.land...@gmail.com On Mon, Oct 19, 2009 at 12:06 PM, Evgueni Kolossov ekolos...@gmail.com wrote: I got a small problem with the fragments - aromatic cycles coming with all bonds as double. If I save it into SDF and open SDF than it all Ok. I believe I saw somewhere fix for this. Can you please point me to the right place? hmm, that's weird; it's not really sounding familiar. Do you have a reproducible example of it happening? -greg -- Dr. Evgueni Kolossov (PhD) ekolos...@gmail.com Tel. +44(0)1628 627168 Mob. +44(0)7812070446 -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss