# angusketo/pericyclictl architecture

> Architecture diagram of the GitHub repository angusketo/pericyclictl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/angusketo/pericyclictl
- Repository: https://github.com/angusketo/pericyclictl

## Overview

##### Project type and purpose
- This is not a web app or microservice; it’s a data‐generation and processing pipeline built as a collection of Jupyter notebooks.

##### File structure
- Extract_Cope_and_Claisen.ipynb, Extract_Ene.ipynb, Extract_Nazarov.ipynb
– Each notebook is one pipeline “stage” dedicated to a reaction type.
- Show_Prediction_Results.ipynb
– A visualization or reporting notebook to display or validate the extracted data.
- nerfenv.yml
– The Conda environment specification listing RDKit (2020.09.1 or later), RXNMapper, and other Python dependencies.
- README.md
– High‐level overview, prerequisites (Reaxys CSV), external links (DA_DataExtraction, RXNMapper), notes on SMILES canonicalization changes.

##### README for additional insights
- Confirms that inputs are externally sourced CSVs from Reaxys.
- Emphasizes dependency on RDKit version and optional use of RXNMapper.
- Mentions that Diels–Alder is out of scope (linked externally).

a. Main components
1. External Data Source
- Reaxys database (subscription) → raw CSV export
2. Local Data Store
- Folder with downloaded .csv files
3. Conda Environment Container
- nerfenv.yml defining RDKit, RXNMapper, Python, etc.
4. Notebook Stages
- “Extract_Cope_and_Claisen”
- “Extract_Ene”
- “Extract_Nazarov”
5. Atom‐Mapping Service (Optional)
- RXNMapper API or local invocation
6. Output Store
- Processed CSVs, pickles, RDKit‐normalized SMILES
7. Reporting/Visualization
- “Show_Prediction_Results.ipynb”

b. Relationships and interactions
- Extraction notebooks output to the Output Store
- Show_Prediction_Results reads from Output Store and generates visualizations

c. Architectural patterns and principles
- Linear or branching data pipeline: raw → processed → visualized
- Environment as code: clear separation of runtime dependencies via nerfenv.yml
- Modular stages (one notebook per reaction type) to isolate concerns

d. Key technologies and frameworks
- Jupyter Notebooks (pipeline orchestration)
- RDKit for cheminformatics and SMILES canonicalization
- RXNMapper for atom mapping
- Conda (environment reproducibility)

##### Detail without overthinking
- Every notebook as a distinct component.
- Both external inputs (Reaxys) and outputs (processed data, visual reports).
- Do not merge notebooks—you want clear separation so future contributors can see where to add new reaction‐type stages.

## Diagram (Mermaid)

```mermaid
graph TD
    Reaxys["Reaxys\nExternal Data Source"]:::external
    LocalStore["Local CSV Store"]:::datastore
    OutputStore["Output Store"]:::datastore
    RXNMapper["RXNMapper Service"]:::service
    README["README.md"]:::doc

    Reaxys -->|".csv"| LocalStore

    subgraph "Conda Environment Container"
        EnvConfig["nerfenv.yml"]:::config
        EC["Extract_Cope_and_Claisen.ipynb"]:::pipeline
        EN["Extract_Ene.ipynb"]:::pipeline
        NA["Extract_Nazarov.ipynb"]:::pipeline
        SR["Show_Prediction_Results.ipynb"]:::pipeline

        EnvConfig --> EC
        EnvConfig --> EN
        EnvConfig --> NA
        EnvConfig --> SR

        LocalStore --> EC
        LocalStore --> EN
        LocalStore --> NA

        EC -->|"processed data"| OutputStore
        EN -->|"processed data"| OutputStore
        NA -->|"processed data"| OutputStore

        EC -.->|optional atom mapping| RXNMapper
        EN -.->|optional atom mapping| RXNMapper
        NA -.->|optional atom mapping| RXNMapper

        OutputStore --> SR
    end

    click EnvConfig "https://github.com/angusketo/pericyclictl/blob/main/nerfenv.yml"
    click EC "https://github.com/angusketo/pericyclictl/blob/main/Extract_Cope_and_Claisen.ipynb"
    click EN "https://github.com/angusketo/pericyclictl/blob/main/Extract_Ene.ipynb"
    click NA "https://github.com/angusketo/pericyclictl/blob/main/Extract_Nazarov.ipynb"
    click SR "https://github.com/angusketo/pericyclictl/blob/main/Show_Prediction_Results.ipynb"
    click README "https://github.com/angusketo/pericyclictl/blob/main/README.md"

    classDef external fill:#BBDEFB,stroke:#0D47A1;
    classDef pipeline fill:#C8E6C9,stroke:#2E7D32;
    classDef service fill:#FFE0B2,stroke:#EF6C00;
    classDef datastore fill:#FFF9C4,stroke:#F9A825;
    classDef config fill:#E1BEE7,stroke:#6A1B9A;
    classDef doc fill:#E0F7FA,stroke:#006064;
```
