AtomTyping
**********

**AtomTyping** is a simple tool that assigns atom types to molecular
systems. It handles atom typing for the GAFF, UFF, and APPLE&P force
fields. For UFF there is an alternative option for metal organic
frameworks (MOFs), named UFFAutograf. The **AtomTyping** tool is a
wrapper around several other atomtyping tools (e.g. AMBER AnteChamber
for GAFF atomtyping), meant to provide a common interface.


Command Line Tool
=================

This is a simple example showing how to generate force field
parameters for ethanol:

   #!/bin/sh

   $AMSBIN/atomtyping << EOF

      Type GAFF

      System
         Atoms
            C -4.537101 -0.602542 -0.008859
            C -3.601843 -1.804345  0.037274
            O -2.267293 -1.387375 -0.058902
            H -4.301877  0.096761  0.821305
            H -5.588912 -0.942676  0.095614
            H -4.425039 -0.071643 -0.977931
            H -3.829607 -2.474689 -0.818032
            H -3.766077 -2.377916  0.977441
            H -2.012143 -1.043722  0.837186
         End
      End
   EOF

The most important input options are:

* **Type**: The force field type for which atom types and charges
  should be generated. Currently GAFF is the default. Other options
  are UFF, APPLE&P, and UFFAutograf.

* **System**: in the System block we specify the initial structure of
  the molecule for which you want to generate force field information.

The utility writes a new AMS input file for a ForceField engine job
using the new force field parameters. The new input is written to the
log file, and it is also stored in the .rkf file. The user can change
the file as needed, or import it into AMSinput and change settings
from there.

Alternatively, the resulting binary file atomtyping.rkf can be
imported into an AMS forcefield calculation of the same molecular
system, using the "Forcefield%ReuseTypeInfo" keyword.

   ReuseTypeInfo string

"ReuseTypeInfo"
   Type:
      String

   Default value:
   Description:
      Path to RKF file with atom typing information (atom types,
      charges, and - in case of GAFF or APPLE&P - possibly a
      forcefield (patch) file for the system).

Tip:

  GAFF atom typing by Antechamber involves an AM1 geometry
  optimization of all molecules, in order to determine the atomic
  charges. For large systems this can be time-consuming. There is an
  option to only compute AM1 single point atomic charges, using
  "ForceField%AntechamberTask SinglePoint". While faster, this will
  make the resulting force field parameters less reliable.

When using the APPLE&P atomtyper on a system containing multiple
molecules, one can supply molecular charges by creating regions, and
assigning charges to those regions in the "APPLE&P" input block.

   Type APPLE&P

   APPLE&P
       MolecularCharge
           Region hydronium
           Charge 1.0
       End
       MolecularCharge
           Region hydroxide
           Charge -1.0
       End
   End

   System
       Atoms
           O -3.086928983135022 -0.6153850801734012 -0.02057283482916511 region=hydronium
           H -3.035964894767782 -0.1945162985697987 -0.9154855284954144 region=hydronium
           H -3.064197092634759 -1.588076185446669 -0.2023222969804351 region=hydronium
           H -2.209871693333089 -0.4204682540635012 0.3947967747925069 region=hydronium
           O -0.6625869363739662 -0.05667407009445274 2.882827791245922 region=hydroxide
           H -0.7476062985629394 0.8260881574172965 2.441501828780626 region=hydroxide
       End
       BondOrders
            1 2 1.0
            1 3 1.0
            1 4 1.0
            5 6 1.0
       End
   End


Python scripting
================

It is also possible to run atomtyping via Python scripting.

   from scm.plams import Settings, Molecule
   from scm.atomtyping import AtomTypingJob, AtomTypingResults

   # Run the atomtyping job
   mol = Molecule("mol.in")
   settings = Settings()
   job = AtomTypingJob(molecule=mol,settings=settings)
   results = job.run()

   # Create the forcefield job (change the settings if needed)
   newjob = results.get_plamsjob()
   newjob.settings.input.ams.Task = "GeometryOptimization"

   # Get the typed Molecule
   typed_mol = newjob.molecule[""]
