# rakabari/genexus_opa architecture

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

- Interactive diagram: https://gitdiagram.com/rakabari/genexus_opa
- Repository: https://github.com/rakabari/genexus_opa

## Overview

This repository automates creation of Golden Helix VarSeq projects from prepared Genexus OPA sequencing runs. The workflow discovers eligible runs, matches manifests, updates SampleCatalog, then creates one project per compressed VCF, imports sample metadata and BAM paths, and runs cancer evaluation. The evaluation imports variants, removes negative findings, and corrects Genexus depth/VAF values. Run discovery and project execution are implemented in workflow_utils.py; the README documents additional workflow behavior. The workflow YAML files and template are present in the tree but were not sampled, so their internal relationships are not mapped.

Main entry points: [`create_project.py`](https://github.com/rakabari/genexus_opa/blob/main/create_project.py) (Run coordinator), [`workflow_utils.py`](https://github.com/rakabari/genexus_opa/blob/main/workflow_utils.py) (VSPipeline execution), [`js_scripts/upstate_import_variants_to_eval/script_cancer.js`](https://github.com/rakabari/genexus_opa/blob/main/js_scripts/upstate_import_variants_to_eval/script_cancer.js) (Evaluation creation), [`process_manifest.py`](https://github.com/rakabari/genexus_opa/blob/main/process_manifest.py) (Manifest matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Workflow orchestration"]
  node_create_project["Run coordinator<br/>[create_project.py]"]
  node_runtime_config["Runtime paths<br/>[config.py]"]
end

subgraph group_catalog["Manifest and catalog"]
  node_manifest_match["Manifest matching"]
end

subgraph group_projects["Project processing"]
  node_run_discovery["Run and VCF discovery<br/>[workflow_utils.py]"]
  node_project_runner["VSPipeline execution<br/>[workflow_utils.py]"]
  node_project_import["VCF and metadata import<br/>[workflow_utils.py]"]
  node_success_check["Completion check<br/>[workflow_utils.py]"]
end

subgraph group_evaluation["Cancer evaluation"]
  node_evaluation_script["Evaluation creation<br/>[script_cancer.js]"]
  node_depth_script["Genexus depth and VAF<br/>[script_cancer.js]"]
  node_af_script["Alternate depth and AF"]
end

node_operator(("Workflow operator"))
node_run_data["Prepared run data"]
node_manifests["Sample manifests"]
node_project_output[("VarSeq project output")]
node_catalog_service[("SampleCatalog")]
node_vspipeline["VSPipeline"]
node_varseq_api["VarSeq evaluation APIs"]

node_operator -->|"starts workflow"| node_create_project
node_create_project -->|"reads paths"| node_runtime_config
node_create_project -->|"discovers runs"| node_run_discovery
node_run_data -->|"provides run files"| node_run_discovery
node_create_project -->|"processes manifest"| node_manifest_match
node_manifests -->|"provides rows"| node_manifest_match
node_manifest_match -->|"upserts samples"| node_catalog_service
node_create_project -->|"processes each VCF"| node_project_runner
node_project_runner -->|"runs commands"| node_vspipeline
node_project_runner -->|"imports VCF and metadata"| node_project_import
node_project_import -->|"creates project"| node_project_output
node_project_runner -->|"runs workflow script"| node_evaluation_script
node_evaluation_script -->|"creates and edits evaluation"| node_varseq_api
node_evaluation_script -->|"runs custom script"| node_depth_script
node_depth_script -->|"reads variant fields"| node_varseq_api
node_af_script -->|"updates depth and AF"| node_varseq_api
node_project_runner -->|"checks completion"| node_success_check
node_success_check -->|"checks task logs"| node_project_output

click node_create_project "https://github.com/rakabari/genexus_opa/blob/main/create_project.py"
click node_runtime_config "https://github.com/rakabari/genexus_opa/blob/main/config.py"
click node_run_discovery "https://github.com/rakabari/genexus_opa/blob/main/workflow_utils.py"
click node_project_runner "https://github.com/rakabari/genexus_opa/blob/main/workflow_utils.py"
click node_manifest_match "https://github.com/rakabari/genexus_opa/blob/main/process_manifest.py"
click node_project_import "https://github.com/rakabari/genexus_opa/blob/main/workflow_utils.py"
click node_success_check "https://github.com/rakabari/genexus_opa/blob/main/workflow_utils.py"
click node_evaluation_script "https://github.com/rakabari/genexus_opa/blob/main/js_scripts/upstate_import_variants_to_eval/script_cancer.js"
click node_depth_script "https://github.com/rakabari/genexus_opa/blob/main/js_scripts/upstate_genexus_dp_af/script_cancer.js"
click node_af_script "https://github.com/rakabari/genexus_opa/blob/main/js_scripts/upstate_genexus_dp_af/script_cancer_af.js"

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_create_project,node_runtime_config toneBlue
class node_manifest_match,node_project_output,node_catalog_service toneAmber
class node_run_discovery,node_project_runner,node_project_import,node_success_check,node_varseq_api toneMint
class node_evaluation_script,node_depth_script,node_af_script toneRose
class node_operator,node_run_data,node_manifests,node_vspipeline toneIndigo
```

## Components

### Workflow orchestration

- [Run coordinator](https://github.com/rakabari/genexus_opa/blob/main/create_project.py): `create_project.py`
- [Runtime paths](https://github.com/rakabari/genexus_opa/blob/main/config.py): `config.py`

### Manifest and catalog

- [Manifest matching](https://github.com/rakabari/genexus_opa/blob/main/process_manifest.py): `process_manifest.py`

### Project processing

- [Run and VCF discovery](https://github.com/rakabari/genexus_opa/blob/main/workflow_utils.py): `workflow_utils.py`
- [VSPipeline execution](https://github.com/rakabari/genexus_opa/blob/main/workflow_utils.py): `workflow_utils.py`
- [VCF and metadata import](https://github.com/rakabari/genexus_opa/blob/main/workflow_utils.py): `workflow_utils.py`
- [Completion check](https://github.com/rakabari/genexus_opa/blob/main/workflow_utils.py): `workflow_utils.py`

### Cancer evaluation

- [Evaluation creation](https://github.com/rakabari/genexus_opa/blob/main/js_scripts/upstate_import_variants_to_eval/script_cancer.js): `js_scripts/upstate_import_variants_to_eval/script_cancer.js`
- [Genexus depth and VAF](https://github.com/rakabari/genexus_opa/blob/main/js_scripts/upstate_genexus_dp_af/script_cancer.js): `js_scripts/upstate_genexus_dp_af/script_cancer.js`
- [Alternate depth and AF](https://github.com/rakabari/genexus_opa/blob/main/js_scripts/upstate_genexus_dp_af/script_cancer_af.js): `js_scripts/upstate_genexus_dp_af/script_cancer_af.js`

### Other components

- **Workflow operator**
- **Prepared run data**
- **Sample manifests**
- **VarSeq project output**
- **SampleCatalog**
- **VSPipeline**
- **VarSeq evaluation APIs**

## Connections

- Workflow operator → Run coordinator: starts workflow (evidence: `README.md`)
- Run coordinator → Runtime paths: reads paths (evidence: `create_project.py`)
- Run coordinator → Run and VCF discovery: discovers runs (evidence: `create_project.py`)
- Prepared run data → Run and VCF discovery: provides run files (evidence: `README.md`)
- Run coordinator → Manifest matching: processes manifest (evidence: `create_project.py`)
- Sample manifests → Manifest matching: provides rows (evidence: `README.md`)
- Manifest matching → SampleCatalog: upserts samples (evidence: `process_manifest.py`)
- Run coordinator → VSPipeline execution: processes each VCF (evidence: `create_project.py`)
- VSPipeline execution → VSPipeline: runs commands (evidence: `workflow_utils.py`)
- VSPipeline execution → VCF and metadata import: imports VCF and metadata (evidence: `workflow_utils.py`)
- VCF and metadata import → VarSeq project output: creates project (evidence: `README.md`)
- VSPipeline execution → Evaluation creation: runs workflow script (evidence: `workflow_utils.py`)
- Evaluation creation → VarSeq evaluation APIs: creates and edits evaluation (evidence: `js_scripts/upstate_import_variants_to_eval/script_cancer.js`)
- Evaluation creation → Genexus depth and VAF: runs custom script (evidence: `js_scripts/upstate_import_variants_to_eval/script_cancer.js`)
- Genexus depth and VAF → VarSeq evaluation APIs: reads variant fields (evidence: `js_scripts/upstate_genexus_dp_af/script_cancer.js`)
- Alternate depth and AF → VarSeq evaluation APIs: updates depth and AF (evidence: `js_scripts/upstate_genexus_dp_af/script_cancer_af.js`)
- VSPipeline execution → Completion check: checks completion (evidence: `README.md`)
- Completion check → VarSeq project output: checks task logs (evidence: `workflow_utils.py`)
