Re: [Rdkit-discuss] Adding molecules to pandas dataframe

2019-07-26 Thread Gianluca Sforna
Thank you (both you and Christos), it works beautifully. Can you tell I'm learning the ropes of all this stuff right now? Regards Gianluca On Thu, Jul 25, 2019 at 5:01 PM Greg Landrum wrote: > > Hi Gianluca, > > This one turns out to be pretty easy: you just add the molecules as a column > and

Re: [Rdkit-discuss] Adding molecules to pandas dataframe

2019-07-25 Thread Greg Landrum
Hi Gianluca, This one turns out to be pretty easy: you just add the molecules as a column and then call: PandasTools.RenderImagesInAllDataFrames(images=True) Or, if you just want to change the rendering for a single DataFrame, you can call: PandasTools.ChangeMoleculeRendering(df) Here's a gist de

Re: [Rdkit-discuss] Adding molecules to pandas dataframe

2019-07-25 Thread Christos Kannas
Hi Gianluca, Yes you can do that. You create a list of molecule objects from the mol2 files and then you assign this list to a new column in your dataframe. I.e. (Pythopsuedocode...) mols = list() for mol2 in mol2_files: mol = Chem.MolFromMol2(mol2) mols.append(mol) df["Molecule"] = mol

[Rdkit-discuss] Adding molecules to pandas dataframe

2019-07-25 Thread Gianluca Sforna
Hi all, is it possible to manually add molecules to a pandas dataframe? I am reading a bunch of mol2 files, adding some properties (including some atom highlighting), then I'd like to add the resulting molecule to the dataframe in order to show its depiction along with the data. However, API docs a