alanwilter / acpype

OFFICIAL: AnteChamber PYthon Parser interfacE
https://alanwilter.github.io/acpype/
GNU General Public License v3.0
201 stars 46 forks source link

Set atom/bond type judge option #26

Open mquevill opened 3 years ago

mquevill commented 3 years ago

There are several options in Antechamber to guess atom and bond types (using the -j flag). Some of these only work with certain charge methods, such as bcc will change prediction types <4 to 4 (but 5 will still work).

I have seen Antechamber "fail" with some charged species because of some of the atom/bond assignments. Since mol2 files contain bond types, these don't necessarily need to be guessed, so the option -j 5 has worked for me in these cases. This will still do partial bond type assignment, but should honor the mol2 bond types for the most part.

Reference for -j:

mquevill commented 3 years ago

Take, for example, the anion TFSI. This is a symmetric molecule with two SO2 groups around the central N atom, but the default typing that ACPYPE determines sets the two S atoms differently (s6-ne-sy) than I would expect (sy-n2-sy).

Input file:

@<TRIPOS>MOLECULE
*****
 15 14 0 0 0
SMALL
GASTEIGER

@<TRIPOS>ATOM
      1 F           3.9349   -0.3814    0.2600 F       1  UNL1       -0.1520
      2 C           2.7407    0.1128   -0.1917 C.3     1  UNL1        0.4919
      3 F           2.0667   -0.9630   -0.6974 F       1  UNL1       -0.1520
      4 F           2.0548    0.4970    0.9253 F       1  UNL1       -0.1520
      5 S           2.9408    1.4710   -1.4149 S.O2    1  UNL1       -0.1455
      6 O           2.2350    0.9995   -2.6104 O.2     1  UNL1       -0.2006
      7 O           2.3356    2.6413   -0.7766 O.2     1  UNL1       -0.2006
      8 N           4.5240    1.4542   -1.4983 N.3     1  UNL1        0.0218
      9 S           5.0963    2.5988   -2.4336 S.O2    1  UNL1       -0.1455
     10 O           4.7286    2.5301   -3.8503 O.2     1  UNL1       -0.2006
     11 O           5.0789    3.9505   -1.8674 O.2     1  UNL1       -0.2006
     12 C           6.8648    2.0940   -2.3876 C.3     1  UNL1        0.4919
     13 F           7.0938    1.0224   -1.5667 F       1  UNL1       -0.1520
     14 F           7.3466    1.7285   -3.6121 F       1  UNL1       -0.1520
     15 F           7.6900    3.0848   -1.9370 F       1  UNL1       -0.1520
@<TRIPOS>BOND
     1     1     2    1
     2     2     3    1
     3     2     4    1
     4     2     5    1
     5     5     6    2
     6     5     7    2
     7     5     8    1
     8     8     9    1
     9     9    10    2
    10     9    11    2
    11     9    12    1
    12    12    13    1
    13    12    14    1
    14    12    15    1

Resulting .itp atom types from running acpype -i tfsi.mol2 -n -1 -o gmx:

[ atoms ]
;   nr  type  resi  res  atom  cgnr     charge      mass       ; qtot   bond_type
     1    f     1   UNL     F    1    -0.271633     19.00000 ; qtot -0.272
     2   c3     1   UNL     C    2     0.554700     12.01000 ; qtot 0.283
     3    f     1   UNL    F1    3    -0.271633     19.00000 ; qtot 0.011
     4    f     1   UNL    F2    4    -0.271633     19.00000 ; qtot -0.260
     5   s6     1   UNL     S    5     1.483700     32.06000 ; qtot 1.224
     6    o     1   UNL     O    6    -0.613200     16.00000 ; qtot 0.610
     7    o     1   UNL    O1    7    -0.656800     16.00000 ; qtot -0.046
     8   ne     1   UNL     N    8    -1.059100     14.01000 ; qtot -1.106
     9   sy     1   UNL    S1    9     1.679398     32.06000 ; qtot 0.574
    10    o     1   UNL    O2   10    -0.656800     16.00000 ; qtot -0.083
    11    o     1   UNL    O3   11    -0.656800     16.00000 ; qtot -0.740
    12   c3     1   UNL    C1   12     0.554700     12.01000 ; qtot -0.185
    13    f     1   UNL    F3   13    -0.271633     19.00000 ; qtot -0.457
    14    f     1   UNL    F4   14    -0.271633     19.00000 ; qtot -0.728
    15    f     1   UNL    F5   15    -0.271633     19.00000 ; qtot -1.000

Resulting types after running with adding -j 5 to https://github.com/alanwilter/acpype/blob/ad9727c53234ae4266e9e453819459e7875a4c7f/acpype_lib/acpype.py#L2132

[ atoms ]
;   nr  type  resi  res  atom  cgnr     charge      mass       ; qtot   bond_type
     1    f     1   UNL     F    1    -0.271633     19.00000 ; qtot -0.272
     2   c3     1   UNL     C    2     0.554700     12.01000 ; qtot 0.283
     3    f     1   UNL    F1    3    -0.271633     19.00000 ; qtot 0.011
     4    f     1   UNL    F2    4    -0.271633     19.00000 ; qtot -0.260
     5   sy     1   UNL     S    5     1.616399     32.06000 ; qtot 1.356
     6    o     1   UNL     O    6    -0.656800     16.00000 ; qtot 0.699
     7    o     1   UNL    O1    7    -0.656800     16.00000 ; qtot 0.043
     8   n2     1   UNL     N    8    -1.085200     14.01000 ; qtot -1.043
     9   sy     1   UNL    S1    9     1.616399     32.06000 ; qtot 0.574
    10    o     1   UNL    O2   10    -0.656800     16.00000 ; qtot -0.083
    11    o     1   UNL    O3   11    -0.656800     16.00000 ; qtot -0.740
    12   c3     1   UNL    C1   12     0.554700     12.01000 ; qtot -0.185
    13    f     1   UNL    F3   13    -0.271633     19.00000 ; qtot -0.457
    14    f     1   UNL    F4   14    -0.271633     19.00000 ; qtot -0.728
    15    f     1   UNL    F5   15    -0.271633     19.00000 ; qtot -1.000