forlilab / Meeko

Interfacing RDKit and AutoDock
GNU Lesser General Public License v2.1
192 stars 48 forks source link

`nan` for charges on input molecule #41

Closed BJWiley233 closed 1 year ago

BJWiley233 commented 1 year ago

For this sdf file generated from smiles I am getting nan for most of the charges but not all of them. Obviously autogrid and thus autodock won't work with this.

mk_prepare_ligand.py -i 1807026463.sdf -o 1807026463.pdbqt

example from pdbqt

REMARK SMILES O=C(CNC[P@TB4](=O)(O)O)NC[C@@H]1CCN(C(=O)c2ccc3[nH]ccc3n2)[C@H]1c1cccnc1
REMARK SMILES IDX 1 1 2 2 10 3 3 5 4 6 5 8 6 9 7 10 8 11 9 13 11 15 12 16
REMARK SMILES IDX 13 17 27 18 14 19 15 20 28 21 29 22 33 23 30 24 32 25 31 26
REMARK SMILES IDX 16 27 17 28 18 29 19 30 26 31 20 32 25 33 21 34 24 35 22 36
REMARK SMILES IDX 23 37
REMARK H PARENT 10 4 4 7 8 12 9 14 22 38
REMARK Flexibility Score: inf
ROOT
ATOM      1  O   UNL     1       2.575   1.154   2.196  1.00  0.00       nan OA
ATOM      2  C   UNL     1       3.632   1.590   1.747  1.00  0.00       nan C
ATOM      3  N   UNL     1       4.596   0.793   1.165  1.00  0.00       nan N
ATOM      4  H   UNL     1       5.384   1.250   0.723  1.00  0.00       nan HD
ENDROOT
BRANCH   2   5
ATOM      5  C   UNL     1       3.976   3.092   1.785  1.00  0.00       nan C
BRANCH   5   6
ATOM      6  N   UNL     1       3.546   3.754   0.536  1.00  0.00       nan NA
ATOM      7  H   UNL     1       2.546   3.568   0.409  1.00  0.00       nan HD
BRANCH   6   8
ATOM      8  C   UNL     1       3.771   5.223   0.624  1.00  0.00       nan C
BRANCH   8   9
ATOM      9  P   UNL     1       3.147   6.038  -0.891  1.00  0.00       nan P
ATOM     10  O   UNL     1       4.266   7.081  -0.831  1.00  0.00       nan OA

sdf

