a package for batch processing of spectra-related Gaussian output files
Project description
tesliper
tesliper
: Theoretical Spectroscopist's Little Helper is a program for batch processing
of Gaussian output files, focused on calculations of vibrational, electronic, and
scattering spectra from Gaussian-calculated quantum properties of molecule's conformers.
It allows to easily exclude conformers that are not suitable for further analysis:
erroneous, not optimized, of higher energy or lower contribution than a user-given
threshold. It also implements an RMSD sieve, enabling one to filter out similar
structures. It lets you calculate theoretical IR, VCD, UV, ECD, Raman, and ROA spectra
for each conformer or as a population-weighted average and export obtained spectral data
in one of supported file formats: .txt
, .csv
, or .xlsx
. Finally, if allows to
easily setup a next calculations step with batch export to .gjf
Gaussian input files.
tesliper
is written in Python 3.6 and makes use of some additional third party
packages (see below or requirements.txt). It may be used as a package or as a
stand-alone application with dedicated GUI.
Getting Started
You can use tesliper
from python or as standalone application with dedicated graphical
user interface. See below for details.
Requirements
Python 3.6+
numpy
openpyxl
tkinter (optional, for GUI)
matplotlib (optional, for GUI)
Installing to your Python distribution
tesliper
is available on PyPI, you can install it to your python distribution by
simply running:
$ python -m pip install tesliper
or
$ python -m pip install tesliper[gui]
if you would like to be able to use a graphical interface.
A standalone application
This option is currently available only for Windows users.
To get your copy of tesliper
, simply download a Tesliper.exe
file from the
latest relase.
This file is a standalone application, no installation is required.
How to use
Full documentation is available online: https://tesliper.readthedocs.io/.
Primer
Conventions that are important to note:
tesliper
stores multiple data entries of various types for each conformer. To prevent confusion with Python's datatype
and with data itself,tesliper
refers to specific kinds of data as "genres". Genres in code are represented by specific strings, used as identifiers. To learn about data genres known totesliper
, see Available data genres.tesliper
identifies conformers using a stem of an extracted file (i.e. its filename without extension). When files with identical names are extracted in course of subsequentTesliper.extract
calls or in recursive extraction usingTesliper.extract(recursive=True)
, they are treated as data for one conformer. This enables to join data from subsequent calculations steps, e.g. geometry optimization, vibrational spectra simulation, and electronic spectra simulation. Please note that if specific data genre is available from more than one calculation job, only recently extracted values will be stored.tesliper
was designed to deal with multiple conformers of single molecule and may not work properly when used to process data concerning different molecules (i.e. having different number of atoms, different number of degrees of freedom, etc.). If you want to use it for such purpose anyway, you may setTesliper.conformers.allow_data_inconsistency
toTrue
.tesliper
will then stop complaining and try to do its best.
In Python scripts
Tesliper
class is the main access point to tesliper
's functionality. It allows you
to extract data from specified files, provides a proxy to the trimming
functionality, gives access to data in form of specialized arrays, enables you
to calculate and average desired spectra, and provides an easy way to export data.
Most basic use might look like this:
from tesliper import Tesliper
tslr = Tesliper()
tslr.extract()
tslr.calculate_spectra()
tslr.average_spectra()
tslr.export_averaged()
This extracts data from files in the current working directory, calculates available spectra using standard parameters, averages them using available energy values, and exports to current working directory in .txt format.
You can customize this process by specifying call parameters for used methods
and modifying Tesliper
's configuration attributes:
- to change source directory
or location of exported files instantiate
Tesliper
object withinput_dir
andoutput_dir
parameters specified, respectively. You can also set appropriate attributes on the instance directly; - to extract only selected files in
input_dir
usewanted_files
init parameter. It should be given an iterable of filenames you want to parse. Again, you can also directly set an identically named attribute; - use
Tesliper.conformers.trim...
methods to easily filter out conformers you wish to ignore in further analysis; - to change parameters used for calculation of spectra, modify appropriate entries
of
parameters
attribute; - use other export methods to export more data and specify
fmt
parameter in method's call to export to other file formats.
tslr = Tesliper(input_dir="./myjob/optimization/", output_dir="./myjob/output/")
tslr.wanted_files = ["one", "two", "three"] # only files with these names
tslr.extract() # use tslr.input_dir as source
tslr.extract(path="./myjob/vcd_sim/") # use other input_dir
tslr.conformers.trim_not_optimized() # filtering out unwanted conformers
tslr.parameters["vcd"].update({"start": 500, "stop": 2500, "width": 2})
tslr.calculate_spectra(genres=["vcd"]) # we want only VCD spectrum
tslr.average_spectra()
tslr.export_averaged(mode="w") # overwrite previously exported files
tslr.export_activities(fmt="csv") # save activities for analysis elsewhere
tslr.output_dir = "./myjob/ecd_sim/"
tslr.export_job_file( # prepare files for next step of calculations
route="# td=(singlets,nstates=80) B3LYP/Def2TZVP"
)
A graphical interface
If you are using tesliper
as a standalone application, simply double click on the
Tesliper.exe
file to start the application. To invoke it from the command line,
run python -m tesliper.gui
. GUI consists of three panels and a number of controls.
The panels are: "Extracted data", "Energies list", and "Spectra view". First two
offer a list of conformers read so far using "Chose files" and "Chose folder" buttons
on the left. The last enables to preview calculated spectra.
- "Extracted data" panel shows an identifier of each conformer (a file name) and an overview of data extracted. Little checkboxes on the left of each conformer may be clicked to mark this conformer as "kept" or "not kept".
- "Energies list" offers the same set of conformers and checkboxes, but with energies values listed for each conformer. The view may be changed using "Show" dropdown box in "Energies and Structure" section of controls, to present difference in energy between conformers or their percentage contribution in population.
- "Spectra view" tab shows calculated spectra. It may be controlled using "Calculate spectra" section. After choosing a spectra genre to calculate you may control if it is simulated using lorentzian or gaussian fitting function, change peak width, spectra bounds, etc. You may view spectra for one conformer, all of them stacked, or averaged. You may also load an experimental spectrum (.txt or .csv format) for comparison.
Once done with extracting files and tweaking parameters, export selected data to desired format or save the session for later using buttons in "Session control" section.
A detailed tutorial with screenshots is available in the documentation: https://tesliper.readthedocs.io/en/stable/gui.html.
License
This project is licensed with BSD 2-Clause license. See LICENSE.txt file for details.
Contributing to tesliper
Contributions are welcome! tesliper
is a growing project and definitely has room
for improvements.
Bugs and suggestions
Bug reports are of great value, if you encounter a problem please let me know by
submitting a new issue.
If you have a suggestion how tesliper
can be improved, please let me know as well!
Participating in code
If you'd like to contribute to tesliper
's codebase, that's even better!
If there is a specific bug that you know how to fix or a feature you'd like to develop,
please let me know via issues.
To get your change introduced to the codebase, please make a Pull Request to the
fixes
branch for bug fixes or to the dev
branch for new features.
If at a loss, do not hesitate to reach to me directly! :)
Roadmap
Ideas for possible future improvements to the software are listed below. Based on the feedback from the Community, I will decide, which ones are desired and worth working on.
New Functionality:
- command line interface
- support for Jaguar & other packages
- option for using
cclib
for parsing - spectra comparison feature
- velocity and length electronic spectra comparison
- parsing conformational search files
- GUI: manually choose spectra colour
UX Improvements:
- supplement logging
- auto finding optimal spectra range
- GUI: export spectra as image
- GUI: spectra colour by population
- GUI: drag&drop support
- GUI: display tooltips on hover
Acknowledgements
Many thanks to the scientists, who advised me on the domain-specific details and helped to test the software:
- Joanna Rode 0000-0003-0592-4053
- Magdalena Jawiczuk 0000-0003-2576-4042
- Marcin GĂłrecki 0000-0001-7472-3875
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tesliper-0.9.0.tar.gz
.
File metadata
- Download URL: tesliper-0.9.0.tar.gz
- Upload date:
- Size: 175.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.7.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d4e00eb525028505f3e1e3c3d3e52093b8e86cec32e2e0b025ee7925430cfa3 |
|
MD5 | d0fa7700db73343bfc0e82624a509ac2 |
|
BLAKE2b-256 | b00a3ebbec9389f42300831c8fe58e324c38e129e2efa520850d556848bc603e |
File details
Details for the file tesliper-0.9.0-py3-none-any.whl
.
File metadata
- Download URL: tesliper-0.9.0-py3-none-any.whl
- Upload date:
- Size: 199.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.7.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 921001f2eec534a6f334751c22146104d3b838b2d9c16e7e23a33366998f2dfd |
|
MD5 | a3f48ed94a4abf0696ed09af90e98551 |
|
BLAKE2b-256 | 2197fe3a80ad141e93576d9a9aa8873f45bd2f342f29217d130dda40e277082e |