Re: [Rdkit-discuss] Molecules not rendere in Dataframe

2019-11-06 Thread Greg Landrum
Yes, I can confirm that this is a problem caused by changes in Pandas
v0.25.x

Now we just need to figure out what those changes are and how to work
around them.

Here's a github issue to track the problem:
https://github.com/rdkit/rdkit/issues/2673

-greg


On Tue, Nov 5, 2019 at 12:21 PM Jan Halborg Jensen 
wrote:

> Hi again,
>
> Since I thought it might be a Colab problem I also posted the question on
> Stackoverflow, and got an answer from Oliver Scott
>
> https://stackoverflow.com/questions/58656572/problem-using-addmoleculecolumntoframe-on-google-colab/58690736#58690736
>
> "Seems like this is a problem with all pandas versions above 0.25.0, So I
> guess for now the easiest fix is to downgrade pandas. Or you can use this
> method which seemed to work for me:
>
> from IPython.display import HTML
> HTML(df.to_html())
>
> I haven’t managed to downgrade pandas on Colab (almost certainly a Colab
> issue) but the other workaround works fine.
>
> Best regards, Jan
>
> On 4 Nov 2019, at 19.47, Markus Heller  wrote:
>
> Hi,
>
> In a Jupyter notebook, the following code does not show renderings of the
> molecules in a Pandas dataframe:
>
> 
> from rdkit import Chem
> from rdkit.Chem import PandasTools
> from rdkit.Chem.Draw import MolsToGridImage
> from rdkit.Chem.Draw import IPythonConsole
> from rdkit.Chem import rdDepictor
>
> rdDepictor.SetPreferCoordGen(True)
> IPythonConsole.ipython_useSVG = True
>
> test_df = pd.read_csv(‘test.smi’, delim_whitespace=True, header=None,
> names=[‘smiles’, ‘id’])
>
> PandasTools.RenderImagesInAllDataFrames(images=True)
>
> PandasTools.AddMoleculeColumnToFrame(test_df, ‘smiles’, ‘mol’,
> includeFingerprints=False)
>
> test_df
> 
>
> Instead, string representations are shown (I think), i.e. every field in
> the mol column starts with
>
> 
> As far as I understand the documentation,
> PandasTools.RenderImagesInAllDataFrames(images=True) should show the
> rendered molecules.  What am I doing wrong?
>
> I’m using RDkit version 2019.03.4.0 via Anaconda.
>
> Thanks
> Markus
>
> --
> *Markus Heller, PhD*
> Senior Scientist
> Direct: 604.827.1122   Main: 604.827.1147
>
>  
> 2405 Wesbrook Mall, 4th Floor, Vancouver, BC V6T 1Z3
>
> This email and any attachments thereto may contain confidential material
> for the sole use of the intended recipient. Anyreview, copying, or
> distribution of this email (or any attachments thereto) by others is
> strictly prohibited. If you are not theintended recipient, please contact
> the sender immediately and permanently delete the original and any copies
> of this emailand any attachments thereto.
>
> ___
> 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
>
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] Molecules not rendere in Dataframe

2019-11-05 Thread Jan Halborg Jensen
Hi again,

Since I thought it might be a Colab problem I also posted the question on 
Stackoverflow, and got an answer from Oliver Scott
https://stackoverflow.com/questions/58656572/problem-using-addmoleculecolumntoframe-on-google-colab/58690736#58690736

"Seems like this is a problem with all pandas versions above 0.25.0, So I guess 
for now the easiest fix is to downgrade pandas. Or you can use this method 
which seemed to work for me:


from IPython.display import HTML
HTML(df.to_html())

I haven’t managed to downgrade pandas on Colab (almost certainly a Colab issue) 
but the other workaround works fine.

Best regards, Jan

On 4 Nov 2019, at 19.47, Markus Heller 
mailto:mhel...@admarebio.com>> wrote:

Hi,

In a Jupyter notebook, the following code does not show renderings of the 
molecules in a Pandas dataframe:


from rdkit import Chem
from rdkit.Chem import PandasTools
from rdkit.Chem.Draw import MolsToGridImage
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import rdDepictor

rdDepictor.SetPreferCoordGen(True)
IPythonConsole.ipython_useSVG = True

test_df = pd.read_csv(‘test.smi’, delim_whitespace=True, header=None, 
names=[‘smiles’, ‘id’])

PandasTools.RenderImagesInAllDataFrames(images=True)

PandasTools.AddMoleculeColumnToFrame(test_df, ‘smiles’, ‘mol’, 
includeFingerprints=False)

test_df


Instead, string representations are shown (I think), i.e. every field in the 
mol column starts with


2405 Wesbrook Mall, 4th Floor, Vancouver, BC V6T 1Z3

This email and any attachments thereto may contain confidential material for 
the sole use of the intended recipient. Anyreview, copying, or distribution of 
this email (or any attachments thereto) by others is strictly prohibited. If 
you are not theintended recipient, please contact the sender immediately and 
permanently delete the original and any copies of this emailand any attachments 
thereto.

