# gauravj49/gjutilities architecture

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

- Interactive diagram: https://gitdiagram.com/gauravj49/gjutilities
- Repository: https://github.com/gauravj49/gjutilities

## Overview

##### Main Components
- Data Sources: Begin by denoting the input data (raw fastq files and any data files needed for the analysis) that feed into the system.
- Preprocessing Component: Show the “merge_illumina_samples.py” script which takes raw (unmerged) Illumina fastq files as input and produces merged fastq files.
- Analysis Components:
– “R_pairwise_correlation_heatmap.R” (if used) that likely generates heatmaps based on correlation analysis.
– “draw_combined_volcano_plots.py” which takes two input data files (for example, results from differential expression analysis) and produces a volcano plot.
- Template / Utility Script: “gjain_python_script_template.py” can be depicted as a base framework that outlines the argument parsing and structure for additional utility scripts.
- External Dependencies: Identify and include command line tools (bedtools, samtools, etc.) that these scripts are designed to wrap or interface with. They can be visualized as external modules or services linked to the respective script components.
- Output Components: Note the output directories or generated files (merged fastq files, diagnosis plots, output volcano plot files) as final endpoints of the processing flow.

##### Architectural Patterns and Design Principles
- Even though this is not an object-oriented service architecture, emphasize that the project follows a modular approach. Each script represents a self-contained module that can be run independently.
- The use of command line parameters (clearly outlined in each script’s usage instructions in the README) means that the design supports flexibility and reusability.
- External dependencies are decoupled – the scripts are wrappers around tools such as bedtools and samtools. This shows a layered design where the scripts create a higher-level abstraction over lower-level command line tools.

##### Incorporate Relevant Technologies and Frameworks
- Python is the main language for most scripts, and R for visualization (R_pairwise_correlation_heatmap.R).
- Command-line interface design (argument parsing) is a common theme. You might annotate that Python’s argparse module (or similar) is central to designing these utilities.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Data Sources
    subgraph "Data Sources"
        A["Raw fastq Files"]:::data
        B["Differential Expression Data"]:::data
    end

    %% Preprocessing Component
    subgraph "Preprocessing"
        C["Merge Illumina Samples (merge_illumina_samples.py)"]:::script
    end

    %% Analysis Components
    subgraph "Analysis: Visualization"
        D["Draw Combined Volcano Plots (draw_combined_volcano_plots.py)"]:::script
        E["R Pairwise Correlation Heatmap (R_pairwise_correlation_heatmap.R)"]:::script
    end

    %% Utility/Template Script
    subgraph "Utilities"
        F["Template Script (gjain_python_script_template.py)"]:::script
    end

    %% Output Components
    subgraph "Outputs"
        G["Merged fastq Files"]:::data
        H["Volcano Plot Output"]:::data
        I["Correlation Heatmap Output"]:::data
    end

    %% External Dependencies
    subgraph "External Dependencies"
        J["samtools"]:::external
        K["bedtools"]:::external
    end

    %% Data Flow
    A -->|"input"| C
    C -->|"merges to"| G
    B -->|"input"| D
    D -->|"generates"| H
    G -->|"processed data"| E
    E -->|"generates"| I

    %% External Tool Usage
    C -->|"uses"| J
    C -->|"uses"| K

    %% Click Events
    click C "https://github.com/gauravj49/gjutilities/blob/master/merge_illumina_samples.py"
    click D "https://github.com/gauravj49/gjutilities/blob/master/draw_combined_volcano_plots.py"
    click E "https://github.com/gauravj49/gjutilities/blob/master/R_pairwise_correlation_heatmap.R"
    click F "https://github.com/gauravj49/gjutilities/blob/master/gjain_python_script_template.py"

    %% Styles
    classDef data fill:#e3f2fd,stroke:#1e88e5,stroke-width:2px;
    classDef script fill:#ffecb3,stroke:#fbc02d,stroke-width:2px;
    classDef external fill:#c8e6c9,stroke:#388e3c,stroke-width:2px;
```
