# jlaffy/scalop architecture

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

- Interactive diagram: https://gitdiagram.com/jlaffy/scalop
- Repository: https://github.com/jlaffy/scalop

## Overview

Scalop is an R bioinformatics package for gene-expression and tumour-program analysis. Its apparent workflow is to provide expression data, analyze differential expression or signatures, and inspect results; the file tree also indicates single-cell analysis, gene annotation, and visualization capabilities. The README is empty, and the sampled source does not establish how these R-level features are wired together, so those relationships are omitted. The native distance routine’s registration is directly visible; other edges are left unclaimed rather than inferred from filenames.

Main entry points: [`src/nd.c`](https://github.com/jlaffy/scalop/blob/master/src/nd.c) (Weighted distances), [`src/init.c`](https://github.com/jlaffy/scalop/blob/master/src/init.c) (Native registration), [`R/dea.R`](https://github.com/jlaffy/scalop/blob/master/R/dea.R) (Differential expression), [`src/scalop.h`](https://github.com/jlaffy/scalop/blob/master/src/scalop.h) (Distance interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Expression analysis"]
  node_dea["Differential expression<br/>[dea.R]"]
  node_stats["Expression statistics<br/>[all-stats.R]"]
  node_normalization["Expression transforms<br/>[cpm.R]"]
end

subgraph group_programs["Signatures and states"]
  node_signatures["Gene signatures<br/>[get_signatures.R]"]
  node_scoring["Signature scoring<br/>[score.R]"]
  node_programs["Tumour programs<br/>[programs.R]"]
  node_states["Tumour states"]
  node_statefractions["State fractions<br/>[state_fractions.R]"]
end

subgraph group_singlecell["Single-cell analysis"]
  node_scdata["Single-cell data<br/>[scdata.R]"]
  node_qc["Single-cell QC<br/>[ohmyqc.R]"]
  node_clustering["Cell clustering<br/>[ohmySNNclusters.R]"]
  node_embedding["Cell embedding<br/>[ohmytsne.R]"]
end

subgraph group_support["Annotation and visualization"]
  node_geneannotation["Gene annotation<br/>[annomap.R]"]
  node_plots["Analysis plots<br/>[ggvolcano.R]"]
end

subgraph group_native["Native routines"]
  node_distance["Weighted distances<br/>[nd.c]"]
  node_nativeinterface["Distance interface<br/>[scalop.h]"]
  node_registration["Native registration<br/>[init.c]"]
  node_rowttests["Row/column t-tests<br/>[rowttests.c]"]
end

node_user(("R user"))

node_user -.->|"invokes"| node_dea
node_registration -->|"registers"| node_distance
node_distance -->|"declares interface"| node_nativeinterface

click node_dea "https://github.com/jlaffy/scalop/blob/master/R/dea.R"
click node_stats "https://github.com/jlaffy/scalop/blob/master/R/all-stats.R"
click node_normalization "https://github.com/jlaffy/scalop/blob/master/R/cpm.R"
click node_signatures "https://github.com/jlaffy/scalop/blob/master/R/get_signatures.R"
click node_scoring "https://github.com/jlaffy/scalop/blob/master/R/score.R"
click node_programs "https://github.com/jlaffy/scalop/blob/master/R/programs.R"
click node_states "https://github.com/jlaffy/scalop/blob/master/R/assign_bulk_states.R"
click node_statefractions "https://github.com/jlaffy/scalop/blob/master/R/state_fractions.R"
click node_scdata "https://github.com/jlaffy/scalop/blob/master/R/scdata.R"
click node_qc "https://github.com/jlaffy/scalop/blob/master/R/ohmyqc.R"
click node_clustering "https://github.com/jlaffy/scalop/blob/master/R/ohmySNNclusters.R"
click node_embedding "https://github.com/jlaffy/scalop/blob/master/R/ohmytsne.R"
click node_geneannotation "https://github.com/jlaffy/scalop/blob/master/R/annomap.R"
click node_plots "https://github.com/jlaffy/scalop/blob/master/R/ggvolcano.R"
click node_distance "https://github.com/jlaffy/scalop/blob/master/src/nd.c"
click node_nativeinterface "https://github.com/jlaffy/scalop/blob/master/src/scalop.h"
click node_registration "https://github.com/jlaffy/scalop/blob/master/src/init.c"
click node_rowttests "https://github.com/jlaffy/scalop/blob/master/src/rowttests.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_dea,node_stats,node_normalization,node_user toneBlue
class node_signatures,node_scoring,node_programs,node_states,node_statefractions toneAmber
class node_scdata,node_qc,node_clustering,node_embedding toneMint
class node_geneannotation,node_plots toneRose
class node_distance,node_nativeinterface,node_registration,node_rowttests toneIndigo
```

## Components

### Expression analysis

- [Differential expression](https://github.com/jlaffy/scalop/blob/master/R/dea.R): `R/dea.R`
- [Expression statistics](https://github.com/jlaffy/scalop/blob/master/R/all-stats.R): `R/all-stats.R`
- [Expression transforms](https://github.com/jlaffy/scalop/blob/master/R/cpm.R): `R/cpm.R`

### Signatures and states

- [Gene signatures](https://github.com/jlaffy/scalop/blob/master/R/get_signatures.R): `R/get_signatures.R`
- [Signature scoring](https://github.com/jlaffy/scalop/blob/master/R/score.R): `R/score.R`
- [Tumour programs](https://github.com/jlaffy/scalop/blob/master/R/programs.R): `R/programs.R`
- [Tumour states](https://github.com/jlaffy/scalop/blob/master/R/assign_bulk_states.R): `R/assign_bulk_states.R`
- [State fractions](https://github.com/jlaffy/scalop/blob/master/R/state_fractions.R): `R/state_fractions.R`

### Single-cell analysis

- [Single-cell data](https://github.com/jlaffy/scalop/blob/master/R/scdata.R): `R/scdata.R`
- [Single-cell QC](https://github.com/jlaffy/scalop/blob/master/R/ohmyqc.R): `R/ohmyqc.R`
- [Cell clustering](https://github.com/jlaffy/scalop/blob/master/R/ohmySNNclusters.R): `R/ohmySNNclusters.R`
- [Cell embedding](https://github.com/jlaffy/scalop/blob/master/R/ohmytsne.R): `R/ohmytsne.R`

### Annotation and visualization

- [Gene annotation](https://github.com/jlaffy/scalop/blob/master/R/annomap.R): `R/annomap.R`
- [Analysis plots](https://github.com/jlaffy/scalop/blob/master/R/ggvolcano.R): `R/ggvolcano.R`

### Native routines

- [Weighted distances](https://github.com/jlaffy/scalop/blob/master/src/nd.c): `src/nd.c`
- [Distance interface](https://github.com/jlaffy/scalop/blob/master/src/scalop.h): `src/scalop.h`
- [Native registration](https://github.com/jlaffy/scalop/blob/master/src/init.c): `src/init.c`
- [Row/column t-tests](https://github.com/jlaffy/scalop/blob/master/src/rowttests.c): `src/rowttests.c`

### Other components

- **R user**

## Connections

- R user → Differential expression: invokes
- Native registration → Weighted distances: registers (evidence: `src/init.c`)
- Weighted distances → Distance interface: declares interface (evidence: `src/nd.c`)
