Skip to content

ZJYgrp/React_Traj_Analysis

Repository files navigation

Reaction Trajectory Analysis

These scripts permit analysis of the ratios and bond-formation timing for bifurcating reaction trajectories. The suite was initially produced to analyze trajectories generated by Daniel Singleton's Progdyn interface to Gaussian but can be adapted as needed to the format of the trajectory file. Notes will be included with the specifics of each individual script on potential necessary adaptations. They are associated with this paper on organic reactions that display post-transition state bifurcation and were used to prepare the analyses and figures therein.

Tutorial

Necessary Input Files

  • ntraj - A directory containing all trajectories in .xyz file format
  • traj.conf - A configuration file dictating the details of the anticipated bifurcation.

An example ntraj and traj.conf have been included with the tutorial. For an in-depth explanation of the traj.conf forat, please see "File Details" below.

Tutorial Steps

  1. Ensure that you have the latest version of Python installed
  2. Within the main directory of this project execute your chosen analysis and plotting scripts
    • For ratio:
      • python ratio_analysis.py
      • python ratio_plot.py
    • For ratio:
      • python time_analysis.py
      • python time_plot.py
  3. The resulting outputs will be printed to stdout and placed in the trajTS directory. See below for specific output file details.

File Details

  • traj.conf - dictates the settings used for the bifurcation analysis. If absent, the user will be prompted to input the settings manually.
    • Line 1 - "Y" if you would like all the previously analyzed data to be cleared, "N" otherwise.
    • Line 2 - The bifurcation mode number (currently "1" or "2").
      • Mode 1 is when the two products (X & Y) share one common bond that forms post-transiton state, and then one of two possible bonds forms to form product X or product Y.
      • Mode 2 is when the products have no forming bonds in common, and one possible bond leads to product X while the other leads to product Y.
    • Line 3 - The atom indices corresponding to the forming bonds (space-separated, using one-based indexing, based on the order present in the input .xyz files in ntraj).
      • For mode 1, this is 6 indices, in the order [shared bond atoms] [product X bond atoms] [product Y bond atoms]
      • For mode 2, this is 4 indices, in the order [product X bond atoms] [product Y bond atoms]
  • trajectories.py - defines the Trajectories class, which is used by both analysis programs. Its methods rearrange the trajectories and classify them based on their starting and ending points.
  • ratio_analysis.py - uses the Trajectories class to parse all .xyz files in ntraj into .txt files containing the lengths of the bonds specified in traj.conf and place them into a folder corresponding to the trajectory's categorization after reordering. Information about the ratio of forming products along with the number of recrossing trajectories is also printed and logged in trajTS/traj_log
    • TDD_r2pX - starts at reactant and ends as product X
    • TDD_r2pY - starts at reactant and ends as product Y
    • TDD_p2pX - starts at product and ends as product X
    • TDD_p2pY - starts at product and ends as product Y
    • TDD_p2pY - starts at reactant and reverts back to reactant
  • ratio_plot.py - uses the .txt files stored in TDD_r2pX and TDD_r2pY to generate a color-coded plot of the bond lengths associated with the forming products as trajTS/TDD_r2p_dvd.png
  • time_analysis.py - uses the Trajectories class to parse all .xyz files in ntraj into trajTS/trajTimes.txt, which contains the time in fs after the TS that lengths of the bonds specified in traj.conf first reach 1.6 Angstroms. Information about the median formation time of the bonds and the gaps between bond formation if multiple bonds are formed is also printed and logged in trajTS/time_log
  • time_plot.py - uses trajTS/trajTimes.txt to generate a color-coded histogram of the bond formation time or time gap associated with the forming products as trajTS/bond_time_gaps.png or trajTS/bond_times.png

About

Scripts for trajectory analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages