On Fri, Jul 23, 2021 at 4:53 AM Paolo Tosco <paolo.tosco.m...@gmail.com>
wrote:

>
> # here there seems to a be a bug with the 2D depiction, but that's another 
> story
>
> template
>
> [image: image.png]
>
>
Just a quick thing: I don't know if this is supposed to be a bug or a
feature, but I noticed that this seems to be caused by properties of the
Mol created from SMARTS *not* being set when the mol is created, but only
when they are requested the first time. Right after creating the mol
object by Chem.MolFromSmiles.... the IsInRing doesn't seem to be set
correctly (or at all), and the comparison operation distorts the molecule.
But, if you force the computation of the properties, e.g. by printing them,

for idx, atom in enumerate(template.GetAtoms()):
    print(f"{idx:>4d}  {atom.GetAtomicNum():5d}  {str(atom.IsInRing()):>7}
{str(atom.GetIsAromatic()):>5}")

After that, all seems to work as expected \o/. I don't know if it is by
design that the properties are calculated only when needed?
Gustavo.
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to