-
Notifications
You must be signed in to change notification settings - Fork 2
Introduction to AaronTools: Command Line Scripts
AaronTools provides a collection of Command-line Scripts for automating routine tasks encountered when running quantum chemistry computations.
These scripts can be used on the command-line or incorporated into other workflows.
The grab_coords
script can be used to extract the geometry from Gaussian input files (Cartesian Coordinates only), Gaussian output files, pdb files, and xyz files.
The following will save the geometry from output.log
into the xyz-formatted geometry.xyz
grab_coords output.log -o geometry.xyz
To prevent unintentional overwrite, if a file already exists, the user will be presented an interactive prompt asking permission to overwrite and giving the option of providing a new name.
The use of the -f flag, in addition to the -o option, will force overwrite.
This may be useful for scripting purposes in which the interactive prompt is undesirable.
For example, the following will silently overwrite the geometry.xyz
file we created in the previous example:
grab_coords output2.log -o geometry.xyz -f
Finally, the omission of a save file will simply print the geometry to STDOUT
of the terminal:
grab_coords output.log
Note: Substituent names are case sensitive!
See available substituents here. Substituents can also be build up from others in the library, as detailed on the Creating a New Substituent Type page.
Substitutions are supplied at the command line using key=value pairs. The key is the target atom which will be replaced with our substituent— the value. To list the substituents available to AaronTools, and determine the name to supply as the value, the --available or -a flag is used:
substitute -a 26-F-Ph 35-F-Ph Ad BF2 Br CCH CF3 CH2Cl CH2F CH2OH CHCH2 CHCl2 CHF2 CHO Cl CN COCH3 COOCH3 COOH Cy Et F H I iPr Me Mes NCH3_2 NH2 NHCH3 NHOH NO NO2 O OCF3 OH OMe Ph SCH3 SH SiF3 SiH3 SuperMes tBu triazole_C triazole_N
For the following examples, we will be starting with a methane molecule (saved as 'methane.xyz'), with hydrogens at 1, 3, 4, and 5.
To generate methanol, we'll replace atom 1 with OH and write the new coordinates to 'methanol.xyz':
substitute methane.xyz -s 1=OH -o methanol.xyz
Notice that atom numbers are preserved to as great an extent as possible. That is, the atom(s) being replaced is replaced with the first atom(s) of the substituent, whereas the remainder of the substituent atoms are appended to the end of the coordinates.
To generate t-butanol from our new methanol.xyz,
substitute methanol.xyz -s 3,4,5=Me -o tBuOH.xyz
We can also substitute substituent groups, not just hydrogens, as well as make multiple substitutions at the same time. Simply identify the atom of the old substituent that connects to the rest of the molecule; this is our target.
substitute tBuOH.xyz -s 4=Et 1,3=Cl
Additionally, the --minimize or -m flag will indicate that the new substituent should be rotated to minimize the Lennard-Jones potential— helpful when adding bulky substituents or the target atom is found in a crowded region:
substitute tBuOH.xyz -s 3,5=tBu -m -o alcohol.xyz
No -m flag:
With -m flag:
In addition to the substitute
script, we also provide the cat_substitute
script.
This is more powerful, allowing for named substituents (instead of using the target atom numbering) to be replaced.
However, it is built for catalysis systems the atoms in the xyz file must be in the appropriate order.
See Adding substituents to a catalysis object below.
Each substituent in the AaronTools library has a set number of conformers that AaronTools will consider. For example, the tBu
substituent in the AaronTools library has two conformers, which differ form each other by rotating the substituent 180°. The make_conf
script applies these rules to a molecule's structure to generate conformers:
make_conf alcohol.xyz -s 1=OH 3,5=tBu -c 2,3,4,5,6,7,8
This will generate seven structures that may be close to a stable geometry. The 1st conformer was not requested because it would be identical to the input. The conformer rules will only be applied to the specified substituents. Running the same make_conf
without the -c
flag will output all potential conformers according to AaronTool's conformer rules. Of course, accurate geometry optimization algorithms will have to be employed to verify that the structures relax to unique minima, but the structures generated by the example make_conf
command are shown in the animation below.
Starting from a set of coordinates following AaronTools conventions (substrate atoms, then metal center, then ligand), you can replace the ligand with any ligand in the Ligand Library.
For example, suppose the following structure, which is a TS for a Rh-catalyzed hydrogenation of an enamide using an achiral ZDMP ligand from [REF], saved as ts1.xyz.
The following will replace ZDMP with (R,R)-Me-BPE:
map_ligand ts1.xyz –l RR-Me-BPE -o ts2.xyz
This will write the coordinates for the following structure as ts2.xyz:
Starting from a set of coordinates following AaronTools conventions (substrate atoms, then metal center, then ligand), you can replace hydrogens or substituents with substituents found in the Substituent Library. If these substitutions occur on the ligand, you can either specify the atom number of the first atom of the substituent (the atom connected to the rest of the ligand) or by name.
For instance, starting with ts2.xyz from above, you can replace all methyl groups on the ligand with Ph, replace the CN group starting with atom 5 by COOCH3, and replace hydrogens 7 and 8 with methyl groups:
cat_substitute ts2.xyz –l Me=Ph -s 7,8=Me 5=COOCH3 -o ts3.xyz
This will result in the following structure being written to ts3.xyz
The command line script cat_screen can be used to systematically substitute a structure with various combinations of substituents. The general form of the command is as follows:
cat_screen cat.xyz -l <key=value ...> -s <key=value ...> -w dir/path
The space-separated list of key=value pairs after the -l and/or -s flags will specify how to substitute the ligand and/or substrate, respectively. The key takes the form of atom indices indicating where the atom or original substituent to replace begins, analogous to the target in the Adding substituents to a simple geometry section above. A comma-separated list of atom indices for the key is also allowed, and is useful for symmetric substitutions. The value takes the form of a comma-separated list of desired substituents.
The -w flag specifies the path to the directory where the generated xyz files should be saved. Omission of this flag will simply save the files to the current working directory.
Example 1: Substitution with one target
cat_screen cat.xyz -l 38=Me,iPr,tBu -w l-38
This will produce three files, replacing the ligand atom or substituent found at index 38 with a methyl group, an isopropyl group, or a t-butyl group. These file will be saved in the l-38 directory, creating it if necessary.
Example 2: Combinations on multiple targets
cat_screen cat.xyz -l 38=Me,iPr 51=H,OH
This will produce four total files, saving them to the current directory.
- 38=Me and 51=H
- 38=Me and 51=OH
- 38=iPr and 51=H
- 38=iPr and 51=OH.
cat_screen cat.xyz -l 38,51=Me,iPr,tBu
This will produce three total files, saving them to the current directory:
- 38=Me and 51=Me
- 38=iPr and 51=iPr
- 38=tBu and 51=tBu
cat_screen
can accept single/multiple ligand substitutions, single/multiple substrate substitutions, or a combination of these.
The rmsd_align
script is used to align a target structure to a reference structure, minimizing the RMSD between the two.
The new geometry produced will be printed to STDOUT
in xyz format, or saved to a file if specified with the -o flag.
The RMSD calculated for the alignment will be shown in the xyz comment line.
To simply align target.xyz to reference.xyz:
rmsd_align reference.xyz target.xyz
To align, but exclude hydrogen atoms in the RMSD, and silently overwrite the current target.xyz file:
rmsd_align reference.xyz target.xyz -ha -o target.xyz -f
Remember one can omit the -f flag to use the interactive prompt to handle possible file overwrites, if desired.
To align the last 30 atoms of the target to the reference:
rmsd_align reference.xyz target.xyz -t 18-47
To align certain atoms of the target to certain atoms of the reference:
rmsd_align reference.xyz target.xyz -r 15-30,36-40 -t 20-45,5-1
This will match atoms 15-30 (inclusive, 1-indexed) of the reference to atoms 20-45 of the target and atoms 36-40 of the reference to atoms 5, 4, 3, 2, and 1 of the target.
It is possible to request that the atoms be re-ordered when calculating the RMSD by using the -c flag (for change-order). This is useful when the atom ordering from one structure to another is not conserved, or the target structure is larger than the reference structure and the additional atoms were added in a way that makes them cumbersome to explicitly specify. However, this can be quite slow for large systems. In those cases, re-ordering the atoms manually or using the -t and -r flags will be much more efficient. To specify that atoms should be reordered for the RMSD calculation:
rmsd_align reference.xyz target.xyz -c
This will NOT affect the atom order in the resulting file. Additionally, this can be requested along with the -t or -r or -ha flags, if desired.