# matheuscortez04/reposicionamento-farmacos-tdm-tb architecture

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

- Interactive diagram: https://gitdiagram.com/matheuscortez04/reposicionamento-farmacos-tdm-tb
- Repository: https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb

## Overview

PDPD is an interactive R application for network-based drug repurposing in major depressive disorder and bipolar disorder. The user enters through the console menu, then can generate PPI kernels, score and rank drugs against disease gene modules, validate rankings against RepoDB, enrich top candidates with OpenTargets clinical information, inspect disease-network components, and run biological enrichment analyses. The README documents these workflows, but no source excerpts were provided, so the graph follows documented relationships and does not infer unverified internal calls.

Main entry points: [`src/PDPD.R`](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/PDPD.R) (Console menus), [`src/Utils/drug.R`](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/drug.R) (Drug scoring and ranking), [`src/Utils/evaluation.R`](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/evaluation.R) (Ranking evaluation), [`src/Utils/enrichment.R`](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/enrichment.R) (Enrichment analyses)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app["Console menus<br/>[PDPD.R]"]
  node_utils["Shared utilities<br/>[utils.R]"]
end

subgraph group_network["Network analysis"]
  node_ppi["PPI network<br/>[PPI_gysi.csv]"]
  node_kernels["Kernel generation<br/>[kernels.R]"]
  node_graph["Disease graph metrics<br/>[graph_metrics.R]"]
end

subgraph group_ranking["Drug prioritization"]
  node_drugdata["Drug targets"]
  node_drug["Drug scoring and ranking<br/>[drug.R]"]
  node_diseasegenes["Disease gene associations<br/>[utils.R]"]
end

subgraph group_validation["Evaluation and evidence"]
  node_repodb_mdd["MDD RepoDB<br/>[MDD_REPODB.tsv]"]
  node_repodb_bd["Bipolar RepoDB<br/>[BIPOLAR_REPODB.tsv]"]
  node_evaluation["Ranking evaluation<br/>[evaluation.R]"]
  node_opentargets_client["OpenTargets client"]
end

subgraph group_biology["Biological interpretation"]
  node_enrichment["Enrichment analyses<br/>[enrichment.R]"]
end

node_user(("Analyst"))
node_opentargets{{"OpenTargets API"}}
node_enrichment_sources["Pathway gene sets"]

node_user -->|"selects menu"| node_app
node_app -->|"dispatches"| node_kernels
node_app -->|"dispatches"| node_drug
node_app -->|"dispatches"| node_evaluation
node_app -->|"dispatches"| node_graph
node_app -->|"dispatches"| node_enrichment
node_kernels -->|"reads network"| node_ppi
node_drug -->|"reads targets"| node_drugdata
node_drug -->|"uses kernels"| node_kernels
node_drug -->|"uses disease genes"| node_diseasegenes
node_graph -->|"reads network"| node_ppi
node_graph -->|"uses disease genes"| node_diseasegenes
node_evaluation -->|"validates MDD"| node_repodb_mdd
node_evaluation -->|"validates bipolar"| node_repodb_bd
node_evaluation -->|"requests candidate details"| node_opentargets_client
node_opentargets_client -.->|"queries GraphQL"| node_opentargets
node_enrichment -.->|"uses pathway sets"| node_enrichment_sources
node_enrichment -->|"uses disease genes"| node_diseasegenes
node_enrichment -->|"uses drug rankings"| node_drug

click node_app "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/PDPD.R"
click node_utils "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/utils.R"
click node_ppi "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Data/PPI_gysi.csv"
click node_kernels "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/kernels.R"
click node_graph "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/graph_metrics.R"
click node_drugdata "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Data/Drug/drug_targets_DrugBank_Gysi.csv"
click node_drug "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/drug.R"
click node_diseasegenes "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/utils.R"
click node_repodb_mdd "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Data/REPODB/MDD_REPODB.tsv"
click node_repodb_bd "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Data/REPODB/BIPOLAR_REPODB.tsv"
click node_evaluation "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/evaluation.R"
click node_opentargets_client "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/open_targets_requests.R"
click node_enrichment "https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/enrichment.R"

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_app,node_utils toneBlue
class node_ppi,node_kernels,node_graph toneAmber
class node_drugdata,node_drug,node_diseasegenes,node_opentargets toneMint
class node_repodb_mdd,node_repodb_bd,node_evaluation,node_opentargets_client toneRose
class node_enrichment,node_user,node_enrichment_sources toneIndigo
```

## Components

### Application entry

- [Console menus](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/PDPD.R): `src/PDPD.R`
- [Shared utilities](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/utils.R): `src/Utils/utils.R`

### Network analysis

- [PPI network](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Data/PPI_gysi.csv): `src/Data/PPI_gysi.csv`
- [Kernel generation](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/kernels.R): `src/Utils/kernels.R`
- [Disease graph metrics](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/graph_metrics.R): `src/Utils/graph_metrics.R`

### Drug prioritization

- [Drug targets](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Data/Drug/drug_targets_DrugBank_Gysi.csv): `src/Data/Drug/drug_targets_DrugBank_Gysi.csv`
- [Drug scoring and ranking](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/drug.R): `src/Utils/drug.R`
- [Disease gene associations](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/utils.R): `src/Utils/utils.R`

### Evaluation and evidence

- [MDD RepoDB](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Data/REPODB/MDD_REPODB.tsv): `src/Data/REPODB/MDD_REPODB.tsv`
- [Bipolar RepoDB](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Data/REPODB/BIPOLAR_REPODB.tsv): `src/Data/REPODB/BIPOLAR_REPODB.tsv`
- [Ranking evaluation](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/evaluation.R): `src/Utils/evaluation.R`
- [OpenTargets client](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/open_targets_requests.R): `src/Utils/open_targets_requests.R`

### Biological interpretation

- [Enrichment analyses](https://github.com/matheuscortez04/reposicionamento-farmacos-tdm-tb/blob/main/src/Utils/enrichment.R): `src/Utils/enrichment.R`

### Other components

- **Analyst**
- **OpenTargets API**
- **Pathway gene sets**

## Connections

- Analyst → Console menus: selects menu
- Console menus → Kernel generation: dispatches
- Console menus → Drug scoring and ranking: dispatches
- Console menus → Ranking evaluation: dispatches
- Console menus → Disease graph metrics: dispatches
- Console menus → Enrichment analyses: dispatches
- Kernel generation → PPI network: reads network
- Drug scoring and ranking → Drug targets: reads targets
- Drug scoring and ranking → Kernel generation: uses kernels
- Drug scoring and ranking → Disease gene associations: uses disease genes
- Disease graph metrics → PPI network: reads network
- Disease graph metrics → Disease gene associations: uses disease genes
- Ranking evaluation → MDD RepoDB: validates MDD
- Ranking evaluation → Bipolar RepoDB: validates bipolar
- Ranking evaluation → OpenTargets client: requests candidate details
- OpenTargets client → OpenTargets API: queries GraphQL
- Enrichment analyses → Pathway gene sets: uses pathway sets
- Enrichment analyses → Disease gene associations: uses disease genes
- Enrichment analyses → Drug scoring and ranking: uses drug rankings
