# giuntalab/gcp-centeny architecture

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

- Interactive diagram: https://gitdiagram.com/giuntalab/gcp-centeny
- Repository: https://github.com/giuntalab/gcp-centeny

## Overview

GCP is a command-line toolkit for profiling centromeric DNA. Its documented workflow searches a FASTA sequence for the CENP-B-box motif, then uses the resulting motif locations for centeny visualization or one of three annotation models. A separate reads-retrieval command takes read-level motif data and pattern counts to select chromosome-specific reads. The README documents these command relationships; source excerpts were unavailable, so internal call details beyond the CLI dispatch are not inferred.

Main entry points: [`R/GCP.R`](https://github.com/giuntalab/gcp-centeny/blob/main/R/GCP.R) (Command dispatcher), [`output/chr17.t2t-chm13-v2.0.fa_NTTCGNNNNANNCGGGN.bed`](https://github.com/giuntalab/gcp-centeny/blob/main/output/chr17.t2t-chm13-v2.0.fa_NTTCGNNNNANNCGGGN.bed) (Motif locations), [`R/fuzznuc.sh`](https://github.com/giuntalab/gcp-centeny/blob/main/R/fuzznuc.sh) (Motif search), [`R/centeny.R`](https://github.com/giuntalab/gcp-centeny/blob/main/R/centeny.R) (Centeny mapping)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI dispatch"]
  node_gcp["Command dispatcher<br/>[GCP.R]"]
end

subgraph group_motif["Motif processing"]
  node_fuzznuc["Motif search<br/>[fuzznuc.sh]"]
  node_motif_bed["Motif locations"]
  node_motif_lengths["Motif lengths"]
  node_centeny["Centeny mapping<br/>[centeny.R]"]
  node_centeny_out["Centeny annotations<br/>[centeny.bed]"]
end

subgraph group_annotation["Annotation models"]
  node_model1["Distance model<br/>[model1.R]"]
  node_model1_data["CHM13 distances<br/>[chm13_model1.txt]"]
  node_model1_out["Model 1 annotations<br/>[model1.bed]"]
  node_model2["Monomer model<br/>[model2.R]"]
  node_model2_data["Monomer reference<br/>[model2.txt]"]
  node_model2_out["Model 2 annotations<br/>[model2.bed]"]
  node_model3["K-pattern model<br/>[model3.R]"]
  node_model3_out["Model 3 annotations<br/>[model3.bed]"]
end

subgraph group_reads["Read retrieval"]
  node_reads_retrieval["Specific read retrieval<br/>[reads_retrieval.R]"]
  node_reads_input["Read motif data"]
  node_patterns["Pattern counts"]
  node_reads_out["Selected reads"]
end

node_user(("Analyst"))
node_fasta["Genome FASTA"]

node_user -->|"runs command"| node_gcp
node_gcp -->|"dispatches"| node_fuzznuc
node_gcp -->|"dispatches"| node_centeny
node_gcp -->|"dispatches"| node_model1
node_gcp -->|"dispatches"| node_model2
node_gcp -->|"dispatches"| node_model3
node_gcp -->|"dispatches"| node_reads_retrieval
node_fasta -->|"sequence input"| node_fuzznuc
node_fuzznuc -->|"writes locations"| node_motif_bed
node_fuzznuc -->|"writes lengths"| node_motif_lengths
node_motif_bed -->|"location input"| node_centeny
node_motif_lengths -->|"length input"| node_centeny
node_centeny -->|"writes annotations"| node_centeny_out
node_motif_bed -->|"location input"| node_model1
node_model1_data -->|"distance reference"| node_model1
node_model1 -->|"writes annotations"| node_model1_out
node_motif_bed -->|"location input"| node_model2
node_model2_data -->|"monomer reference"| node_model2
node_model2 -->|"writes annotations"| node_model2_out
node_motif_bed -->|"location input"| node_model3
node_model3 -->|"writes annotations"| node_model3_out
node_reads_input -->|"read input"| node_reads_retrieval
node_patterns -->|"pattern input"| node_reads_retrieval
node_reads_retrieval -->|"writes selected reads"| node_reads_out

click node_fasta "https://github.com/giuntalab/gcp-centeny/blob/main/test/chr17.t2t-chm13-v2.0.fa.gz"
click node_gcp "https://github.com/giuntalab/gcp-centeny/blob/main/R/GCP.R"
click node_fuzznuc "https://github.com/giuntalab/gcp-centeny/blob/main/R/fuzznuc.sh"
click node_motif_bed "https://github.com/giuntalab/gcp-centeny/blob/main/output/chr17.t2t-chm13-v2.0.fa_NTTCGNNNNANNCGGGN.bed"
click node_motif_lengths "https://github.com/giuntalab/gcp-centeny/blob/main/output/chr17.t2t-chm13-v2.0.fa_NTTCGNNNNANNCGGGN_length.tsv"
click node_centeny "https://github.com/giuntalab/gcp-centeny/blob/main/R/centeny.R"
click node_centeny_out "https://github.com/giuntalab/gcp-centeny/blob/main/output/centeny.bed"
click node_model1 "https://github.com/giuntalab/gcp-centeny/blob/main/R/model1.R"
click node_model1_data "https://github.com/giuntalab/gcp-centeny/blob/main/file/chm13_model1.txt"
click node_model1_out "https://github.com/giuntalab/gcp-centeny/blob/main/output/model1.bed"
click node_model2 "https://github.com/giuntalab/gcp-centeny/blob/main/R/model2.R"
click node_model2_data "https://github.com/giuntalab/gcp-centeny/blob/main/file/model2.txt"
click node_model2_out "https://github.com/giuntalab/gcp-centeny/blob/main/output/model2.bed"
click node_model3 "https://github.com/giuntalab/gcp-centeny/blob/main/R/model3.R"
click node_model3_out "https://github.com/giuntalab/gcp-centeny/blob/main/output/model3.bed"
click node_reads_retrieval "https://github.com/giuntalab/gcp-centeny/blob/main/R/reads_retrieval.R"
click node_reads_input "https://github.com/giuntalab/gcp-centeny/blob/main/test/ONT_100kb_2023_07_28_all_fasta_NTTCGNNNNANNCGGGN.bed"
click node_patterns "https://github.com/giuntalab/gcp-centeny/blob/main/output/pattern_counts_sliding1_k4.txt"
click node_reads_out "https://github.com/giuntalab/gcp-centeny/blob/main/output/chr17_specific_reads.txt"

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_gcp toneBlue
class node_fuzznuc,node_motif_bed,node_motif_lengths,node_centeny,node_centeny_out toneAmber
class node_model1,node_model1_data,node_model1_out,node_model2,node_model2_data,node_model2_out,node_model3,node_model3_out toneMint
class node_reads_retrieval,node_reads_input,node_patterns,node_reads_out toneRose
class node_user toneIndigo
class node_fasta toneTeal
```

## Components

### CLI dispatch

- [Command dispatcher](https://github.com/giuntalab/gcp-centeny/blob/main/R/GCP.R): `R/GCP.R`

### Motif processing

- [Motif search](https://github.com/giuntalab/gcp-centeny/blob/main/R/fuzznuc.sh): `R/fuzznuc.sh`
- [Motif locations](https://github.com/giuntalab/gcp-centeny/blob/main/output/chr17.t2t-chm13-v2.0.fa_NTTCGNNNNANNCGGGN.bed): `output/chr17.t2t-chm13-v2.0.fa_NTTCGNNNNANNCGGGN.bed`
- [Motif lengths](https://github.com/giuntalab/gcp-centeny/blob/main/output/chr17.t2t-chm13-v2.0.fa_NTTCGNNNNANNCGGGN_length.tsv): `output/chr17.t2t-chm13-v2.0.fa_NTTCGNNNNANNCGGGN_length.tsv`
- [Centeny mapping](https://github.com/giuntalab/gcp-centeny/blob/main/R/centeny.R): `R/centeny.R`
- [Centeny annotations](https://github.com/giuntalab/gcp-centeny/blob/main/output/centeny.bed): `output/centeny.bed`

### Annotation models

- [Distance model](https://github.com/giuntalab/gcp-centeny/blob/main/R/model1.R): `R/model1.R`
- [CHM13 distances](https://github.com/giuntalab/gcp-centeny/blob/main/file/chm13_model1.txt): `file/chm13_model1.txt`
- [Model 1 annotations](https://github.com/giuntalab/gcp-centeny/blob/main/output/model1.bed): `output/model1.bed`
- [Monomer model](https://github.com/giuntalab/gcp-centeny/blob/main/R/model2.R): `R/model2.R`
- [Monomer reference](https://github.com/giuntalab/gcp-centeny/blob/main/file/model2.txt): `file/model2.txt`
- [Model 2 annotations](https://github.com/giuntalab/gcp-centeny/blob/main/output/model2.bed): `output/model2.bed`
- [K-pattern model](https://github.com/giuntalab/gcp-centeny/blob/main/R/model3.R): `R/model3.R`
- [Model 3 annotations](https://github.com/giuntalab/gcp-centeny/blob/main/output/model3.bed): `output/model3.bed`

### Read retrieval

- [Specific read retrieval](https://github.com/giuntalab/gcp-centeny/blob/main/R/reads_retrieval.R): `R/reads_retrieval.R`
- [Read motif data](https://github.com/giuntalab/gcp-centeny/blob/main/test/ONT_100kb_2023_07_28_all_fasta_NTTCGNNNNANNCGGGN.bed): `test/ONT_100kb_2023_07_28_all_fasta_NTTCGNNNNANNCGGGN.bed`
- [Pattern counts](https://github.com/giuntalab/gcp-centeny/blob/main/output/pattern_counts_sliding1_k4.txt): `output/pattern_counts_sliding1_k4.txt`
- [Selected reads](https://github.com/giuntalab/gcp-centeny/blob/main/output/chr17_specific_reads.txt): `output/chr17_specific_reads.txt`

### Other components

- **Analyst**
- [Genome FASTA](https://github.com/giuntalab/gcp-centeny/blob/main/test/chr17.t2t-chm13-v2.0.fa.gz): `test/chr17.t2t-chm13-v2.0.fa.gz`

## Connections

- Analyst → Command dispatcher: runs command
- Command dispatcher → Motif search: dispatches
- Command dispatcher → Centeny mapping: dispatches
- Command dispatcher → Distance model: dispatches
- Command dispatcher → Monomer model: dispatches
- Command dispatcher → K-pattern model: dispatches
- Command dispatcher → Specific read retrieval: dispatches
- Genome FASTA → Motif search: sequence input
- Motif search → Motif locations: writes locations
- Motif search → Motif lengths: writes lengths
- Motif locations → Centeny mapping: location input
- Motif lengths → Centeny mapping: length input
- Centeny mapping → Centeny annotations: writes annotations
- Motif locations → Distance model: location input
- CHM13 distances → Distance model: distance reference
- Distance model → Model 1 annotations: writes annotations
- Motif locations → Monomer model: location input
- Monomer reference → Monomer model: monomer reference
- Monomer model → Model 2 annotations: writes annotations
- Motif locations → K-pattern model: location input
- K-pattern model → Model 3 annotations: writes annotations
- Read motif data → Specific read retrieval: read input
- Pattern counts → Specific read retrieval: pattern input
- Specific read retrieval → Selected reads: writes selected reads
