# tobjores/plantgrep architecture

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

- Interactive diagram: https://gitdiagram.com/tobjores/plantgrep
- Repository: https://github.com/tobjores/plantgrep

## Overview

This repository supports a plant-genome enhancer research workflow: processing sequencing and barcode data, annotating enhancer candidates, analyzing experimental results, and building predictive models. Researchers can also use the published plantGREP model through a CLI or Colab notebook for sequence-based predictions and interpretation. The README describes the broad analysis workflow; sampled training code shows the model architecture and training relationship. Other analysis and annotation connections are represented only where documented, since their source was not sampled.

Main entry points: [`code/analysis/analyze_and_export.R`](https://github.com/tobjores/plantgrep/blob/main/code/analysis/analyze_and_export.R) (Analysis and export), [`code/modelling/train_CNN_model.py`](https://github.com/tobjores/plantgrep/blob/main/code/modelling/train_CNN_model.py) (CNN training), [`data/CNN_model/plantGREP.pt`](https://github.com/tobjores/plantgrep/blob/main/data/CNN_model/plantGREP.pt) (PlantGREP model), [`code/barcode_extraction/extract_barcode.sh`](https://github.com/tobjores/plantgrep/blob/main/code/barcode_extraction/extract_barcode.sh) (Barcode extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiments["Experimental processing"]
  node_barcode["Barcode extraction<br/>[extract_barcode.sh]"]
  node_subassembly["Subassembly filtering"]
  node_barcode_counts["Count processing"]
end

subgraph group_annotation["Genome annotation"]
  node_annotation["Enhancer annotation<br/>[main_annotation.sh]"]
  node_annotation_steps["Annotation steps"]
end

subgraph group_analysis["Analysis and interpretation"]
  node_dual_luciferase["Luciferase processing"]
  node_analysis_export["Analysis and export"]
  node_model_data_export["Model data export"]
  node_validation["Sequence validation"]
end

subgraph group_models["Modeling and access"]
  node_training["CNN training<br/>[train_CNN_model.py]"]
  node_ensemble["Ensemble training"]
  node_architecture["BiDen architecture<br/>[BiDen.py]"]
  node_linear_models["Linear baselines<br/>[linear_models.py]"]
  node_attributions["DeepLIFT attributions"]
  node_motifs["Motif discovery<br/>[TF-MoDISco.py]"]
  node_evolution["Sequence evolution"]
  node_cli["plantGREP CLI<br/>[plantGREPcli.py]"]
  node_colab["Colab interface"]
  node_model["PlantGREP model<br/>[plantGREP.pt]"]
end

node_researcher(("Researcher"))
node_results["Research results"]

node_researcher -.->|"processes reads"| node_barcode
node_researcher -.->|"runs annotation"| node_annotation
node_researcher -->|"analyzes results"| node_analysis_export
node_researcher -->|"scores sequences"| node_cli
node_researcher -->|"uses notebook"| node_colab
node_barcode -.->|"filters assemblies"| node_subassembly
node_annotation -.->|"runs steps"| node_annotation_steps
node_barcode_counts -.->|"supports analysis"| node_analysis_export
node_dual_luciferase -.->|"supports analysis"| node_analysis_export
node_analysis_export -.->|"exports model data"| node_model_data_export
node_analysis_export -->|"generates figure data"| node_results
node_model_data_export -.->|"provides sequences"| node_training
node_training -->|"uses architecture"| node_architecture
node_ensemble -->|"uses architecture"| node_architecture
node_training -.->|"exports model"| node_model
node_model -.->|"scores sequences"| node_cli
node_model -.->|"serves predictions"| node_colab
node_attributions -->|"feeds attributions"| node_motifs
node_researcher -.->|"fits baselines"| node_linear_models
node_researcher -.->|"interprets predictions"| node_attributions
node_researcher -.->|"evolves sequences"| node_evolution
node_researcher -.->|"validates sequences"| node_validation

click node_barcode "https://github.com/tobjores/plantgrep/blob/main/code/barcode_extraction/extract_barcode.sh"
click node_subassembly "https://github.com/tobjores/plantgrep/tree/main/code/subassembly"
click node_barcode_counts "https://github.com/tobjores/plantgrep/blob/main/code/analysis/process_barcode_counts.R"
click node_annotation "https://github.com/tobjores/plantgrep/blob/main/code/annotation/main_annotation.sh"
click node_annotation_steps "https://github.com/tobjores/plantgrep/tree/main/code/annotation/subscripts"
click node_dual_luciferase "https://github.com/tobjores/plantgrep/blob/main/code/analysis/process_dual-luciferase.R"
click node_analysis_export "https://github.com/tobjores/plantgrep/blob/main/code/analysis/analyze_and_export.R"
click node_model_data_export "https://github.com/tobjores/plantgrep/blob/main/code/analysis/export_modelling_data.R"
click node_validation "https://github.com/tobjores/plantgrep/blob/main/code/analysis/validation_sequences.R"
click node_training "https://github.com/tobjores/plantgrep/blob/main/code/modelling/train_CNN_model.py"
click node_ensemble "https://github.com/tobjores/plantgrep/blob/main/code/modelling/train_CNN_ensemble.py"
click node_architecture "https://github.com/tobjores/plantgrep/blob/main/code/modelling/BiDen.py"
click node_linear_models "https://github.com/tobjores/plantgrep/blob/main/code/modelling/linear_models.py"
click node_attributions "https://github.com/tobjores/plantgrep/blob/main/code/modelling/DeepLIFT_attributions.py"
click node_motifs "https://github.com/tobjores/plantgrep/blob/main/code/modelling/TF-MoDISco.py"
click node_evolution "https://github.com/tobjores/plantgrep/blob/main/code/modelling/in-silico_evolution.py"
click node_cli "https://github.com/tobjores/plantgrep/blob/main/code/plantGREPcli/plantGREPcli.py"
click node_colab "https://github.com/tobjores/plantgrep/blob/main/code/plantGREPcolab/plantGREPcolab.ipynb"
click node_model "https://github.com/tobjores/plantgrep/blob/main/data/CNN_model/plantGREP.pt"

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_barcode,node_subassembly,node_barcode_counts toneBlue
class node_annotation,node_annotation_steps toneAmber
class node_dual_luciferase,node_analysis_export,node_model_data_export,node_validation toneMint
class node_training,node_ensemble,node_architecture,node_linear_models,node_attributions,node_motifs,node_evolution,node_cli,node_colab,node_model toneRose
class node_researcher,node_results toneIndigo
```

## Components

### Experimental processing

- [Barcode extraction](https://github.com/tobjores/plantgrep/blob/main/code/barcode_extraction/extract_barcode.sh): `code/barcode_extraction/extract_barcode.sh`
- [Subassembly filtering](https://github.com/tobjores/plantgrep/tree/main/code/subassembly): `code/subassembly`
- [Count processing](https://github.com/tobjores/plantgrep/blob/main/code/analysis/process_barcode_counts.R): `code/analysis/process_barcode_counts.R`

### Genome annotation

- [Enhancer annotation](https://github.com/tobjores/plantgrep/blob/main/code/annotation/main_annotation.sh): `code/annotation/main_annotation.sh`
- [Annotation steps](https://github.com/tobjores/plantgrep/tree/main/code/annotation/subscripts): `code/annotation/subscripts`

### Analysis and interpretation

- [Luciferase processing](https://github.com/tobjores/plantgrep/blob/main/code/analysis/process_dual-luciferase.R): `code/analysis/process_dual-luciferase.R`
- [Analysis and export](https://github.com/tobjores/plantgrep/blob/main/code/analysis/analyze_and_export.R): `code/analysis/analyze_and_export.R`
- [Model data export](https://github.com/tobjores/plantgrep/blob/main/code/analysis/export_modelling_data.R): `code/analysis/export_modelling_data.R`
- [Sequence validation](https://github.com/tobjores/plantgrep/blob/main/code/analysis/validation_sequences.R): `code/analysis/validation_sequences.R`

### Modeling and access

- [CNN training](https://github.com/tobjores/plantgrep/blob/main/code/modelling/train_CNN_model.py): `code/modelling/train_CNN_model.py`
- [Ensemble training](https://github.com/tobjores/plantgrep/blob/main/code/modelling/train_CNN_ensemble.py): `code/modelling/train_CNN_ensemble.py`
- [BiDen architecture](https://github.com/tobjores/plantgrep/blob/main/code/modelling/BiDen.py): `code/modelling/BiDen.py`
- [Linear baselines](https://github.com/tobjores/plantgrep/blob/main/code/modelling/linear_models.py): `code/modelling/linear_models.py`
- [DeepLIFT attributions](https://github.com/tobjores/plantgrep/blob/main/code/modelling/DeepLIFT_attributions.py): `code/modelling/DeepLIFT_attributions.py`
- [Motif discovery](https://github.com/tobjores/plantgrep/blob/main/code/modelling/TF-MoDISco.py): `code/modelling/TF-MoDISco.py`
- [Sequence evolution](https://github.com/tobjores/plantgrep/blob/main/code/modelling/in-silico_evolution.py): `code/modelling/in-silico_evolution.py`
- [plantGREP CLI](https://github.com/tobjores/plantgrep/blob/main/code/plantGREPcli/plantGREPcli.py): `code/plantGREPcli/plantGREPcli.py`
- [Colab interface](https://github.com/tobjores/plantgrep/blob/main/code/plantGREPcolab/plantGREPcolab.ipynb): `code/plantGREPcolab/plantGREPcolab.ipynb`
- [PlantGREP model](https://github.com/tobjores/plantgrep/blob/main/data/CNN_model/plantGREP.pt): `data/CNN_model/plantGREP.pt`

### Other components

- **Researcher**
- **Research results**

## Connections

- Researcher → Barcode extraction: processes reads
- Researcher → Enhancer annotation: runs annotation
- Researcher → Analysis and export: analyzes results (evidence: `README.md`)
- Researcher → plantGREP CLI: scores sequences (evidence: `README.md`)
- Researcher → Colab interface: uses notebook (evidence: `README.md`)
- Barcode extraction → Subassembly filtering: filters assemblies
- Enhancer annotation → Annotation steps: runs steps
- Count processing → Analysis and export: supports analysis
- Luciferase processing → Analysis and export: supports analysis
- Analysis and export → Model data export: exports model data
- Analysis and export → Research results: generates figure data (evidence: `README.md`)
- Model data export → CNN training: provides sequences
- CNN training → BiDen architecture: uses architecture (evidence: `code/modelling/train_CNN_model.py`)
- Ensemble training → BiDen architecture: uses architecture (evidence: `code/modelling/train_CNN_ensemble.py`)
- CNN training → PlantGREP model: exports model
- PlantGREP model → plantGREP CLI: scores sequences
- PlantGREP model → Colab interface: serves predictions (evidence: `README.md`)
- DeepLIFT attributions → Motif discovery: feeds attributions (evidence: `code/modelling/TF-MoDISco.py`)
- Researcher → Linear baselines: fits baselines
- Researcher → DeepLIFT attributions: interprets predictions
- Researcher → Sequence evolution: evolves sequences
- Researcher → Sequence validation: validates sequences
