Created
February 3, 2020 19:44
-
-
Save cstein/afe23ceef85aa97b8bbb15a1b5398789 to your computer and use it in GitHub Desktop.
RDKit Plotting Code for two different sets of csv data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title | docking score | SMILES | |
---|---|---|---|
S01 | -9.61916 | CC1=CC=C(C(=O)N2CN(C([NH3+])=O)N(C(=O)[O-])C2=O)C=C1 | |
S02 | -9.6052 | NC1CN(C([NH3+])=O)C(=O)N1C(=O)[O-] | |
S03 | -8.84833 | CNC(=O)C1=CN(C(=O)[O-])CN(C([NH3+])=O)C1 | |
S04 | -8.92497 | CC1=CC=CC=C1NN1C(=O)N(C(=O)[O-])C2=C1C=CC=C2F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title | docking score | SMILES | |
---|---|---|---|
S01 | -9.34709 | N=C[N+](=O)C1=CC(C([O-])O[O-])=C(C(N)=O)OC1C(=O)[O-] | |
S02 | -10.7755 | NC1CC[SH]=CC1C(O[NH+]=O)C(=O)O[O-] | |
S03 | -10.0124 | [NH3+]C(=O)CC1=C(N([O-])O[O-])N(C([NH3+])=O)C=N1 | |
S04 | -9.93676 | CN1OC([O-])([O-])OC=C1C1([O-])OC=C(C(=O)F)O1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import rdkit | |
import rdkit.Chem as Chem | |
import rdkit.Chem.AllChem as AllChem | |
import rdkit.Chem.Draw as Draw | |
import pandas as pd | |
f_nofilter = pd.read_csv(sys.argv[1]) | |
f_filter = pd.read_csv(sys.argv[2]) | |
ss = list(f_nofilter['SMILES']) + list(f_filter['SMILES']) | |
mols = [Chem.MolFromSmiles(x) for x in ss] | |
erg = ["{0:.1f}".format(x) for x in f_nofilter['docking score']] + ["{0:.1f}".format(x) for x in f_filter['docking score']] | |
img = Draw.MolsToGridImage(mols, molsPerRow=4, legends=erg) | |
img.save('test.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment