Re: [Rdkit-discuss] calculating molecular properties on a Pandas dataframe Molecule

2019-10-31 Thread Markus Heller
Hi Mike, As a general comment, "This doesn't work" is not very helpful, because if it did, you wouldn't be asking :) Including error messages etc. would be very helpful and would also (most likely) get you an answer much faster ... Markus From: Mike Mazanetz Sent: Thursday, October 31, 2019

[Rdkit-discuss] How to plot similarity maps side by side

2019-10-31 Thread Markus Heller
Hello, As per subject: how can I plot similarity maps side by side, and not below each other? I tried matplotlib's add_subplot approach and failed, since SimilarityMaps.GetSimilarityMapForFingerprint returns a figure object, not an axes object. I realize that this is more of a Python

Re: [Rdkit-discuss] failed mols in converting SMILES to Pandas dataframe Molecule

2019-10-31 Thread Markus Heller
This line of code works for me on a data frame with over 6M compounds … PandasTools.AddMoleculeColumnToFrame(df, 'smiles', 'mol', includeFingerprints=True) ‘smiles’ is the name of the column containing the SMILES, ‘mol’ is the name of the new column with the mol objects. Once that’s done, you

[Rdkit-discuss] SMARTS Query Normalization?

2019-10-31 Thread Webster Homer
I am working on evaluating the RD Kit Postgresql data cartridge for use as the back end of a Web Application. The app will use a JavaScript sketcher to allow the user to input a SMILES of SMARTS that will be sent to the RD Kit cartridge. In evaluating RD Kit I found that it doesn't support

Re: [Rdkit-discuss] failed mols in converting SMILES to Pandas dataframe Molecule

2019-10-31 Thread Mike Mazanetz
Hi Fio, Thanks for the tips. I’ve found that I need PandasTools to convert a smiles to a mol though, I’ve not had MolFromSmiles work on a dataframe. Have you found that this works? Cheers, mike From: Fiorella Ruggiu Sent: 31 October 2019 15:48 To: Mike Mazanetz Cc: Jan Halborg

Re: [Rdkit-discuss] failed mols in converting SMILES to Pandas dataframe Molecule

2019-10-31 Thread Fiorella Ruggiu
Hello Mike, you could create a function with your if else structure and use apply on the pandas dataframe. For example, if you have a SMILES column in your df: def addMol(smiles): if Chem.MolFromSmiles(smiles) is None: Etc return None # or whatever you

[Rdkit-discuss] failed mols in converting SMILES to Pandas dataframe Molecule

2019-10-31 Thread Mike Mazanetz
Dear RDKit’ers I’ve been trying to skip failed molecules in PandasTools.AddMoleculeColumnToFrame. This is possible if I chuck each row to a different processor, but what I really want to do is return a missing row entry. Normally I’d go: If mol is None: Etc Else:

Re: [Rdkit-discuss] calculating molecular properties on a Pandas dataframe Molecule

2019-10-31 Thread Mike Mazanetz
Hi Taka and Jan, Thanks for your help. Worked out that I shouldn’t have added the names=[] when I read in my csv file (woops). It fails if you have a mol which is None, I’ll have to add a line asking it to check that ROMol isn’t None first. Annoying. Thanks for your help, mike

Re: [Rdkit-discuss] calculating molecular properties on a Pandas dataframe Molecule

2019-10-31 Thread Taka Seri
Hi, Pandas apply function will work too. AddMoleculeColumnToFrame(DF, "Smiles") at first. Default setting, rdkit mol object will be added "ROMol" column in your dataframe. https://www.rdkit.org/docs/source/rdkit.Chem.PandasTools.html Then call apply function to apply a calculation function

Re: [Rdkit-discuss] calculating molecular properties on a Pandas dataframe Molecule

2019-10-31 Thread Jan Halborg Jensen
Hi Mike This should work DF[‘HAC’] = [Chem.Lipinski.HeavyAtomCount(mol) for mol in DF[‘Molecule’]] Best regards, Jan On 31 Oct 2019, at 10.16, Mike Mazanetz mailto:mi...@novadatasolutions.co.uk>> wrote: Hi RDKit Gurus, I’ve followed the docs and created a molecule column in my Pandas

[Rdkit-discuss] calculating molecular properties on a Pandas dataframe Molecule

2019-10-31 Thread Mike Mazanetz
Hi RDKit Gurus, I've followed the docs and created a molecule column in my Pandas dataframe. However, I do not seem to be able to do molecular operations on the column. For example, if you had a SMILES column, how would you calculate heavy atom count and append this result to a new