Dear Isidro,
I can’t test at the moment, but as I understand it so far I would guess the 
reason for the behaviour is two-fold. First, the substructure search in the 
pandas data frame just checks wether the substructure is present by calling the 
HasSubstructMatch method from the molecule object. Calling GetSubstructMatch in 
the notebook instead also set the atoms indices of the substructure in the 
molecule object. Second, unlike the renderer in the notebook itself, the 
molecule renderer in the data frame is currently not set up to consider 
substructure indices that might be present in the molecule object. 
The latter is probably not difficult to enable, but I am not sure if allowing a 
data frame substructure filter to change the molecules properties in the 
dataframe would not lead to  some unexpected behaviours.

I opened an issue and will have a look wether the atom highlighting could be 
added to the data frame rendering.

Best,
Niko


On 26 Oct 2014, at 21:33, Isidro Cortés <isidrolausc...@gmail.com> wrote:

> Dear All,
> 
> I am facing a weird problem.
> 
> If I do (where mols is a list of molecules):
> 
> ######
> bb=a.mols[0]
> core = Chem.MolFromSmarts('cc(c)c(=O)c(c)c')
> match=bb.GetSubstructMatch(core)
> bb
> ######
> it works, and I see in my notebook the molecule with the matching atoms 
> highlighted.
> 
> 
> 
> However, if I do the same in a loop inside a method of a class, and send the 
> output to a pandas dataframe, the match is not highlighted when visualizing 
> the dataframe. 
> 
> Even more weird, if a store the molecule (after having applied 
> GetSubstructMatch on it) in a class field (e.g. self.test), and then I do 
> myClass.test, the match appears on the screen..
> 
> I am using the latest version of Rdkit and ipython notebook.
> 
> Any help would be truly appreciated.
> 
> Best wishes,
> Isidro
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to