DrrDom / crem

CReM: chemically reasonable mutations framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Results different between online app and local version

spadavec opened this issue · comments

If I draw the following molecule in your web app:

Screenshot from 2023-01-18 10-39-10

And try to use the "Scaffold" (e.g. grow) functionality at the selected index, I get a number of results (maybe a few hundred/thousand) at radius = 1.

However, if I iterate over the atoms in the molecule in a local version, crem reports it cant generate any results at the same position:

smiles = 'c1cc(OC)ccc1C'
base_mol = Chem.MolFromSmiles(smiles)
atoms = len(list(base_mol.GetAtoms()))

for atom in range(0, atoms):
    gen_results = list(grow_mol(base_mol, return_mol=True, max_replacements=20000,
                                db_name='replacements02_sc2.5.db', radius=1, replace_ids=[atom], max_atoms=15, ncores=4))
    num_results = len(gen_results)
    print(atom, num_results)

The output of this is

[10:36:04] WARNING: not removing hydrogen atom with dummy atom neighbors
0 19999
[10:36:06] WARNING: not removing hydrogen atom with dummy atom neighbors
1 20000
2 0
3 0
[10:36:10] WARNING: not removing hydrogen atom with dummy atom neighbors
4 19999
5 0
6 0
7 0
[10:36:15] WARNING: not removing hydrogen atom with dummy atom neighbors
8 19995
[10:36:18] WARNING: not removing hydrogen atom with dummy atom neighbors
9 19999
[10:36:21] WARNING: not removing hydrogen atom with dummy atom neighbors
10 19998
[10:36:25] WARNING: not removing hydrogen atom with dummy atom neighbors
11 19999
12 0
13 0
14 0
15 0
[10:36:29] WARNING: not removing hydrogen atom with dummy atom neighbors
16 19994
17 0
18 0

And just as a sanity check, this is the numbering of the molecule:
numbered_molecule_docked

I'm not sure why index 1 is able to produce results, but index 5 doesn't (even though it should by symmetry), and the same position (index 5) works in the web app. Do you know why these would produce different results?

I just realized the symmetry_fixes flag which does this exactly. Changing it to True fixes this for me. Apologies.

commented

Exactly)
One note. In the online app I use SA databases, in local version you use SC databases. They are different. But with radius 1 you will always find some replacements.
I do not recommend to use SC databases for real use cases.