Skip to content

Raubkatz/Autocatalytic-Sets-and-Assembly-Theory

Repository files navigation

Autocatalytic Sets and Assembly Theory: A Toy Model Perspective

Repository for the computational exploration of autocatalytic reaction networks as discussed in the corresponding paper.

The perprint can be found at: https://www.preprints.org/manuscript/202408.1213/v1

Authors: Dr. techn. Sebastian Raubitzek MSc. BSc.

Overview

This repository contains a collection of Python scripts used to model, analyze, and visualize autocatalytic reaction networks and their assembly processes. The project is based on the principles discussed in the paper "Autocatalytic Sets and Assembly Theory: A Toy Model Perspective" and includes tools for generating reaction networks, performing assembly analysis, and visualizing the results through various plots.

The primary components of this project are:

  1. Autocatalytic Set Generation: A script that generates random autocatalytic sets and saves the resulting reaction networks.
  2. Assembly Analysis: A script that analyzes multiple instances of autocatalytic sets, calculating assembly indices and other metrics to evaluate the complexity and efficiency of the assembly process.
  3. Autocatalysis Statistics: A script that processes the results of the assembly analysis to calculate and display statistical information about the generated networks.
  4. Results Manipulation: A script that manipulates and filters the results data, preparing it for detailed analysis and visualization.
  5. Line and Surface Plot Generation: Scripts that generate visual representations (line plots and 3D surface plots) of the statistical data, aiding in the interpretation of the analysis results.

Repository Structure

├── README.md

├── 01_Generate_Random_Autocatalytic_Set.py

├── 02_Assembly_Analysis_Autocatalytic_Set.py

├── 03_Autocatalysis_Statistics.py

├── 04_manipulate_results_array.py

├── 05a_line_plots.py

├── 05b_surface_plots.py

├── assembly_analysis_results

│ └── ... contains data generated and processed by the scripts, this folder will be created upon running the scripts

Script Descriptions

  1. 01_Generate_Random_Autocatalytic_Set.py:

    • Purpose: This script generates random autocatalytic reaction networks based on a predefined final product. It simulates the assembly process by recursively splitting the final product into smaller reactants and assigning catalysts to the resulting reactions.
    • Output: The generated reaction networks are saved to a CSV file for further analysis.
  2. 02_Assembly_Analysis_Autocatalytic_Set.py:

    • Purpose: This script performs an in-depth analysis of multiple instances of autocatalytic sets. It calculates assembly indices, which represent the complexity and depth of the reaction networks. The script also considers the presence of autocatalytic subnetworks, which can significantly influence the assembly process.
    • Output: The script generates a list of assembly indices and saves detailed results, including subnetwork counts and maximum depths, to a CSV file.
  3. 03_Autocatalysis_Statistics.py:

    • Purpose: This script processes the data generated by the assembly analysis to calculate statistical metrics such as mean, median, variance, and standard deviation of the assembly indices. These statistics provide insights into the overall efficiency and complexity of the generated autocatalytic networks.
    • Output: A CSV file containing the calculated statistics for further analysis.
  4. 04_manipulate_results_array.py:

    • Purpose: This script manipulates and filters the results data from the assembly analysis. It applies various filters, such as excluding certain catalyst assignment strategies or focusing on specific ranges of product lengths. The script also compares the results to a baseline and calculates differences in assembly indices.
    • Output: An updated CSV file with the filtered and manipulated results.
  5. 05a_line_plots.py:

    • Purpose: This script generates line plots that visualize the relationship between the length of the final product and the assembly indices (mean, standard deviation, and minimum). It compares different catalyst assignment strategies and autocatalytic amplification methods.
    • Output: PNG and EPS files containing the generated line plots.
  6. 05b_surface_plots.py:

    • Purpose: This script generates 3D surface plots that visualize how the catalyst probability and product length influence the assembly indices across different configurations. It provides a more detailed view of the interactions between these parameters.
    • Output: PNG and EPS files containing the generated surface plots.

Prerequisites

Ensure you have the following dependencies installed:

  • Python 3.6 or higher
  • numpy==1.19.5
  • pandas==1.1.3
  • matplotlib==3.2.2
  • seaborn==0.11.0
  • networkx==2.5
  • scikit-learn==0.24.2

Usage

  1. Generate Autocatalytic Sets: Run 01_Generate_Random_Autocatalytic_Set.py to create random reaction networks based on the defined final product.

  2. Analyze Assembly Process: Use 02_Assembly_Analysis_Autocatalytic_Set.py to analyze the generated networks and calculate assembly indices.

  3. Calculate Statistics: Execute 03_Autocatalysis_Statistics.py to compute statistical metrics from the assembly analysis results.

  4. Manipulate Results: Apply 04_manipulate_results_array.py to filter and refine the results data for detailed analysis.

  5. Generate Visualizations: Use 05a_line_plots.py and 05b_surface_plots.py to create line and surface plots for visual analysis of the results.

Results

All results, including generated reaction networks, analysis outputs, and visualizations, are saved in the assembly_analysis_results directory for easy access and further interpretation.

License

This project is licensed under the terms of the Creative Commons Attribution 4.0 International License (CC BY 4.0).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages