Re: [Rdkit-discuss] fragments aromaticity
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Greg L. <gre...@gm...> - 2009-10-21 04:18:17
|
Evgueni,
On Tue, Oct 20, 2009 at 7:56 PM, Evgueni Kolossov <eko...@gm...> 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="c1ccccc1";
RWMol *m = SmilesToMol(smi,0,false);
RWMol m2;
for(unsigned int i=0;i<6;++i){
m2.addAtom(m->getAtomWithIdx(i)->copy(),false,true);
}
for(unsigned int i=0;i<6;++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;i<6;++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
|