asinput
Takes a gaussian output file and constructs a gaussian input file with its last geometry using its input file as template which is guessed as the .com file with the same name as the provided output file.
usage: pyssianutils asinput [-h] [-l | -r] [-m MARKER | --no-marker]
[-o OUTDIR | --inplace] [-ow] [-t TAIL] [--as-SP]
[--method METHOD] [--basis BASIS]
[--solvent SOLVENT] [--smodel {smd,pcm,None}]
[--add-text ADD_TEXT]
[--suffixes SUFFIXES SUFFIXES]
files [files ...]
Positional Arguments
- files
Gaussian Output Files
Named Arguments
- -l, --listfile
When enabled instead of considering the files provided as the gaussian output files considers the file provided as a list of gaussian output files
Default:
False
- -r, --folder
Takes the folder and its subfolder hierarchy and creates a new folder with the same subfolder structure. Finds all the .log, attempts to find their companion .com files and creates the new inputs in their equivalent locations in the newfolder tree structure.
Default:
False
- -m, --marker
Text added to the filename to differentiate the original file from the newly created one. For example, myfile.com may become myfile_marker.com
- --no-marker
The file stems are kept
Default:
False
- -o, --outdir
Where to create the new files, defaults to the current directory
- --inplace
Creates the new files in the same locations as the files provided by the user
Default:
False
- -ow, --overwrite
When creating the new files if a file with the same name exists overwrites its contents. (The default behaviour is to raise an error to notify the user beforeoverwriting).
Default:
False
- -t, --tail
Tail File that contains the extra options, such as pseudopotentials, basis sets
- --as-SP
Removes the freq, opt and scan keyword if those existed in the previously existing inputs and changes the default marker to SP
Default:
False
- --method
New method/functional to use. Originally this option is thought to run DFT benchmarks it is not guaranteed a working input for CCSDT or ONIOM.
- --basis
New basis to use if it was specified in the command line. For these purposes 'gen' and 'genecp' also count as 'basis'
- --solvent
New solvent to use in the calculation written as it would be written in Gaussian. ('vacuum'/'gas' will remove the scrf keywords if they were in the previous input files)
- --smodel
Possible choices: smd, pcm, None
Solvent model. The scrf keyword will only be included if the --solvent flag is enabled. (Defaults to None which implies that no change to the original inputs smodel will be done)
- --add-text
Attempts to add literally the text provided to the command line. Recommended: "keyword=(value1,keyword2=value2)"
- --suffixes
Input and output suffix used for gaussian files
Default:
('.com', '.log')
Usage
The main use-cases of asinput
is for the generation of single point
inputs as well as for re-running finished calculations with common changes
(changing the basis, method, solvation, solvent, adding some text to all
inputs such as "g09defaults" or "empiricaldispersion").
For example purposes lets assume that we have the following folder structure:
- project
| - minima
| | - A.com
| | - A.log
| | - B.com
| | - B.log
| | - AB.com
| | - AB.log
| - ts
| | - ts_01.com
| | - ts_01.log
| | - ts_02.com
| | - ts_02.log
Let us also assume that all calculations have the method and basis specified in
the command line, e.g. wb97xd
and 6-31+g(d)
First, we could generate a single point input for A by running:
$ pyssianutils asinput project/minima/A.log --inplace --as-SP --basis "6-311+g(d,p)"
this will change the folder structure to:
- project
| - minima
| | - A.com
| | - A.log
| | - A_SP.com
| | - B.com
| | - B.log
| | - AB.com
| | - AB.log
| - ts
| | - ts_01.com
| | - ts_01.log
| | - ts_02.com
| | - ts_02.log
by specifying --inplace
we indicate that we want the new input to be in
the same folder as the logfile from which it was generated. By specifying
--as-SP
everything but the opt
and freq
keywords are
copied from the reference input file (A.com
, which is the .com
with the same name and in the same folder as the provided .log
). Finally,
the --basis "6-311+g(d,p)"
changes the basis of the template file to the
provided one, 6-311+g(d,p)
If we wanted to specify the basis at the end
of the file, we would instead --basis genecp
and also --tail tail.txt
where tail.txt
's contents would be the basis set specification as we
would at the end of a gaussian input file (see also inputht )
Instead of specifying just a single output file, we can instead specify various
files, either directly in the command line or by providing a file that lists the
output files to consider and the --listfile
(similar mechanisms
are included in inputht, print or toxyz ) Therefore the
command:
$ pyssianutils asinput project/minima/*.log --inplace --as-SP --basis "6-311+g(d,p)"
would change our file structure to:
- project
| - minima
| | - A.com
| | - A.log
| | - A_SP.com
| | - B.com
| | - B.log
| | - B_SP.com
| | - AB.com
| | - AB.log
| | - AB_SP.com
| - ts
| | - ts_01.com
| | - ts_01.log
| | - ts_02.com
| | - ts_02.log
If we have multiple folders and we want the same operation for all folders and subfolders we can instead specify it as:
$ pyssianutils asinput -r project --inplace --as-SP --basis "6-311+g(d,p)" --suffixes .com .log
which will update our folder structure to:
- project
| - minima
| | - A.com
| | - A.log
| | - A_SP.com
| | - B.com
| | - B.log
| | - B_SP.com
| | - AB.com
| | - AB.log
| | - AB_SP.com
| - ts
| | - ts_01.com
| | - ts_01.log
| | - ts_01_SP.com
| | - ts_02.com
| | - ts_02.log
| | - ts_02_SP.com
Note
If we had run the previous commands sequentially, an error would have shown
at the second command, complaining that A_SP.com
already existed, and
that if we wanted to overwrite it the flag -ow
is necessary. This was
done to avoid overwriting by mistake already existing files.
With the help, of :code:` pyssianutils submit slurm` we can generate a slurm script for each one of the SP calculations (see more at slurm) After running the calculations our folder would look like:
- project
| - minima
| | - A.com
| | - A.log
| | - A_SP.com
| | - A_SP.log
| | - B.com
| | - B.log
| | - B_SP.com
| | - B_SP.log
| | - AB.com
| | - AB.log
| | - AB_SP.com
| | - AB_SP.log
| - ts
| | - ts_01.com
| | - ts_01.log
| | - ts_01_SP.com
| | - ts_01_SP.log
| | - ts_02.com
| | - ts_02.log
| | - ts_02_SP.com
| | - ts_02_SP.log
If we wanted to re-do the project with a different functional we can easily generate a new folder that respects the folder structure of our project folder
$ pyssianutils asinput -r project --outdir project_m06 --suffixes .com .log --no-marker
Now we will have a new folder with the contents:
- project_m06
| - minima
| | - A.com
| | - A_SP.com
| | - B.com
| | - B_SP.com
| | - AB.com
| | - AB_SP.com
| - ts
| | - ts_01.com
| | - ts_01_SP.com
| | - ts_02.com
| | - ts_02_SP.com
where all the inputs have m06
as functional instead of wb97xd
.
we could then run first all the optimizations, re-generate the single points as
we did previously, and re-run the single point calculations.