Source code for scm.input_classes.drivers.chemtrayzer2

from __future__ import annotations
from pathlib import Path
from typing import Iterable, Literal, Sequence
from scm.pisa.block import DriverBlock,EngineBlock,FixedBlock,FreeBlock,InputBlock
from scm.pisa.key import BoolKey,FloatKey,FloatListKey,IntKey,IntListKey,MultipleChoiceKey,PathStringKey,StringKey,BoolType

[docs]class Chemtrayzer2(DriverBlock): r""" :ivar PrintDebug: Print extra debug information to the terminal. :vartype PrintDebug: BoolType | BoolKey :ivar Analysis: Statistical post-detection analysis, includes reaction coefficients calculation. :vartype Analysis: Chemtrayzer2._Analysis :ivar MoleculeIdentifier: Settings for the subgraph identification of molecules and reactions. :vartype MoleculeIdentifier: Chemtrayzer2._MoleculeIdentifier :ivar Output: Settings for program output and output file generation. :vartype Output: Chemtrayzer2._Output :ivar ReactionDetection: Parameters for the the reaction detection algorithm. :vartype ReactionDetection: Chemtrayzer2._ReactionDetection :ivar Trajectory: Info regarding the trajectory to analyze. :vartype Trajectory: Chemtrayzer2._Trajectory """
[docs] class _Analysis(FixedBlock): r""" Statistical post-detection analysis, includes reaction coefficients calculation. :ivar PerformAnalysis: Determine the reaction rate coefficients and statistical errors for the detected reactions. :vartype PerformAnalysis: BoolType | BoolKey :ivar RateConfidence: Upper and lower bounds to the rate coefficients will be calculated for this confidence (0 < confidence < 1), assuming a Poisson distribution of the number of reactive events. A value of 0.9 means that the kinetics of 90% of events of one reaction can be described by a coefficient between the bounds. :vartype RateConfidence: float | FloatKey """ def __post_init__(self): self.PerformAnalysis: BoolType | BoolKey = BoolKey(name='PerformAnalysis', comment='Determine the reaction rate coefficients and statistical errors for the detected reactions.', default=True) self.RateConfidence: float | FloatKey = FloatKey(name='RateConfidence', comment='Upper and lower bounds to the rate coefficients will be calculated for this confidence (0 < confidence < 1), assuming a Poisson distribution of the number of reactive events. A value of 0.9 means that the kinetics of 90% of events of one reaction can be described by a coefficient between the bounds.', default=0.9)
[docs] class _MoleculeIdentifier(FixedBlock): r""" Settings for the subgraph identification of molecules and reactions. :ivar MaxDepth: The maximum number of layers the algorithm goes along bonds, starting from one atom when generating hashes for one atom. The entire molecule hash is built from the atom hashes, so this setting influences the identification of atom neighborhoods. :vartype MaxDepth: int | IntKey :ivar UseBondOrders: Consider bond orders in the identifier. :vartype UseBondOrders: BoolType | BoolKey :ivar UseHs: Consider number of hydrogens of atoms in the identifier. :vartype UseHs: BoolType | BoolKey :ivar UseRings: Consider ring membership of atoms in the identifier. :vartype UseRings: BoolType | BoolKey :ivar WindowDepth: The maximum number of layers the algorithm goes along bonds starting from the reactive atoms when generating hashes for the entire molecule. With this setting, the identifier can be limited to only a part of the molecule. :vartype WindowDepth: int | IntKey """ def __post_init__(self): self.MaxDepth: int | IntKey = IntKey(name='MaxDepth', comment='The maximum number of layers the algorithm goes along bonds, starting from one atom when generating hashes for one atom. The entire molecule hash is built from the atom hashes, so this setting influences the identification of atom neighborhoods.', default=2) self.UseBondOrders: BoolType | BoolKey = BoolKey(name='UseBondOrders', comment='Consider bond orders in the identifier.', default=False) self.UseHs: BoolType | BoolKey = BoolKey(name='UseHs', comment='Consider number of hydrogens of atoms in the identifier.', gui_name='Use Hs:', default=False) self.UseRings: BoolType | BoolKey = BoolKey(name='UseRings', comment='Consider ring membership of atoms in the identifier.', default=True) self.WindowDepth: int | IntKey = IntKey(name='WindowDepth', comment='The maximum number of layers the algorithm goes along bonds starting from the reactive atoms when generating hashes for the entire molecule. With this setting, the identifier can be limited to only a part of the molecule.', default=5)
[docs] class _Output(FixedBlock): r""" Settings for program output and output file generation. :ivar CreateLegacyOutput: Whether to save the reactions, species, and rates as 'reac.reac.tab', 'reac.spec.tab', and 'reac.rate.tab' in the same format as ChemTraYzer 1. :vartype CreateLegacyOutput: BoolType | BoolKey :ivar ShowReactionGraph: Whether or not to show the reaction graph at the end of the calculation. Requires the python library matplotlib to be installed. :vartype ShowReactionGraph: BoolType | BoolKey :ivar WriteEventsPerTime: Write two .csv files that contain the number of reactions in every frame (reaction_events_per_time.csv) and the number of bond changes in every frame(bond_change_events_per_time.csv) :vartype WriteEventsPerTime: BoolType | BoolKey :ivar WriteKF: Whether to write output to KF :vartype WriteKF: BoolType | BoolKey :ivar WriteMolPopulation: Write two .csv files: (1) mol_statistics.csv, which contains basic population statistics (counts, averages) for each unique species over the entire trajectory; and (2) mol_population.csv, which provides the count of each unique species in every frame. :vartype WriteMolPopulation: BoolType | BoolKey :ivar WriteReactions: Write two .csv files that contain information about (1) all unique reactions (reactions.csv); and (2) all individual reaction events (reaction_events.csv). :vartype WriteReactions: BoolType | BoolKey :ivar WriteXYZFiles: Write XYZ files (geometries) for detected species and XYZ movies for detected reactions into a subfolder named 'xyz'. :vartype WriteXYZFiles: BoolType | BoolKey """ def __post_init__(self): self.CreateLegacyOutput: BoolType | BoolKey = BoolKey(name='CreateLegacyOutput', comment="Whether to save the reactions, species, and rates as 'reac.reac.tab', 'reac.spec.tab', and 'reac.rate.tab' in the same format as ChemTraYzer 1.", default=False) self.ShowReactionGraph: BoolType | BoolKey = BoolKey(name='ShowReactionGraph', comment='Whether or not to show the reaction graph at the end of the calculation. Requires the python library matplotlib to be installed.', default=False) self.WriteEventsPerTime: BoolType | BoolKey = BoolKey(name='WriteEventsPerTime', comment='Write two .csv files that contain the number of reactions in every frame (reaction_events_per_time.csv) and the number of bond changes in every frame(bond_change_events_per_time.csv)', default=False) self.WriteKF: BoolType | BoolKey = BoolKey(name='WriteKF', comment='Whether to write output to KF', default=False) self.WriteMolPopulation: BoolType | BoolKey = BoolKey(name='WriteMolPopulation', comment='Write two .csv files: (1) mol_statistics.csv, which contains basic population statistics (counts, averages) for each unique species over the entire trajectory; and (2) mol_population.csv, which provides the count of each unique species in every frame.', default=False) self.WriteReactions: BoolType | BoolKey = BoolKey(name='WriteReactions', comment='Write two .csv files that contain information about (1) all unique reactions (reactions.csv); and (2) all individual reaction events (reaction_events.csv).', default=True) self.WriteXYZFiles: BoolType | BoolKey = BoolKey(name='WriteXYZFiles', comment="Write XYZ files (geometries) for detected species and XYZ movies for detected reactions into a subfolder named 'xyz'.", default=False)
[docs] class _ReactionDetection(FixedBlock): r""" Parameters for the the reaction detection algorithm. :ivar BondBreakingThreshold: The bond-order threshold for bond breaking. If the bond order of a bond goes below this value, the bond is considered broken. :vartype BondBreakingThreshold: float | FloatKey :ivar BondFormationThreshold: The bond-order threshold for bond formation. If the bond order between two atoms goes above this value, then this will be considered to be a new bond. :vartype BondFormationThreshold: float | FloatKey :ivar InitialBondThreshold: The bond-order threshold for determining the connectivity for the first frame of the simulation. If not specified, the value in BondFormationThreshold will be used instead. :vartype InitialBondThreshold: float | FloatKey :ivar TStable: The minimum time for a molecule to be considered stable. :vartype TStable: float | FloatKey """ def __post_init__(self): self.BondBreakingThreshold: float | FloatKey = FloatKey(name='BondBreakingThreshold', comment='The bond-order threshold for bond breaking. If the bond order of a bond goes below this value, the bond is considered broken.', default=0.3) self.BondFormationThreshold: float | FloatKey = FloatKey(name='BondFormationThreshold', comment='The bond-order threshold for bond formation. If the bond order between two atoms goes above this value, then this will be considered to be a new bond.', default=0.8) self.InitialBondThreshold: float | FloatKey = FloatKey(name='InitialBondThreshold', comment='The bond-order threshold for determining the connectivity for the first frame of the simulation. If not specified, the value in BondFormationThreshold will be used instead.') self.TStable: float | FloatKey = FloatKey(name='TStable', comment='The minimum time for a molecule to be considered stable.', gui_name='T stable:', default=10.0, unit='fs')
[docs] class _Trajectory(FixedBlock): r""" Info regarding the trajectory to analyze. :ivar FinalFrame: Last frame of the trajectory to analyze. :vartype FinalFrame: int | IntKey :ivar FirstFrame: First frame of the trajectory to analyze. :vartype FirstFrame: int | IntKey :ivar Path: The path to ams results dir of an AMS calculation. This folder must contain a ams.rkf file. :vartype Path: str | Path | StringKey """ def __post_init__(self): self.FinalFrame: int | IntKey = IntKey(name='FinalFrame', comment='Last frame of the trajectory to analyze.', default=-1) self.FirstFrame: int | IntKey = IntKey(name='FirstFrame', comment='First frame of the trajectory to analyze.', default=1) self.Path: str | Path | StringKey = PathStringKey(name='Path', comment='The path to ams results dir of an AMS calculation. This folder must contain a ams.rkf file.', ispath=True, gui_type='no-dependency')
def __post_init__(self): self.PrintDebug: BoolType | BoolKey = BoolKey(name='PrintDebug', comment='Print extra debug information to the terminal.', default=False) self.Analysis: Chemtrayzer2._Analysis = self._Analysis(name='Analysis', comment='Statistical post-detection analysis, includes reaction coefficients calculation.') self.MoleculeIdentifier: Chemtrayzer2._MoleculeIdentifier = self._MoleculeIdentifier(name='MoleculeIdentifier', comment='Settings for the subgraph identification of molecules and reactions.') self.Output: Chemtrayzer2._Output = self._Output(name='Output', comment='Settings for program output and output file generation.') self.ReactionDetection: Chemtrayzer2._ReactionDetection = self._ReactionDetection(name='ReactionDetection', comment='Parameters for the the reaction detection algorithm.') self.Trajectory: Chemtrayzer2._Trajectory = self._Trajectory(name='Trajectory', comment='Info regarding the trajectory to analyze.')