Combinatorial analogs
Here's an example of how to generate combinatorial analogs from the same parent. Make sure to source my environment first:
source /nfs/home/omailhot/pyenv_source.sh
Then, you will want to create a .png file of your parent with standard numbering on it. We'll use etomidate in this example:
from bksltk.analogs import write_numbered_parent_png, make_analogs_combinations
eto_smiles = 'CCOC(=O)C1=CN=CN1[C@H](C)C2=CC=CC=C2' write_numbered_parent_png(eto_smiles, 'test_parent.png')
Look at the .png, and figure out where your modifications lie. Then, you'll create a "modification dictionary" that will be used for combinatorial generation of analogs. In this example, carbon 0 can get a hydroxyl, fluorine or methyl attached, carbons 6 and 14 can get methylated, carbon 15 can get replaced with an aromatic nitrogen or get hydroxylated, and carbon 16 can get hydroxylated. The n_combinations_list specifies how many modifications should be combined in the kept analogs. In this example, analogs that are combining 2, 3 or 4 modifications will be enumerated. The output_filename will generate a both .png and a .csv file with the enumerated analogs.
modifications_dict = {0: ['O', 'F', 'C'], 6: ['C'], 14: ['C'], 15: ['N', 'O'], 16: ['O']} eto_smiles = 'CCOC(=O)C1=CN=CN1[C@H](C)C2=CC=CC=C2' n_combinations_list = [2, 3, 4] output_filename = 'eto_combined_analogs' make_analogs_combinations(modifications_dict, eto_smiles, n_combinations_list, output_filename)