# jtleek/sva architecture

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

- Interactive diagram: https://gitdiagram.com/jtleek/sva
- Repository: https://github.com/jtleek/sva

## Overview

This is an R package centered on surrogate-variable analysis and related expression-data methods, with additional batch correction and statistical utilities. The file tree identifies these capabilities, but the README is empty and the only sampled source is `src/sva.c`; therefore the graph preserves the visible modules without guessing their call relationships. The sampled C routine computes a monotone version of an input vector; its R caller, if any, is not established here.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sva["Surrogate Variables"]
  node_sva["SVA<br/>[sva.R]"]
  node_svaseq["RNA-seq SVA<br/>[svaseq.R]"]
  node_fsva["Frozen SVA<br/>[fsva.R]"]
  node_psva["Probabilistic SVA<br/>[psva.R]"]
  node_ssva["Supervised SVA<br/>[ssva.R]"]
  node_numsv["SV Selection<br/>[num.sv.R]"]
  node_svacheck["SVA Checks<br/>[sva.check.R]"]
  node_twostep["Two-step Build<br/>[twostepsva.build.R]"]
  node_irw["Iterative Build<br/>[irwsva.build.R]"]
end

subgraph group_batch["Batch Correction"]
  node_combat["ComBat<br/>[ComBat.R]"]
  node_controls["Empirical Controls"]
end

subgraph group_stats["Statistical Utilities"]
  node_fstats["F Statistics<br/>[fstats.R]"]
  node_pvalue["F-test P-values<br/>[f.pvalue.R]"]
  node_helper["Shared Helpers<br/>[helper.R]"]
end

subgraph group_native["Native Code"]
  node_monotone["Monotone Transform<br/>[sva.c]"]
end

node_analyst(("R User"))

click node_sva "https://github.com/jtleek/sva/blob/master/R/sva.R"
click node_svaseq "https://github.com/jtleek/sva/blob/master/R/svaseq.R"
click node_fsva "https://github.com/jtleek/sva/blob/master/R/fsva.R"
click node_psva "https://github.com/jtleek/sva/blob/master/R/psva.R"
click node_ssva "https://github.com/jtleek/sva/blob/master/R/ssva.R"
click node_numsv "https://github.com/jtleek/sva/blob/master/R/num.sv.R"
click node_svacheck "https://github.com/jtleek/sva/blob/master/R/sva.check.R"
click node_twostep "https://github.com/jtleek/sva/blob/master/R/twostepsva.build.R"
click node_irw "https://github.com/jtleek/sva/blob/master/R/irwsva.build.R"
click node_combat "https://github.com/jtleek/sva/blob/master/R/ComBat.R"
click node_controls "https://github.com/jtleek/sva/blob/master/R/empirical.controls.R"
click node_fstats "https://github.com/jtleek/sva/blob/master/R/fstats.R"
click node_pvalue "https://github.com/jtleek/sva/blob/master/R/f.pvalue.R"
click node_helper "https://github.com/jtleek/sva/blob/master/R/helper.R"
click node_monotone "https://github.com/jtleek/sva/blob/master/src/sva.c"

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_sva,node_svaseq,node_fsva,node_psva,node_ssva,node_numsv,node_svacheck,node_twostep,node_irw,node_analyst toneBlue
class node_combat,node_controls toneAmber
class node_fstats,node_pvalue,node_helper toneMint
class node_monotone toneRose
```

## Components

### Surrogate Variables

- [SVA](https://github.com/jtleek/sva/blob/master/R/sva.R): `R/sva.R`
- [RNA-seq SVA](https://github.com/jtleek/sva/blob/master/R/svaseq.R): `R/svaseq.R`
- [Frozen SVA](https://github.com/jtleek/sva/blob/master/R/fsva.R): `R/fsva.R`
- [Probabilistic SVA](https://github.com/jtleek/sva/blob/master/R/psva.R): `R/psva.R`
- [Supervised SVA](https://github.com/jtleek/sva/blob/master/R/ssva.R): `R/ssva.R`
- [SV Selection](https://github.com/jtleek/sva/blob/master/R/num.sv.R): `R/num.sv.R`
- [SVA Checks](https://github.com/jtleek/sva/blob/master/R/sva.check.R): `R/sva.check.R`
- [Two-step Build](https://github.com/jtleek/sva/blob/master/R/twostepsva.build.R): `R/twostepsva.build.R`
- [Iterative Build](https://github.com/jtleek/sva/blob/master/R/irwsva.build.R): `R/irwsva.build.R`

### Batch Correction

- [ComBat](https://github.com/jtleek/sva/blob/master/R/ComBat.R): `R/ComBat.R`
- [Empirical Controls](https://github.com/jtleek/sva/blob/master/R/empirical.controls.R): `R/empirical.controls.R`

### Statistical Utilities

- [F Statistics](https://github.com/jtleek/sva/blob/master/R/fstats.R): `R/fstats.R`
- [F-test P-values](https://github.com/jtleek/sva/blob/master/R/f.pvalue.R): `R/f.pvalue.R`
- [Shared Helpers](https://github.com/jtleek/sva/blob/master/R/helper.R): `R/helper.R`

### Native Code

- [Monotone Transform](https://github.com/jtleek/sva/blob/master/src/sva.c): `src/sva.c`

### Other components

- **R User**
