# praneeth728/megad architecture

> Architecture diagram of the GitHub repository praneeth728/megad, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/praneeth728/megad
- Repository: https://github.com/praneeth728/megad

## Overview

MegaD is a Python tool for training deep neural networks on metagenomic taxonomic profiles and predicting disease labels. The main workflow accepts an abundance table and metadata, processes features, trains and evaluates a classifier, saves its parameters, and can predict labels for an unknown profile. Documented options include taxonomic-level selection, thresholding, normalization, randomized grid search, and ROC reporting. The source excerpts show the processing and model implementation; prediction and some reporting details are documented in the README but not fully sampled.

Main entry points: [`Scripts/DNN.py`](https://github.com/praneeth728/megad/blob/master/Scripts/DNN.py) (Training Workflow), [`Scripts/DataProcessing.py`](https://github.com/praneeth728/megad/blob/master/Scripts/DataProcessing.py) (Feature Processing), [`Scripts/neuralnet.py`](https://github.com/praneeth728/megad/blob/master/Scripts/neuralnet.py) (Neural Network)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input Processing"]
  node_abundance["Abundance Table"]
  node_metadata["Sample Metadata"]
  node_processing["Feature Processing<br/>[DataProcessing.py]"]
  node_unknown_profile["Unknown Profile"]
end

subgraph group_learning["Model Training"]
  node_training["Training Workflow<br/>[DNN.py]"]
  node_classifier["Neural Network<br/>[neuralnet.py]"]
end

subgraph group_results["Evaluation and Prediction"]
  node_evaluation["Model Evaluation<br/>[DNN.py]"]
  node_saved_model["Saved Model"]
  node_prediction["Label Prediction<br/>[DNN.py]"]
  node_roc["ROC Curve<br/>[DNN.py]"]
end

node_analyst(("Researcher"))

node_analyst -->|"provides"| node_abundance
node_analyst -->|"provides"| node_metadata
node_training -->|"processes inputs"| node_processing
node_abundance -->|"reads"| node_processing
node_metadata -->|"reads"| node_processing
node_processing -.->|"returns features"| node_training
node_training -->|"constructs and trains"| node_classifier
node_training -->|"computes accuracy"| node_evaluation
node_training -->|"saves parameters"| node_saved_model
node_analyst -->|"provides"| node_unknown_profile
node_prediction -->|"runs inference"| node_classifier
node_prediction -->|"classifies"| node_unknown_profile
node_saved_model -.->|"loads for prediction"| node_prediction
node_training -.->|"generates"| node_roc

click node_processing "https://github.com/praneeth728/megad/blob/master/Scripts/DataProcessing.py"
click node_training "https://github.com/praneeth728/megad/blob/master/Scripts/DNN.py"
click node_classifier "https://github.com/praneeth728/megad/blob/master/Scripts/neuralnet.py"
click node_evaluation "https://github.com/praneeth728/megad/blob/master/Scripts/DNN.py"
click node_prediction "https://github.com/praneeth728/megad/blob/master/Scripts/DNN.py"
click node_roc "https://github.com/praneeth728/megad/blob/master/Scripts/DNN.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_abundance,node_metadata,node_processing,node_unknown_profile toneBlue
class node_training,node_classifier toneAmber
class node_evaluation,node_saved_model,node_prediction,node_roc toneMint
class node_analyst toneIndigo
```

## Components

### Input Processing

- **Abundance Table**
- **Sample Metadata**
- [Feature Processing](https://github.com/praneeth728/megad/blob/master/Scripts/DataProcessing.py): `Scripts/DataProcessing.py`
- **Unknown Profile**

### Model Training

- [Training Workflow](https://github.com/praneeth728/megad/blob/master/Scripts/DNN.py): `Scripts/DNN.py`
- [Neural Network](https://github.com/praneeth728/megad/blob/master/Scripts/neuralnet.py): `Scripts/neuralnet.py`

### Evaluation and Prediction

- [Model Evaluation](https://github.com/praneeth728/megad/blob/master/Scripts/DNN.py): `Scripts/DNN.py`
- **Saved Model**
- [Label Prediction](https://github.com/praneeth728/megad/blob/master/Scripts/DNN.py): `Scripts/DNN.py`
- [ROC Curve](https://github.com/praneeth728/megad/blob/master/Scripts/DNN.py): `Scripts/DNN.py`

### Other components

- **Researcher**

## Connections

- Researcher → Abundance Table: provides (evidence: `README.md`)
- Researcher → Sample Metadata: provides (evidence: `README.md`)
- Training Workflow → Feature Processing: processes inputs (evidence: `Scripts/DNN.py`)
- Abundance Table → Feature Processing: reads (evidence: `Scripts/DataProcessing.py`)
- Sample Metadata → Feature Processing: reads (evidence: `Scripts/DataProcessing.py`)
- Feature Processing → Training Workflow: returns features (evidence: `Scripts/DNN.py`)
- Training Workflow → Neural Network: constructs and trains (evidence: `Scripts/DNN.py`)
- Training Workflow → Model Evaluation: computes accuracy (evidence: `Scripts/DNN.py`)
- Training Workflow → Saved Model: saves parameters (evidence: `Scripts/DNN.py`)
- Researcher → Unknown Profile: provides (evidence: `README.md`)
- Label Prediction → Neural Network: runs inference (evidence: `Scripts/DNN.py`)
- Label Prediction → Unknown Profile: classifies (evidence: `README.md`)
- Saved Model → Label Prediction: loads for prediction
- Training Workflow → ROC Curve: generates (evidence: `README.md`)