___
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


Re: [Rdkit-discuss] Molecules not rendere in Dataframe

2019-11-04 Thread Jan Halborg Jensen
I posted basically the same question on Friday. I thought it was a Google Colab 
problem, but apparently it is a more general problem.

On 4 Nov 2019, at 19.47, Markus Heller 
mailto:mhel...@admarebio.com>> wrote:

Hi,

In a Jupyter notebook, the following code does not show renderings of the 
molecules in a Pandas dataframe:


from rdkit import Chem
from rdkit.Chem import PandasTools
from rdkit.Chem.Draw import MolsToGridImage
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import rdDepictor

rdDepictor.SetPreferCoordGen(True)
IPythonConsole.ipython_useSVG = True

test_df = pd.read_csv(‘test.smi’, delim_whitespace=True, header=None, 
names=[‘smiles’, ‘id’])

PandasTools.RenderImagesInAllDataFrames(images=True)

PandasTools.AddMoleculeColumnToFrame(test_df, ‘smiles’, ‘mol’, 
includeFingerprints=False)

test_df


Instead, string representations are shown (I think), i.e. every field in the 
mol column starts with


2405 Wesbrook Mall, 4th Floor, Vancouver, BC V6T 1Z3

This email and any attachments thereto may contain confidential material for 
the sole use of the intended recipient. Any review,copying, or distribution of 
this email (or any attachments thereto) by others is strictly prohibited. If 
you are not the intendedrecipient, please contact the sender immediately and 
permanently delete the original and any copies of this email and anyattachments 
thereto.

___
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


Re: [Rdkit-discuss] Molecules not rendere in Dataframe

2019-11-04 Thread Jennifer Wei via Rdkit-discuss
Jan, I think this is the same issue you ran into in your example colab?

On Mon, Nov 4, 2019 at 2:03 PM Markus Heller  wrote:

> Hi,
>
>
>
> In a Jupyter notebook, the following code does not show renderings of the
> molecules in a Pandas dataframe:
>
>
>
> 
>
> from rdkit import Chem
>
> from rdkit.Chem import PandasTools
>
> from rdkit.Chem.Draw import MolsToGridImage
>
> from rdkit.Chem.Draw import IPythonConsole
>
> from rdkit.Chem import rdDepictor
>
>
>
> rdDepictor.SetPreferCoordGen(True)
>
> IPythonConsole.ipython_useSVG = True
>
>
>
> test_df = pd.read_csv(‘test.smi’, delim_whitespace=True, header=None,
> names=[‘smiles’, ‘id’])
>
>
>
> PandasTools.RenderImagesInAllDataFrames(images=True)
>
>
>
> PandasTools.AddMoleculeColumnToFrame(test_df, ‘smiles’, ‘mol’,
> includeFingerprints=False)
>
>
>
> test_df
>
> 
>
>
>
> Instead, string representations are shown (I think), i.e. every field in
> the mol column starts with
>
>
>
> 
>
>
> As far as I understand the documentation,
> PandasTools.RenderImagesInAllDataFrames(images=True) should show the
> rendered molecules.  What am I doing wrong?
>
>
>
> I’m using RDkit version 2019.03.4.0 via Anaconda.
>
>
>
> Thanks
>
> Markus
>
>
>
> --
>
> *Markus Heller, PhD*
>
> Senior Scientist
>
> Direct: 604.827.1122 <(604)%20827-1122>   Main: 604.827.1147
> <(604)%20827-1147>
>
>
>
>  [image: A027228F]
>
> 2405 Wesbrook Mall, 4th Floor, Vancouver, BC V6T 1Z3
>
>
>
> This email and any attachments thereto may contain confidential material
> for the sole use of the intended recipient. Any review, copying, or
> distribution of this email (or any attachments thereto) by others is strictly
> prohibited. If you are not the intended recipient, please contact the
> sender immediately and permanently delete the original and any copies of
> this email and any attachments thereto.
>
>
> ___
> 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


[Rdkit-discuss] Molecules not rendere in Dataframe

2019-11-04 Thread Markus Heller
Hi,

In a Jupyter notebook, the following code does not show renderings of the 
molecules in a Pandas dataframe:


from rdkit import Chem
from rdkit.Chem import PandasTools
from rdkit.Chem.Draw import MolsToGridImage
from rdkit.Chem.Draw import IPythonConsole
from rdkit.Chem import rdDepictor

rdDepictor.SetPreferCoordGen(True)
IPythonConsole.ipython_useSVG = True

test_df = pd.read_csv('test.smi', delim_whitespace=True, header=None, 
names=['smiles', 'id'])

PandasTools.RenderImagesInAllDataFrames(images=True)

PandasTools.AddMoleculeColumnToFrame(test_df, 'smiles', 'mol', 
includeFingerprints=False)

test_df


Instead, string representations are shown (I think), i.e. every field in the 
mol column starts with

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