Dear Greg,
I was wondering if you could give a hint as to how accomplish the
following: I am trying to remove all the disconnected fragments from a
molecule smaller than a certain threshold number of atoms. The following
piece of code does not seem to work:
std::vector<ROMOL_SPTR> frag;
frag = MolOps::getMolFrags(*mol1);
for (unsigned i=0;i< frag.size();i++)
if (frag[i]->getNumAtoms()<MIN_A_COUNT)
for(RWMol::AtomIterator atomIt=frag[i]->beginAtoms();atomIt!
=frag[i]->endAtoms();atomIt++)
{
RWMol *mol2=(static_cast<RWMol *>(frag[i]));
mol2->removeAtom(atomIt);
}
Any recommendations would be welcome!
Igor
P.S. Merry holidays :)
On Sat, 2008-12-06 at 08:00 +0100, Greg Landrum wrote:
> Dear all,
>
> When I made the changes to the handling of stereochemistry in the Q3
> 2008 release of the RDKit, I attempted to get the canonicalization of
> ring stereochemistry specifications (i.e. things like the molecule
> encoded by the SMILES "c...@h]1cc[c@@H](C)CC1") right. I knew that it
> was unlikely that I had actually done so, so I added a warning to the
> code that you probably have seen:
> Warning: ring stereochemistry detected. This may not be handled correctly.
> Based on the tests I did before the release, I believed that the
> current status of the code was correct a large enough fraction of the
> time that this warning was sufficient.
>
> After some large-scale testing done by a colleague, it turns out that
> this assumption was very bad: the handling of ring stereochemistry was
> incorrect much, much too frequently. To be explicit: the SMILES that
> were being generated for molecules that fell into this class did not
> have the correct stereochemistry; i.e. the molecules were wrong. This
> is far from acceptable: it's ok to generate output that's
> non-canonical, but not output that's incorrect.
>
> Here's what I have done in order to address this:
> - The stereochemistry specifications on ring atoms are no longer
> canonicalized.
> - The warning about ring stereochemistry has been moved into the
> SMILES writer and now indicates clearly that the output is not
> canonical
> - Detection of cases that can have ring stereochemistry has been
> improved; spiro centers, symmetrically substituted centers, and
> bridged systems no longer trigger the warning.
>
> These changes are all in svn; I encourage you to update if you are
> building from source. I plan to do the Q4 release sometime in the next
> couple of weeks; the changes will also be in that release.
>
> Once I've assembled a sufficiently large set of test molecules I will
> revisit the canonicalization of these systems sometime next year and
> try again to get this right.
>
> This is definitely the fun part of an open-source project: everyone
> sees when you screw up. :-S
>
> -greg
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you. Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Rdkit-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
--
Igor Filippov [Contr] <[email protected]>