Re: [Rdkit-discuss] Chem.PandasTools

2014-05-09 Thread Paul . Czodrowski
Dear Grégori, when storing the image into a new data frame: MMP_reaction = Chem.rdChemReactions.ReactionFromSmarts([*:1][H][*:1]C) newnew_df = pd.DataFrame(columns=['fig'],index=[1] ) newnew_df['fig'].ix[1] = Draw.ReactionToImage(MMP_reaction) apparently, the image can be stored in a data

Re: [Rdkit-discuss] Chem.PandasTools

2014-05-09 Thread Samo Turk
Hi, You can create new object that stores MMP and has default pandas and ipython representation as base64 encoded png. This usually works for me, but I'm not sure why in this case it works only for ipython representation and not for pandas.. The code: # codecell import pandas as pd import

[Rdkit-discuss] Chem.PandasTools

2014-05-08 Thread Paul . Czodrowski
Dear RDKitters, I started to play around with the great Chem.PandasTool contribution provided by Nicholas and Samo. Given such a data frame: Transformation npairs 1 [*:1][H][*:1]C5 how do I depict the molecular transformation in the dataframe? I guess that I somehow

Re: [Rdkit-discuss] Chem.PandasTools

2014-05-08 Thread Samo Turk
Hi, I'm not sure if it will work but you can try: df['new'] = df['Transformation'].map(showLine_MMP) Regards, Samo On Thu, May 8, 2014 at 4:31 PM, paul.czodrow...@merckgroup.com wrote: Dear RDKitters, I started to play around with the great Chem.PandasTool contribution provided by

Re: [Rdkit-discuss] Chem.PandasTools

2014-05-08 Thread Gerebtzoff, Gregori
Hi Paul, The Draw modules also contains a ReactionToImage function; Your MMP can be read as a reaction. Hope this helps further! Grégori Date: Thu, 8 May 2014 16:31:32 +0200 From: paul.czodrow...@merckgroup.com Subject: [Rdkit-discuss] Chem.PandasTools To: rdkit-discuss@lists.sourceforge.net

Re: [Rdkit-discuss] Chem.PandasTools

2014-05-08 Thread Paul . Czodrowski
Dear Gregori Samo, thanks for your hints. I just tried running Draw.ReactionToImage([*:1][H][*:1]C) = AttributeError: 'str' object has no attribute 'GetNumReactantTemplates' BTW, how would I finally add a picture to a Pandas data frame? Cheers, Paul Hi Paul, The Draw modules

Re: [Rdkit-discuss] Chem.PandasTools

2014-05-08 Thread Gerebtzoff, Gregori
Hi Paul, You first have to read the MMP into a reaction object (Chem.ReactionFromSmarts). Greg On Friday, May 9, 2014, paul.czodrow...@merckgroup.com wrote: Dear Gregori Samo, thanks for your hints. I just tried running Draw.ReactionToImage([*:1][H][*:1]C) = AttributeError: 'str'