OpenBabel12062207433D

 58 61  0  0  1  0  0  0  0  0999 V2000
    2.5751    1.1544    2.1960 O   0  0  0  0  0  0  0  0  0  0  0  0
    3.6318    1.5902    1.7471 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.9763    3.0916    1.7851 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.5465    3.7542    0.5362 N   0  0  0  0  0  0  0  0  0  0  0  0
    3.7707    5.2230    0.6240 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.1473    6.0381   -0.8912 P   0  0  0  0  0  0  0  0  0  0  0  0
    4.2662    7.0806   -0.8312 O   0  0  0  0  0  0  0  0  0  0  0  0
    3.6874    4.8215   -1.8525 O   0  0  0  0  0  0  0  0  0  0  0  0
    2.5581    6.8087   -2.3237 O   0  0  0  0  0  0  0  0  0  0  0  0
    4.5958    0.7933    1.1653 N   0  0  0  0  0  0  0  0  0  0  0  0
    4.4941   -0.6608    1.0781 C   0  0  0  0  0  0  0  0  0  0  0  0
    5.0611   -1.3693    2.3230 C   0  0  2  0  0  0  0  0  0  0  0  0
    6.5407   -1.0345    2.5503 C   0  0  0  0  0  0  0  0  0  0  0  0
    7.2719   -2.0827    1.7396 C   0  0  0  0  0  0  0  0  0  0  0  0
    6.4714   -3.2785    1.9294 N   0  0  0  0  0  0  0  0  0  0  0  0
    6.9033   -4.5926    1.7216 C   0  0  0  0  0  0  0  0  0  0  0  0
    6.1854   -5.5705    1.9295 O   0  0  0  0  0  0  0  0  0  0  0  0
    8.3140   -4.8378    1.2571 C   0  0  0  0  0  0  0  0  0  0  0  0
    8.9925   -5.9648    1.7139 C   0  0  0  0  0  0  0  0  0  0  0  0
   10.3084   -6.1863    1.3071 C   0  0  0  0  0  0  0  0  0  0  0  0
   10.8431   -5.2252    0.4401 C   0  0  0  0  0  0  0  0  0  0  0  0
   12.0762   -5.1030   -0.1450 N   0  0  0  0  0  0  0  0  0  0  0  0
   12.1307   -3.9764   -0.9203 C   0  0  0  0  0  0  0  0  0  0  0  0
   10.8981   -3.3557   -0.8405 C   0  0  0  0  0  0  0  0  0  0  0  0
   10.0932   -4.1371    0.0117 C   0  0  0  0  0  0  0  0  0  0  0  0
    8.8170   -3.9212    0.3969 N   0  0  0  0  0  0  0  0  0  0  0  0
    5.0632   -2.9259    2.1736 C   0  0  1  0  0  0  0  0  0  0  0  0
    4.4391   -3.5962    3.3766 C   0  0  0  0  0  0  0  0  0  0  0  0
    5.1487   -3.9177    4.5376 C   0  0  0  0  0  0  0  0  0  0  0  0
    4.5011   -4.5534    5.5938 C   0  0  0  0  0  0  0  0  0  0  0  0
    3.1506   -4.8304    5.4666 C   0  0  0  0  0  0  0  0  0  0  0  0
    2.4213   -4.5197    4.3757 N   0  0  0  0  0  0  0  0  0  0  0  0
    3.0825   -3.9207    3.3580 C   0  0  0  0  0  0  0  0  0  0  0  0
    5.0573    3.2046    1.9266 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.4735    3.5243    2.6581 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.5465    3.5676    0.4094 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.8497    5.3894    0.7251 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.2608    5.6595    1.4890 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.4609    4.3583   -1.4764 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.2911    7.4042   -2.5826 H   0  0  0  0  0  0  0  0  0  0  0  0
    5.3838    1.2495    0.7228 H   0  0  0  0  0  0  0  0  0  0  0  0
    5.0336   -0.9584    0.1730 H   0  0  0  0  0  0  0  0  0  0  0  0
    3.4406   -0.9323    0.9455 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.4784   -1.0402    3.1932 H   0  0  0  0  0  0  0  0  0  0  0  0
    6.7854   -1.1633    3.6114 H   0  0  0  0  0  0  0  0  0  0  0  0
    6.8312   -0.0190    2.2640 H   0  0  0  0  0  0  0  0  0  0  0  0
    8.3026   -2.2082    2.0801 H   0  0  0  0  0  0  0  0  0  0  0  0
    7.2580   -1.8355    0.6723 H   0  0  0  0  0  0  0  0  0  0  0  0
    8.5057   -6.6693    2.3902 H   0  0  0  0  0  0  0  0  0  0  0  0
   10.8784   -7.0479    1.6417 H   0  0  0  0  0  0  0  0  0  0  0  0
   12.8494   -5.7551   -0.0190 H   0  0  0  0  0  0  0  0  0  0  0  0
   13.0246   -3.7064   -1.4653 H   0  0  0  0  0  0  0  0  0  0  0  0
   10.6041   -2.4430   -1.3353 H   0  0  0  0  0  0  0  0  0  0  0  0
    4.5151   -3.2370    1.2749 H   0  0  0  0  0  0  0  0  0  0  0  0
    6.2113   -3.7067    4.6121 H   0  0  0  0  0  0  0  0  0  0  0  0
    5.0405   -4.8363    6.4900 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.6036   -5.3278    6.2620 H   0  0  0  0  0  0  0  0  0  0  0  0
    2.4629   -3.7077    2.4902 H   0  0  0  0  0  0  0  0  0  0  0  0
  1  2  2  0  0  0  0
  2  3  1  0  0  0  0
  2 10  1  0  0  0  0
  3  4  1  0  0  0  0
  3 34  1  0  0  0  0
  3 35  1  0  0  0  0
  4  5  1  0  0  0  0
  4 36  1  0  0  0  0
  5  6  1  0  0  0  0
  5 37  1  0  0  0  0
  5 38  1  0  0  0  0
  6  7  2  0  0  0  0
  6  8  1  0  0  0  0
  6  9  1  0  0  0  0
  8 39  1  0  0  0  0
  9 40  1  0  0  0  0
 10 11  1  0  0  0  0
 10 41  1  0  0  0  0
 11 12  1  0  0  0  0
 11 42  1  0  0  0  0
 11 43  1  0  0  0  0
 12 13  1  0  0  0  0
 12 27  1  0  0  0  0
 12 44  1  1  0  0  0
 13 14  1  0  0  0  0
 13 45  1  0  0  0  0
 13 46  1  0  0  0  0
 14 15  1  0  0  0  0
 14 47  1  0  0  0  0
 14 48  1  0  0  0  0
 15 16  1  0  0  0  0
 15 27  1  0  0  0  0
 16 17  2  0  0  0  0
 16 18  1  0  0  0  0
 18 19  1  0  0  0  0
 18 26  2  0  0  0  0
 19 20  2  0  0  0  0
 19 49  1  0  0  0  0
 20 21  1  0  0  0  0
 20 50  1  0  0  0  0
 21 22  1  0  0  0  0
 21 25  2  0  0  0  0
 22 23  1  0  0  0  0
 22 51  1  0  0  0  0
 23 24  2  0  0  0  0
 23 52  1  0  0  0  0
 24 25  1  0  0  0  0
 24 53  1  0  0  0  0
 25 26  1  0  0  0  0
 27 28  1  0  0  0  0
 27 54  1  6  0  0  0
 28 29  1  0  0  0  0
 28 33  2  0  0  0  0
 29 30  2  0  0  0  0
 29 55  1  0  0  0  0
 30 31  1  0  0  0  0
 30 56  1  0  0  0  0
 31 32  2  0  0  0  0
 31 57  1  0  0  0  0
 32 33  1  0  0  0  0
 33 58  1  0  0  0  0
M  END
$$$$
diogomart commented 1 year ago

Works on my end, see PDBQT attached. What OS, and versions of Python, Meeko, and RDKit are you using? meeko-issue-41.pdbqt.txt

BJWiley233 commented 1 year ago

Let me get that info for you.

ubuntu 20.04 Python 3.7.9 Meeko 0.4.0 rdkit 2022.09.1

BJWiley233 commented 1 year ago

Worked on my Mac as well with:

Python 3.9.13 Meeko 0.3.3 rdkit 2022.03.5

diogomart commented 1 year ago

The nans and infs are coming from rdkit 2022.09, but not from 2022.03, although I don't think it has to do with the rdPartialCharges module, but with the way the phosphate is perceived by rdkit (the phosphate in your molecule has a weird geometry). Here are the smiles produced by rdkit's Chem.MolToSmiles(mol) for the phosphorous atom: