diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..56be3a4
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,25 @@
+name: Figure renderer CI
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ circos-and-catalog:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.12"
+ - run: python -m pip install -r requirements.txt
+ - run: python -m unittest discover -s tests -v
+ - run: python scripts/test_catalog.py --out-dir /tmp/figstudio-catalog --limit 129
+ - run: >-
+ python scripts/figure_studio.py render --kind circos_lollipop_chord
+ --features examples/circos_v2/features.csv --links examples/circos_v2/links.csv
+ --sectors examples/circos_v2/sectors.csv --data-status demo --top-k 4 --width-mm 180
+ --formats pdf,svg,png --out /tmp/figstudio-circos/circos
+ - run: >-
+ python scripts/qc_figures.py /tmp/figstudio-circos
+ --output /tmp/figstudio-circos/qc.tsv --json /tmp/figstudio-circos/qc.json
diff --git a/README.md b/README.md
index dcc2e66..b697ee2 100644
--- a/README.md
+++ b/README.md
@@ -2,11 +2,11 @@
Scientific Figure Studio for high-impact biomedical and bioinformatics figures.
-FigStudio integrates evidence-first figure planning, 128+ plot recipes, AI-assisted mechanism schematic prompts, journal-ready export, and high-impact visual QC for Nature/Cell/Science-style workflows.
+FigStudio integrates evidence-first figure planning, 129 plot recipes, AI-assisted mechanism schematic prompts, journal-ready export, and high-impact visual QC for Nature/Cell/Science-style workflows.
## Included
-- 128 registered plot recipes across distributions, comparisons, associations, multivariate plots, matrices, networks, survival, genomics, spatial, and mechanism diagrams.
+- 129 registered plot recipes, including a data-driven `circos_lollipop_chord` composite.
- Vector-first PDF/SVG export plus RGB PNG/TIFF export with journal-oriented DPI checks.
- Pale accessible palettes, explicit figure contracts, source-data traceability, and claim-boundary review.
- AI image-generation guidance for text-free conceptual source assets; AI assets are never treated as quantitative evidence.
@@ -16,7 +16,8 @@ FigStudio integrates evidence-first figure planning, 128+ plot recipes, AI-assis
```bash
python scripts/figure_studio.py catalog
python scripts/figure_studio.py render --kind volcano_plot --out figure --seed 7
-python scripts/figure_studio.py contact-sheet --out catalog_preview --limit 128
+python scripts/figure_studio.py render --kind circos_lollipop_chord --features examples/circos_v2/features.csv --links examples/circos_v2/links.csv --sectors examples/circos_v2/sectors.csv --data-status demo --top-k 4 --width-mm 180 --formats pdf,svg,png --out results/circos_v2
+python scripts/figure_studio.py contact-sheet --out catalog_preview --limit 129
python scripts/qc_figures.py path/to/figures --output audit/figure_qc.tsv --json audit/figure_qc.json
```
@@ -27,3 +28,9 @@ python -m pip install -r requirements.txt
```
The governing workflow is documented in [`SKILL.md`](SKILL.md).
+
+The Circos example tables are synthetic test data only. They do not represent biological findings. The V2 recipe contract and link interpretation are documented in [`references/plot-catalog.md`](references/plot-catalog.md). Each render writes PDF/SVG/600 dpi PNG, normalized input snapshots, configuration, manifest, label-suppression table, and a QC report.
+
+
+
+[Target / failed V1 / rebuilt V2 visual comparison](gallery/circos_v2_comparison.png)
diff --git a/SKILL.md b/SKILL.md
index bfe1a25..a773f05 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -1,6 +1,6 @@
---
name: scientific-figure-studio
-description: Design, draw, export, and critically review traceable biomedical and bioinformatics figures for Nature/Cell/Science-style submission. Use for manuscript figures, mechanisms, graphical abstracts, multi-panel composites, journal TIFF/PDF/SVG export, AI-assisted conceptual schematics, or any request for publication-grade scientific plots. Includes a tested catalog of 128 plot recipes and a native Python renderer.
+description: Design, draw, export, and critically review traceable biomedical and bioinformatics figures for Nature/Cell/Science-style submission. Use for manuscript figures, mechanisms, graphical abstracts, multi-panel composites, journal TIFF/PDF/SVG export, AI-assisted conceptual schematics, or any request for publication-grade scientific plots. Includes a tested catalog of 129 plot recipes and a native Python renderer.
---
# Scientific Figure Studio
@@ -35,16 +35,19 @@ Use the reading order `context → focal result → orthogonal validation → bo
### 2. Select a plot recipe
-The bundled renderer exposes 128 registered recipes across distributions, comparisons, associations, multivariate views, matrices, networks/flows, temporal/survival analyses, genomics, spatial analysis, and mechanism diagrams. Inspect or render the catalog before inventing a new chart:
+The bundled renderer exposes 129 recipes across distributions, comparisons, associations, multivariate views, matrices, networks/flows, temporal/survival analyses, genomics, spatial analysis, and mechanism diagrams. Inspect or render the catalog before inventing a new chart:
```bash
python scripts/figure_studio.py catalog
python scripts/figure_studio.py render --kind volcano_plot --out figure --seed 7
-python scripts/figure_studio.py contact-sheet --out catalog_preview --limit 128
+python scripts/figure_studio.py render --kind circos_lollipop_chord --features examples/circos_v2/features.csv --links examples/circos_v2/links.csv --sectors examples/circos_v2/sectors.csv --data-status demo --top-k 4 --width-mm 180 --formats pdf,svg,png --out results/circos_v2
+python scripts/figure_studio.py contact-sheet --out catalog_preview --limit 129
```
Use the catalog as a starting point, not as a reason to force a template. Pass real source arrays through a native plotting script when the project provides them; demo data are only for smoke tests and examples.
+For `circos_lollipop_chord`, follow the feature-anchored V2 CSV contract in [references/plot-catalog.md](references/plot-catalog.md). Links represent feature-level associations and do not establish causality. Missing feature anchors fail validation; sector-center substitutions are prohibited. The example CSVs are synthetic placeholders, never biological findings. Export includes editable PDF/SVG, 600 dpi PNG, source CSV snapshots, YAML configuration, run manifest, suppressed-label table, metadata, and a QC report.
+
### 3. Apply the visual system
- Default dimensions: 89 mm single-column or 183 mm double-column; keep height ≤247 mm unless the target journal specifies otherwise.
@@ -65,6 +68,7 @@ Use the bundled renderer for deterministic demo assets and the project’s nativ
```bash
python scripts/figure_studio.py render --kind mechanism_schematic --out mechanism --formats pdf,svg,png,tiff
+python scripts/figure_studio.py render --kind circos_lollipop_chord --features examples/circos_v2/features.csv --links examples/circos_v2/links.csv --sectors examples/circos_v2/sectors.csv --data-status demo --top-k 4 --width-mm 180 --formats pdf,svg,png --out results/circos_v2
python scripts/qc_figures.py path/to/figures --output audit/figure_qc.tsv --json audit/figure_qc.json
```
@@ -86,7 +90,7 @@ Provide:
## Resource map
-- [references/plot-catalog.md](references/plot-catalog.md): 128 registered recipes and selection guidance.
+- [references/plot-catalog.md](references/plot-catalog.md): 129 registered recipes and selection guidance.
- [references/figure-contract.md](references/figure-contract.md): panel-level provenance and evidence-boundary template.
- [references/journal-export.md](references/journal-export.md): dimensions, typography, colour, raster/vector, and QC standards.
- `scripts/figure_studio.py`: catalog, deterministic rendering, mechanism fallback, export, and contact-sheet CLI.
diff --git a/docs/CIRCOS_V2_ACCEPTANCE_REPORT.md b/docs/CIRCOS_V2_ACCEPTANCE_REPORT.md
new file mode 100644
index 0000000..8227869
--- /dev/null
+++ b/docs/CIRCOS_V2_ACCEPTANCE_REPORT.md
@@ -0,0 +1,45 @@
+# Circos composite rebuild V2 acceptance report
+
+## Result
+
+The native feature-anchored Circos renderer is implemented in FigStudio and FigFrame. Reference screenshots were supplied in `/Users/mingsmacbook/Downloads/FIGSTUDIO_CIRCOS_VISUAL_REFERENCES.zip`; the target panel, failed V1 render, and rebuilt V2 render are compared in `gallery/circos_v2_comparison.png`.
+
+The included 12-sector, 240-feature tables and resulting figure are **synthetic demonstration data only**. The rendering workflow and geometric contract pass software acceptance; scientific acceptance on real data remains pending because no source study tables or evidence contract were supplied.
+
+## Acceptance checks
+
+| Area | Status | Evidence |
+|---|---|---|
+| Root-cause report | PASS | `docs/circos_v2_root_cause.md` records the V1 center-collapse, midpoint fallback, sparse synthetic inputs, excess bands, and unlabeled/signed score scale. |
+| Shared feature geometry | PASS | Seven geometry tests establish one feature angle reused for score points, label leaders, and chord endpoints. |
+| Open-center Bezier links | PASS | Cubic polar Beziers end at exact feature angles and shared inner score radius; tests assert every sampled curve remains above radius zero. Missing feature anchors fail validation. |
+| V2 source contract | PASS | `features.csv` includes per-sector feature IDs, score, direction, labels and optional evidence ranking columns. `links.csv` has explicit feature endpoints and foreign-key validation. Duplicate handling is deterministic and conflicts fail. |
+| Score semantics | PASS | Non-negative and signed maps are linear; signed baselines preserve the sign, and user scales reject overflow rather than clipping. Tick values and mapping are stated on-figure. |
+| Density / labels | PASS | Renderer cases cover six asymmetric sectors and twelve sectors with 240 features, sparse/dense links, long labels, rank prioritization, bbox collision/clipping suppression, and a suppression-reason CSV. |
+| Track styling | PASS | One pale sector band, a minimal score grid, semantic blue/coral/gray score markers, and neutral teal weighted links. No stack of decorative sector bands. |
+| Fixed-size exports | PASS | 90 mm: 2125×2125 RGB PNG at 600 dpi; 180 mm: 4251×4251 RGB PNG at 600 dpi. Each has PDF and SVG siblings. |
+| Reproducibility | PASS | Input snapshots, `.config.yaml`, `.manifest.json` with SHA-256 values, `.metadata.json`, `.suppressed_labels.csv`, and `.qc.json` are emitted per output stem. |
+| Real-data scientific validity | HOLD | Synthetic examples prove renderer behavior only. Replace all example inputs with source-traceable real data and confirm the score definition, direction semantics, link evidence, ranking, and manuscript claim before scientific interpretation. |
+
+## Reproduction and verification
+
+```bash
+python -m unittest discover -s tests -v
+python scripts/figure_studio.py render --kind circos_lollipop_chord \
+ --features examples/circos_v2/features.csv \
+ --links examples/circos_v2/links.csv \
+ --sectors examples/circos_v2/sectors.csv --data-status demo \
+ --top-k 4 --width-mm 90 --formats pdf,svg,png \
+ --out examples/circos_v2/circos_v2_90mm
+python scripts/figure_studio.py render --kind circos_lollipop_chord \
+ --features examples/circos_v2/features.csv \
+ --links examples/circos_v2/links.csv \
+ --sectors examples/circos_v2/sectors.csv --data-status demo \
+ --top-k 4 --width-mm 180 --formats pdf,svg,png \
+ --out examples/circos_v2/circos_v2_180mm
+python scripts/qc_figures.py examples/circos_v2 \
+ --output examples/circos_v2/figure_qc.tsv \
+ --json examples/circos_v2/figure_qc.json
+```
+
+The V1 examples and exports in `examples/circos/` remain intact as historical comparison inputs. The new renderer uses a separate `examples/circos_v2/` output stem.
diff --git a/docs/circos_v2_root_cause.md b/docs/circos_v2_root_cause.md
new file mode 100644
index 0000000..b975f3d
--- /dev/null
+++ b/docs/circos_v2_root_cause.md
@@ -0,0 +1,32 @@
+# Circos V2 root-cause report
+
+## Reproduction state
+
+- Repository: `mingeric/FigStudio`
+- Failed implementation commit: `f074cded14625ad352ec8cfa6501dbbc44492a36`
+- Recipe: `circos_lollipop_chord`
+- Reproduction command:
+
+```bash
+python scripts/figure_studio.py render --kind circos_lollipop_chord \
+ --scores examples/circos/gene_scores.csv --links examples/circos/links.csv \
+ --sectors examples/circos/sectors.csv --data-status demo \
+ --formats pdf,svg,png --out examples/circos/circos_lollipop_chord
+```
+
+The reference bundle supplied with V2 contains `01_TARGET_ORIGINAL_SCREENSHOT.jpg`, its cropped Circos panel `01_TARGET_CIRCOS_CROPPED.png` (945 × 875), and the failed rendering `02_FAILED_V1_OUTPUT.png` (1816 × 2048). The V1 repository preview is also 4104 × 4626 at 600 dpi.
+
+## Findings
+
+1. **The chord curve collapses to the origin.** `scripts/circos_recipe.py` computed `r(t) = (r_inner - 0.04) × (1 - sin(πt)^0.85)`. At `t=0.5`, the radius is exactly zero. Every edge therefore becomes a center-converging petal. Its endpoints are also fixed at the same inner radius, not at the plotted feature point.
+2. **Feature anchors silently fall back to sector centers.** `anchors.get((sector, feature), mids[sector])` accepts an absent feature and substitutes a sector midpoint. The old `links.csv` contract only carried one feature string, so mismatched or absent identifiers could still render without a diagnostic.
+3. **The output is sparse by contract and synthetic by construction.** The example contains six sectors × ten placeholder rows, while the renderer labels only four features per sector. Its scores follow a repeating modulo formula, and the old contract has no p-value/FDR/effect-size ranking. This explains the G01–G08-looking, repetitive annotation pattern; it is not real research data.
+4. **The track hierarchy is overbuilt.** Two adjacent annular bars (`bottom=.99,height=.10` and `bottom=.90,height=.07`) create stacked sector bands, followed by four regular unlabeled grid segments per sector. The extra band and fixed grid dominate the score marks instead of matching the single pale sector band and ranked score arc in the reference.
+5. **The score scale is not self-reading.** Grid arcs are fixed fractions, but no values are written at the ticks. Signed values are reduced to absolute deviations, so their sign is not represented by radius.
+6. **Label placement is decoupled from the feature order.** The score points use evenly spaced feature angles, while the chosen labels are moved to evenly spaced display slots. Leader lines connect the two, but there is no collision test or suppressed-label record.
+
+## V2 geometry constraints
+
+V2 tests must establish, before final exports, that each feature has one stable sector-local angle; score points and label leaders use that angle; every chord endpoint has radius `r_inner` and the exact named feature angle; and every sampled chord remains outside a non-zero open-center radius. Missing feature anchors must fail validation. Any aggregate link must be explicitly typed and reported.
+
+The V2 examples remain marked synthetic. The reference screenshot is a visual target only and is not treated as source data or evidence.
diff --git a/examples/circos/README.md b/examples/circos/README.md
new file mode 100644
index 0000000..c924782
--- /dev/null
+++ b/examples/circos/README.md
@@ -0,0 +1,3 @@
+# Synthetic Circos example data
+
+All rows in these CSV files are generated placeholders for software demonstration and test only. They are **not biological findings**, real cancer evidence, or causal relationships. The example links mean only synthetic shared-feature associations.
diff --git a/examples/circos/circos_lollipop_chord.metadata.json b/examples/circos/circos_lollipop_chord.metadata.json
new file mode 100644
index 0000000..be2d2c5
--- /dev/null
+++ b/examples/circos/circos_lollipop_chord.metadata.json
@@ -0,0 +1,29 @@
+{
+ "schema_version": "1.0",
+ "input_sha256": {
+ "examples/circos/gene_scores.csv": "156ad83ccf6fcc7d1123268e64143ce89f8968eb4aa80d7813ed2634b4027f67",
+ "examples/circos/links.csv": "80a60c2f165b0c52630faa02d811d0fdeacfde7d7f9700cb340241627cb317a5",
+ "examples/circos/sectors.csv": "ed64c28885a157782a6585ece0580529499ac3456407ff861af29ade00c55607"
+ },
+ "configuration": {
+ "recipe": "circos_lollipop_chord",
+ "seed": 0,
+ "top_n": 4,
+ "gap_degrees": 3,
+ "link_limit": 500,
+ "baseline": 0,
+ "signed_scores": false,
+ "figsize_inches": 8,
+ "label_orientation": "tangent",
+ "inner_radius": 0.48,
+ "outer_radius": 0.83,
+ "max_label_chars": 18,
+ "scale": "max_abs_deviation_from_baseline"
+ },
+ "software": {
+ "python": "3.14.6",
+ "matplotlib": "3.11.2",
+ "numpy": "2.5.4"
+ },
+ "data_status": "demo"
+}
diff --git a/examples/circos/circos_lollipop_chord.pdf b/examples/circos/circos_lollipop_chord.pdf
new file mode 100644
index 0000000..eff4718
Binary files /dev/null and b/examples/circos/circos_lollipop_chord.pdf differ
diff --git a/examples/circos/circos_lollipop_chord.png b/examples/circos/circos_lollipop_chord.png
new file mode 100644
index 0000000..36deea7
Binary files /dev/null and b/examples/circos/circos_lollipop_chord.png differ
diff --git a/examples/circos/circos_lollipop_chord.svg b/examples/circos/circos_lollipop_chord.svg
new file mode 100644
index 0000000..b4f8a73
--- /dev/null
+++ b/examples/circos/circos_lollipop_chord.svg
@@ -0,0 +1,3182 @@
+
+
+
diff --git a/examples/circos/gene_scores.csv b/examples/circos/gene_scores.csv
new file mode 100644
index 0000000..86b58b2
--- /dev/null
+++ b/examples/circos/gene_scores.csv
@@ -0,0 +1,61 @@
+sector,gene,score,direction,display_label,label_priority,evidence_id,sample_size
+Lung,GENE01,0.12,up,G01,10,SYN-1-1,100
+Lung,GENE02,0.42,down,G02,9,SYN-1-2,100
+Lung,GENE03,0.72,risk,G03,8,SYN-1-3,100
+Lung,GENE04,1.02,protective,G04,0,SYN-1-4,100
+Lung,GENE05,1.32,neutral,G05,0,SYN-1-5,100
+Lung,GENE06,1.62,up,G06,0,SYN-1-6,100
+Lung,GENE07,1.92,down,G07,0,SYN-1-7,100
+Lung,GENE08,0.32,risk,G08,0,SYN-1-8,100
+Lung,GENE09,0.62,protective,G09,0,SYN-1-9,100
+Lung,GENE10,0.92,neutral,G10,0,SYN-1-10,100
+Breast,GENE01,0.82,down,G01,10,SYN-2-1,110
+Breast,GENE02,1.12,risk,G02,9,SYN-2-2,110
+Breast,GENE03,1.42,protective,G03,8,SYN-2-3,110
+Breast,GENE04,1.72,neutral,G04,0,SYN-2-4,110
+Breast,GENE05,0.12,up,G05,0,SYN-2-5,110
+Breast,GENE06,0.42,down,G06,0,SYN-2-6,110
+Breast,GENE07,0.72,risk,G07,0,SYN-2-7,110
+Breast,GENE08,1.02,protective,G08,0,SYN-2-8,110
+Breast,GENE09,1.32,neutral,G09,0,SYN-2-9,110
+Breast,GENE10,1.62,up,G10,0,SYN-2-10,110
+Colon,GENE01,1.52,risk,G01,10,SYN-3-1,120
+Colon,GENE02,1.82,protective,G02,9,SYN-3-2,120
+Colon,GENE03,0.22,neutral,G03,8,SYN-3-3,120
+Colon,GENE04,0.52,up,G04,0,SYN-3-4,120
+Colon,GENE05,0.82,down,G05,0,SYN-3-5,120
+Colon,GENE06,1.12,risk,G06,0,SYN-3-6,120
+Colon,GENE07,1.42,protective,G07,0,SYN-3-7,120
+Colon,GENE08,1.72,neutral,G08,0,SYN-3-8,120
+Colon,GENE09,0.12,up,G09,0,SYN-3-9,120
+Colon,GENE10,0.42,down,G10,0,SYN-3-10,120
+Melanoma,GENE01,0.32,protective,G01,10,SYN-4-1,130
+Melanoma,GENE02,0.62,neutral,G02,9,SYN-4-2,130
+Melanoma,GENE03,0.92,up,G03,8,SYN-4-3,130
+Melanoma,GENE04,1.22,down,G04,0,SYN-4-4,130
+Melanoma,GENE05,1.52,risk,G05,0,SYN-4-5,130
+Melanoma,GENE06,1.82,protective,G06,0,SYN-4-6,130
+Melanoma,GENE07,0.22,neutral,G07,0,SYN-4-7,130
+Melanoma,GENE08,0.52,up,G08,0,SYN-4-8,130
+Melanoma,GENE09,0.82,down,G09,0,SYN-4-9,130
+Melanoma,GENE10,1.12,risk,G10,0,SYN-4-10,130
+Ovarian,GENE01,1.02,neutral,G01,10,SYN-5-1,140
+Ovarian,GENE02,1.32,up,G02,9,SYN-5-2,140
+Ovarian,GENE03,1.62,down,G03,8,SYN-5-3,140
+Ovarian,GENE04,1.92,risk,G04,0,SYN-5-4,140
+Ovarian,GENE05,0.32,protective,G05,0,SYN-5-5,140
+Ovarian,GENE06,0.62,neutral,G06,0,SYN-5-6,140
+Ovarian,GENE07,0.92,up,G07,0,SYN-5-7,140
+Ovarian,GENE08,1.22,down,G08,0,SYN-5-8,140
+Ovarian,GENE09,1.52,risk,G09,0,SYN-5-9,140
+Ovarian,GENE10,1.82,protective,G10,0,SYN-5-10,140
+Prostate,GENE01,1.72,up,G01,10,SYN-6-1,150
+Prostate,GENE02,0.12,down,G02,9,SYN-6-2,150
+Prostate,GENE03,0.42,risk,G03,8,SYN-6-3,150
+Prostate,GENE04,0.72,protective,G04,0,SYN-6-4,150
+Prostate,GENE05,1.02,neutral,G05,0,SYN-6-5,150
+Prostate,GENE06,1.32,up,G06,0,SYN-6-6,150
+Prostate,GENE07,1.62,down,G07,0,SYN-6-7,150
+Prostate,GENE08,1.92,risk,G08,0,SYN-6-8,150
+Prostate,GENE09,0.32,protective,G09,0,SYN-6-9,150
+Prostate,GENE10,0.62,neutral,G10,0,SYN-6-10,150
diff --git a/examples/circos/links.csv b/examples/circos/links.csv
new file mode 100644
index 0000000..489d533
--- /dev/null
+++ b/examples/circos/links.csv
@@ -0,0 +1,12 @@
+source_sector,target_sector,feature,weight
+Lung,Breast,GENE01,0.5
+Lung,Colon,GENE02,0.85
+Breast,Melanoma,GENE03,1.2
+Colon,Ovarian,GENE04,1.55
+Melanoma,Prostate,GENE05,0.5
+Ovarian,Prostate,GENE06,0.85
+Lung,Ovarian,GENE07,1.2
+Breast,Colon,GENE08,1.55
+Colon,Prostate,GENE09,0.5
+Breast,Ovarian,GENE10,0.85
+Lung,Melanoma,GENE01,1.2
diff --git a/examples/circos/sectors.csv b/examples/circos/sectors.csv
new file mode 100644
index 0000000..f1de390
--- /dev/null
+++ b/examples/circos/sectors.csv
@@ -0,0 +1,7 @@
+sector,display_name,order,color
+Lung,Lung cancer,0,#DCE8EF
+Breast,Breast cancer,1,#E8E2E0
+Colon,Colorectal cancer,2,#DCE8EF
+Melanoma,Melanoma,3,#E8E2E0
+Ovarian,Ovarian cancer,4,#DCE8EF
+Prostate,Prostate cancer,5,#E8E2E0
diff --git a/examples/circos_v2/README.md b/examples/circos_v2/README.md
new file mode 100644
index 0000000..90d61dc
--- /dev/null
+++ b/examples/circos_v2/README.md
@@ -0,0 +1,7 @@
+# Circos V2 example inputs
+
+**Synthetic demonstration data only.** These rows are generated deterministically to exercise a 12-sector, 240-feature figure and are not biological observations or evidence. Replace all three CSV inputs with source-traceable study data before scientific use.
+
+- `features.csv`: one record for every sector-local feature, including numeric score, direction, label, FDR, p-value, effect size, rank, and synthetic study identifier.
+- `links.csv`: explicitly anchored shared-feature pairs.
+- `sectors.csv`: display names and ordering.
diff --git a/examples/circos_v2/circos_v2_180mm.config.yaml b/examples/circos_v2/circos_v2_180mm.config.yaml
new file mode 100644
index 0000000..dd10914
--- /dev/null
+++ b/examples/circos_v2/circos_v2_180mm.config.yaml
@@ -0,0 +1,19 @@
+schema_version: 2.0
+configuration:
+ recipe: "circos_lollipop_chord"
+ seed: 0
+ top_k: 4
+ gap_degrees: 2
+ start_angle: 0
+ link_limit: null
+ baseline: 0
+ signed_scores: false
+ width_mm: 180.0
+ label_orientation: "tangent"
+ max_label_chars: 18
+ scale: null
+ chord_tension: 0.72
+ bundle_strength: 0.025
+ data_status: "demo"
+ inputs: {"features": "examples/circos_v2/features.csv", "links": "examples/circos_v2/links.csv", "sectors": "examples/circos_v2/sectors.csv"}
+ source_snapshot_sha256: {"features": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc", "links": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753", "sectors": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"}
diff --git a/examples/circos_v2/circos_v2_180mm.manifest.json b/examples/circos_v2/circos_v2_180mm.manifest.json
new file mode 100644
index 0000000..a44c573
--- /dev/null
+++ b/examples/circos_v2/circos_v2_180mm.manifest.json
@@ -0,0 +1,53 @@
+{
+ "schema_version": "2.0",
+ "input_sha256": {
+ "examples/circos_v2/features.csv": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "examples/circos_v2/links.csv": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "examples/circos_v2/sectors.csv": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"
+ },
+ "configuration": {
+ "recipe": "circos_lollipop_chord",
+ "seed": 0,
+ "top_k": 4,
+ "gap_degrees": 2,
+ "start_angle": 0,
+ "link_limit": null,
+ "baseline": 0,
+ "signed_scores": false,
+ "width_mm": 180.0,
+ "label_orientation": "tangent",
+ "max_label_chars": 18,
+ "scale": null,
+ "chord_tension": 0.72,
+ "bundle_strength": 0.025,
+ "data_status": "demo",
+ "inputs": {
+ "features": "examples/circos_v2/features.csv",
+ "links": "examples/circos_v2/links.csv",
+ "sectors": "examples/circos_v2/sectors.csv"
+ },
+ "source_snapshot_sha256": {
+ "features": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "links": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "sectors": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"
+ }
+ },
+ "software": {
+ "python": "3.14.6",
+ "matplotlib": "3.11.2",
+ "numpy": "2.5.4"
+ },
+ "data_status": "demo",
+ "output_sha256": {
+ "examples/circos_v2/circos_v2_180mm.pdf": "5ad11fed0680bf9206c3554c4a63f050111fc4b3925592646ec73bd144a183ee",
+ "examples/circos_v2/circos_v2_180mm.svg": "af10cebc49e41939b68f3ed8dbcae599d951ba7c83cc35a91e97c793ac1254fa",
+ "examples/circos_v2/circos_v2_180mm.png": "1cd959dce49fe7707281eea4505a3da350fc0408e7c9110c461036b756431988",
+ "examples/circos_v2/circos_v2_180mm.source_features.csv": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "examples/circos_v2/circos_v2_180mm.source_sectors.csv": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e",
+ "examples/circos_v2/circos_v2_180mm.source_links.csv": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "examples/circos_v2/circos_v2_180mm.suppressed_labels.csv": "deadb6ce583bbc3be7a39a4c7cb97e52b87ca8e2b4d29dd0c4917eabc2df3a8e",
+ "examples/circos_v2/circos_v2_180mm.metadata.json": "dc5eb9c932e4b12e95db279c4682e74cac37d1f3b76c8e772ff03c7fb8e42d2a",
+ "examples/circos_v2/circos_v2_180mm.config.yaml": "6b5fc8351b1cdfb2fb38f433f867c169cb27184b94daaa682d10965461600e78",
+ "examples/circos_v2/circos_v2_180mm.qc.json": "24757a896d60b51b89001afb71aad7f505663beb1e1856d98e35aeecbec205ab"
+ }
+}
diff --git a/examples/circos_v2/circos_v2_180mm.metadata.json b/examples/circos_v2/circos_v2_180mm.metadata.json
new file mode 100644
index 0000000..3fc5af0
--- /dev/null
+++ b/examples/circos_v2/circos_v2_180mm.metadata.json
@@ -0,0 +1,70 @@
+{
+ "schema_version": "2.0",
+ "feature_rows_input": 240,
+ "feature_rows_used": 240,
+ "link_rows_input": 21,
+ "links_after_deduplication": 21,
+ "duplicate_undirected_links_removed": 0,
+ "link_rows_removed_by_validation": 0,
+ "signed_scores": false,
+ "baseline": 0,
+ "scale": 1.0444,
+ "score_scale_method": "max absolute deviation from baseline",
+ "track_radii": {
+ "chord_endpoint": 0.5349999999999999,
+ "score_inner": 0.57,
+ "score_outer": 0.87,
+ "sector_band_inner": 0.905,
+ "sector_band_outer": 0.968,
+ "label_radius": 1.078
+ },
+ "features_drawn": 240,
+ "links_drawn": 21,
+ "links_removed_by_limit": 0,
+ "label_candidates_top_k": 48,
+ "labels_drawn": 30,
+ "labels_suppressed": 210,
+ "label_collision_threshold": 0.01,
+ "label_suppression_reasons": {
+ "below_top_k": 192,
+ "display_bbox_overlap_gt_0.01": 1,
+ "label_collision": 17
+ },
+ "link_width_cap_p95": 1.6,
+ "aggregation": "none; feature-level endpoint links",
+ "minimum_chord_radius": 0.24609999999999999,
+ "feature_angle_contract": "sector-local feature anchors shared by scores, leaders, and links",
+ "configuration": {
+ "recipe": "circos_lollipop_chord",
+ "seed": 0,
+ "top_k": 4,
+ "gap_degrees": 2,
+ "start_angle": 0,
+ "link_limit": null,
+ "baseline": 0,
+ "signed_scores": false,
+ "width_mm": 180.0,
+ "label_orientation": "tangent",
+ "max_label_chars": 18,
+ "scale": null,
+ "chord_tension": 0.72,
+ "bundle_strength": 0.025,
+ "data_status": "demo",
+ "inputs": {
+ "features": "examples/circos_v2/features.csv",
+ "links": "examples/circos_v2/links.csv",
+ "sectors": "examples/circos_v2/sectors.csv"
+ },
+ "source_snapshot_sha256": {
+ "features": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "links": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "sectors": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"
+ }
+ },
+ "input_sha256": {
+ "examples/circos_v2/features.csv": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "examples/circos_v2/links.csv": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "examples/circos_v2/sectors.csv": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"
+ },
+ "data_status": "demo"
+}
diff --git a/examples/circos_v2/circos_v2_180mm.pdf b/examples/circos_v2/circos_v2_180mm.pdf
new file mode 100644
index 0000000..e1d2cdd
Binary files /dev/null and b/examples/circos_v2/circos_v2_180mm.pdf differ
diff --git a/examples/circos_v2/circos_v2_180mm.png b/examples/circos_v2/circos_v2_180mm.png
new file mode 100644
index 0000000..0717491
Binary files /dev/null and b/examples/circos_v2/circos_v2_180mm.png differ
diff --git a/examples/circos_v2/circos_v2_180mm.qc.json b/examples/circos_v2/circos_v2_180mm.qc.json
new file mode 100644
index 0000000..4377e42
--- /dev/null
+++ b/examples/circos_v2/circos_v2_180mm.qc.json
@@ -0,0 +1,45 @@
+{
+ "schema_version": "1.0",
+ "status": "demo",
+ "checks": {
+ "all_input_links_have_named_feature_anchors": {
+ "pass": true,
+ "links_drawn": 21
+ },
+ "chords_keep_open_center": {
+ "pass": true,
+ "minimum_sampled_radius": 0.24609999999999999
+ },
+ "feature_count_matches_render": {
+ "pass": true,
+ "features_drawn": 240
+ },
+ "suppressed_labels_are_recorded": {
+ "pass": true,
+ "suppressed_label_rows": 210
+ },
+ "vector_and_600dpi_rgb_raster_exported": {
+ "pass": true,
+ "files": [
+ "examples/circos_v2/circos_v2_180mm.pdf",
+ "examples/circos_v2/circos_v2_180mm.svg",
+ "examples/circos_v2/circos_v2_180mm.png"
+ ],
+ "raster_details": [
+ {
+ "file": "examples/circos_v2/circos_v2_180mm.png",
+ "mode": "RGB",
+ "size_px": [
+ 4251,
+ 4251
+ ],
+ "dpi": [
+ 599.9988,
+ 599.9988
+ ]
+ }
+ ]
+ }
+ },
+ "passed": true
+}
diff --git a/examples/circos_v2/circos_v2_180mm.source_features.csv b/examples/circos_v2/circos_v2_180mm.source_features.csv
new file mode 100644
index 0000000..ad70a86
--- /dev/null
+++ b/examples/circos_v2/circos_v2_180mm.source_features.csv
@@ -0,0 +1,241 @@
+sector,feature_id,label,score,direction,fdr,p_value,effect_size,rank,study_id
+Lung,F001,LUN01,1.0105,positive,0.0008,0.0009,1.5971,1,DEMO-01-001
+Lung,F002,LUN02,0.919,positive,0.0078,0.009,1.2991,2,DEMO-01-002
+Lung,F003,LUN03,0.6688,positive,0.0148,0.017,0.4846,3,DEMO-01-003
+Lung,F004,LUN04,0.5161,neutral,0.0218,0.0251,-0.0126,4,DEMO-01-004
+Lung,F005,LUN05,0.2953,negative,0.0288,0.0331,-0.7314,5,DEMO-01-005
+Lung,F006,LUN06,0.0312,negative,0.0358,0.0412,-1.5915,6,DEMO-01-006
+Lung,F007,LUN07,0.101,negative,0.0428,0.0492,-1.364,7,DEMO-01-007
+Lung,F008,LUN08,0.4781,neutral,0.0498,0.0573,-0.1363,8,DEMO-01-008
+Lung,F009,LUN09,0.7319,positive,0.0568,0.0653,0.6899,9,DEMO-01-009
+Lung,F010,LUN10,0.8127,positive,0.0638,0.0734,0.9531,10,DEMO-01-010
+Lung,F011,LUN11,0.9232,positive,0.0708,0.0814,1.3127,11,DEMO-01-011
+Lung,F012,LUN12,0.8798,positive,0.0778,0.0895,1.1714,12,DEMO-01-012
+Lung,F013,LUN13,0.4997,neutral,0.0018,0.0021,-0.0659,13,DEMO-01-013
+Lung,F014,LUN14,0.1461,negative,0.0088,0.0101,-1.2174,14,DEMO-01-014
+Lung,F015,LUN15,0.1308,negative,0.0158,0.0182,-1.2672,15,DEMO-01-015
+Lung,F016,LUN16,0.23,negative,0.0228,0.0262,-0.9441,16,DEMO-01-016
+Lung,F017,LUN17,0.3122,negative,0.0298,0.0343,-0.6764,17,DEMO-01-017
+Lung,F018,LUN18,0.5946,neutral,0.0368,0.0423,0.2429,18,DEMO-01-018
+Lung,F019,LUN19,0.9633,positive,0.0438,0.0504,1.4434,19,DEMO-01-019
+Lung,F020,LUN20,0.9907,positive,0.0508,0.0584,1.5325,20,DEMO-01-020
+Breast,F001,BRE01,0.9161,positive,0.0138,0.0159,1.2895,21,DEMO-02-001
+Breast,F002,BRE02,0.5923,neutral,0.0208,0.0239,0.2353,22,DEMO-02-002
+Breast,F003,BRE03,0.191,negative,0.0278,0.032,-1.0711,23,DEMO-02-003
+Breast,F004,BRE04,0.1112,negative,0.0348,0.04,-1.3311,24,DEMO-02-004
+Breast,F005,BRE05,0.2153,negative,0.0418,0.0481,-0.9919,25,DEMO-02-005
+Breast,F006,BRE06,0.2888,negative,0.0488,0.0561,-0.7527,26,DEMO-02-006
+Breast,F007,BRE07,0.5183,neutral,0.0558,0.0642,-0.0055,27,DEMO-02-007
+Breast,F008,BRE08,0.9047,positive,0.0628,0.0722,1.2524,28,DEMO-02-008
+Breast,F009,BRE09,1.0215,positive,0.0698,0.0803,1.6328,29,DEMO-02-009
+Breast,F010,BRE10,0.7787,positive,0.0768,0.0883,0.8424,30,DEMO-02-010
+Breast,F011,BRE11,0.5473,neutral,0.0008,0.0009,0.0887,31,DEMO-02-011
+Breast,F012,BRE12,0.3975,negative,0.0078,0.009,-0.3989,32,DEMO-02-012
+Breast,F013,BRE13,0.148,negative,0.0148,0.017,-1.2113,33,DEMO-02-013
+Breast,F014,BRE14,0.0177,negative,0.0218,0.0251,-1.6354,34,DEMO-02-014
+Breast,F015,BRE15,0.2872,negative,0.0288,0.0331,-0.758,35,DEMO-02-015
+Breast,F016,BRE16,0.667,positive,0.0358,0.0412,0.4785,36,DEMO-02-016
+Breast,F017,BRE17,0.8085,positive,0.0428,0.0492,0.9394,37,DEMO-02-017
+Breast,F018,BRE18,0.8617,positive,0.0498,0.0573,1.1126,38,DEMO-02-018
+Breast,F019,BRE19,0.9175,positive,0.0568,0.0653,1.2941,39,DEMO-02-019
+Breast,F020,BRE20,0.7036,positive,0.0638,0.0734,0.5978,40,DEMO-02-020
+Colon,F001,COL01,0.4311,neutral,0.0268,0.0308,-0.2896,41,DEMO-03-001
+Colon,F002,COL02,0.2033,negative,0.0338,0.0389,-1.0312,42,DEMO-03-002
+Colon,F003,COL03,0.0147,negative,0.0408,0.0469,-1.645,43,DEMO-03-003
+Colon,F004,COL04,0.2066,negative,0.0478,0.055,-1.0202,44,DEMO-03-004
+Colon,F005,COL05,0.6061,neutral,0.0548,0.063,0.2805,45,DEMO-03-005
+Colon,F006,COL06,0.7991,positive,0.0618,0.0711,0.9088,46,DEMO-03-006
+Colon,F007,COL07,0.8465,positive,0.0688,0.0791,1.0632,47,DEMO-03-007
+Colon,F008,COL08,0.9166,positive,0.0758,0.0872,1.2913,48,DEMO-03-008
+Colon,F009,COL09,0.7754,positive,0.0828,0.0952,0.8314,49,DEMO-03-009
+Colon,F010,COL10,0.3535,negative,0.0068,0.0078,-0.5421,50,DEMO-03-010
+Colon,F011,COL11,0.0831,negative,0.0138,0.0159,-1.4223,51,DEMO-03-011
+Colon,F012,COL12,0.1555,negative,0.0208,0.0239,-1.1867,52,DEMO-03-012
+Colon,F013,COL13,0.2797,negative,0.0278,0.032,-0.7825,53,DEMO-03-013
+Colon,F014,COL14,0.4028,negative,0.0348,0.04,-0.3815,54,DEMO-03-014
+Colon,F015,COL15,0.7253,positive,0.0418,0.0481,0.6686,55,DEMO-03-015
+Colon,F016,COL16,1.0244,positive,0.0488,0.0561,1.6423,56,DEMO-03-016
+Colon,F017,COL17,0.9274,positive,0.0558,0.0642,1.3264,57,DEMO-03-017
+Colon,F018,COL18,0.6194,positive,0.0628,0.0722,0.3235,58,DEMO-03-018
+Colon,F019,COL19,0.438,neutral,0.0698,0.0803,-0.2669,59,DEMO-03-019
+Colon,F020,COL20,0.271,negative,0.0768,0.0883,-0.8105,60,DEMO-03-020
+Melanoma,F001,MEL01,0.1245,negative,0.0398,0.0458,-1.2877,61,DEMO-04-001
+Melanoma,F002,MEL02,0.2622,negative,0.0468,0.0538,-0.8392,62,DEMO-04-002
+Melanoma,F003,MEL03,0.3676,negative,0.0538,0.0619,-0.4961,63,DEMO-04-003
+Melanoma,F004,MEL04,0.6468,positive,0.0608,0.0699,0.4129,64,DEMO-04-004
+Melanoma,F005,MEL05,0.9894,positive,0.0678,0.078,1.5282,65,DEMO-04-005
+Melanoma,F006,MEL06,0.9794,positive,0.0748,0.086,1.4957,66,DEMO-04-006
+Melanoma,F007,MEL07,0.6761,positive,0.0818,0.0941,0.5083,67,DEMO-04-007
+Melanoma,F008,MEL08,0.4622,neutral,0.0058,0.0067,-0.1881,68,DEMO-04-008
+Melanoma,F009,MEL09,0.3133,negative,0.0128,0.0147,-0.673,69,DEMO-04-009
+Melanoma,F010,MEL10,0.0874,negative,0.0198,0.0228,-1.4085,70,DEMO-04-010
+Melanoma,F011,MEL11,0.0685,negative,0.0268,0.0308,-1.47,71,DEMO-04-011
+Melanoma,F012,MEL12,0.4252,neutral,0.0338,0.0389,-0.3087,72,DEMO-04-012
+Melanoma,F013,MEL13,0.7692,positive,0.0408,0.0469,0.8115,73,DEMO-04-013
+Melanoma,F014,MEL14,0.8458,positive,0.0478,0.055,1.0608,74,DEMO-04-014
+Melanoma,F015,MEL15,0.8719,positive,0.0548,0.063,1.1457,75,DEMO-04-015
+Melanoma,F016,MEL16,0.8631,positive,0.0618,0.0711,1.1171,76,DEMO-04-016
+Melanoma,F017,MEL17,0.5637,neutral,0.0688,0.0791,0.1424,77,DEMO-04-017
+Melanoma,F018,MEL18,0.1553,negative,0.0758,0.0872,-1.1872,78,DEMO-04-018
+Melanoma,F019,MEL19,0.0721,negative,0.0828,0.0952,-1.4584,79,DEMO-04-019
+Melanoma,F020,MEL20,0.2388,negative,0.0068,0.0078,-0.9154,80,DEMO-04-020
+Ovarian,F001,OVA01,0.3367,negative,0.0528,0.0607,-0.5967,81,DEMO-05-001
+Ovarian,F002,OVA02,0.7232,positive,0.0598,0.0688,0.6617,82,DEMO-05-002
+Ovarian,F003,OVA03,0.8456,positive,0.0668,0.0768,1.0602,83,DEMO-05-003
+Ovarian,F004,OVA04,0.8615,positive,0.0738,0.0849,1.1119,84,DEMO-05-004
+Ovarian,F005,OVA05,0.8805,positive,0.0808,0.0929,1.1737,85,DEMO-05-005
+Ovarian,F006,OVA06,0.6479,positive,0.0048,0.0055,0.4163,86,DEMO-05-006
+Ovarian,F007,OVA07,0.2214,negative,0.0118,0.0136,-0.9721,87,DEMO-05-007
+Ovarian,F008,OVA08,0.0558,negative,0.0188,0.0216,-1.5112,88,DEMO-05-008
+Ovarian,F009,OVA09,0.2034,negative,0.0258,0.0297,-1.0307,89,DEMO-05-009
+Ovarian,F010,OVA10,0.3436,negative,0.0328,0.0377,-0.5742,90,DEMO-05-010
+Ovarian,F011,OVA11,0.506,neutral,0.0398,0.0458,-0.0457,91,DEMO-05-011
+Ovarian,F012,OVA12,0.8432,positive,0.0468,0.0538,1.0522,92,DEMO-05-012
+Ovarian,F013,OVA13,1.0444,positive,0.0538,0.0619,1.7072,93,DEMO-05-013
+Ovarian,F014,OVA14,0.8339,positive,0.0608,0.0699,1.022,94,DEMO-05-014
+Ovarian,F015,OVA15,0.5157,neutral,0.0678,0.078,-0.0141,95,DEMO-05-015
+Ovarian,F016,OVA16,0.3612,negative,0.0748,0.086,-0.517,96,DEMO-05-016
+Ovarian,F017,OVA17,0.1987,negative,0.0818,0.0941,-1.0462,97,DEMO-05-017
+Ovarian,F018,OVA18,0.0437,negative,0.0058,0.0067,-1.5506,98,DEMO-05-018
+Ovarian,F019,OVA19,0.2261,negative,0.0128,0.0147,-0.9568,99,DEMO-05-019
+Ovarian,F020,OVA20,0.6492,positive,0.0198,0.0228,0.4207,100,DEMO-05-020
+Prostate,F001,PRO01,0.7696,positive,0.0658,0.0757,0.8125,101,DEMO-06-001
+Prostate,F002,PRO02,1.0362,positive,0.0728,0.0837,1.6807,102,DEMO-06-002
+Prostate,F003,PRO03,0.9017,positive,0.0798,0.0918,1.2427,103,DEMO-06-003
+Prostate,F004,PRO04,0.5667,neutral,0.0038,0.0044,0.152,104,DEMO-06-004
+Prostate,F005,PRO05,0.3825,negative,0.0108,0.0124,-0.4477,105,DEMO-06-005
+Prostate,F006,PRO06,0.2393,negative,0.0178,0.0205,-0.9139,106,DEMO-06-006
+Prostate,F007,PRO07,0.0584,negative,0.0248,0.0285,-1.5028,107,DEMO-06-007
+Prostate,F008,PRO08,0.1568,negative,0.0318,0.0366,-1.1827,108,DEMO-06-008
+Prostate,F009,PRO09,0.5685,neutral,0.0388,0.0446,0.1578,109,DEMO-06-009
+Prostate,F010,PRO10,0.8492,positive,0.0458,0.0527,1.0717,110,DEMO-06-010
+Prostate,F011,PRO11,0.8623,positive,0.0528,0.0607,1.1143,111,DEMO-06-011
+Prostate,F012,PRO12,0.8601,positive,0.0598,0.0688,1.1072,112,DEMO-06-012
+Prostate,F013,PRO13,0.7801,positive,0.0668,0.0768,0.8469,113,DEMO-06-013
+Prostate,F014,PRO14,0.4182,negative,0.0738,0.0849,-0.3314,114,DEMO-06-014
+Prostate,F015,PRO15,0.0703,negative,0.0808,0.0929,-1.464,115,DEMO-06-015
+Prostate,F016,PRO16,0.1001,negative,0.0048,0.0055,-1.3671,116,DEMO-06-016
+Prostate,F017,PRO17,0.3069,negative,0.0118,0.0136,-0.694,117,DEMO-06-017
+Prostate,F018,PRO18,0.4434,neutral,0.0188,0.0216,-0.2495,118,DEMO-06-018
+Prostate,F019,PRO19,0.6766,positive,0.0258,0.0297,0.51,119,DEMO-06-019
+Prostate,F020,PRO20,0.9889,positive,0.0328,0.0377,1.5265,120,DEMO-06-020
+Liver,F001,LIV01,0.8562,positive,0.0788,0.0906,1.0946,121,DEMO-07-001
+Liver,F002,LIV02,0.8158,positive,0.0028,0.0032,0.9631,122,DEMO-07-002
+Liver,F003,LIV03,0.5073,neutral,0.0098,0.0113,-0.0414,123,DEMO-07-003
+Liver,F004,LIV04,0.1145,negative,0.0168,0.0193,-1.3203,124,DEMO-07-004
+Liver,F005,LIV05,0.065,negative,0.0238,0.0274,-1.4814,125,DEMO-07-005
+Liver,F006,LIV06,0.27,negative,0.0308,0.0354,-0.814,126,DEMO-07-006
+Liver,F007,LIV07,0.4187,negative,0.0378,0.0435,-0.3297,127,DEMO-07-007
+Liver,F008,LIV08,0.6148,neutral,0.0448,0.0515,0.3088,128,DEMO-07-008
+Liver,F009,LIV09,0.9379,positive,0.0518,0.0596,1.3606,129,DEMO-07-009
+Liver,F010,LIV10,1.0215,positive,0.0588,0.0676,1.6327,130,DEMO-07-010
+Liver,F011,LIV11,0.7187,positive,0.0658,0.0757,0.6468,131,DEMO-07-011
+Liver,F012,LIV12,0.4168,negative,0.0728,0.0837,-0.3359,132,DEMO-07-012
+Liver,F013,LIV13,0.2937,negative,0.0798,0.0918,-0.7369,133,DEMO-07-013
+Liver,F014,LIV14,0.1457,negative,0.0038,0.0044,-1.2187,134,DEMO-07-014
+Liver,F015,LIV15,0.0731,negative,0.0108,0.0124,-1.4549,135,DEMO-07-015
+Liver,F016,LIV16,0.36,negative,0.0178,0.0205,-0.521,136,DEMO-07-016
+Liver,F017,LIV17,0.7729,positive,0.0248,0.0285,0.8233,137,DEMO-07-017
+Liver,F018,LIV18,0.9005,positive,0.0318,0.0366,1.2387,138,DEMO-07-018
+Liver,F019,LIV19,0.8482,positive,0.0388,0.0446,1.0686,139,DEMO-07-019
+Liver,F020,LIV20,0.817,positive,0.0458,0.0527,0.9671,140,DEMO-07-020
+Pancreas,F001,PAN01,0.4587,neutral,0.0088,0.0101,-0.1996,141,DEMO-08-001
+Pancreas,F002,PAN02,0.3121,negative,0.0158,0.0182,-0.6769,142,DEMO-08-002
+Pancreas,F003,PAN03,0.181,negative,0.0228,0.0262,-1.1039,143,DEMO-08-003
+Pancreas,F004,PAN04,0.0648,negative,0.0298,0.0343,-1.482,144,DEMO-08-004
+Pancreas,F005,PAN05,0.2754,negative,0.0368,0.0423,-0.7962,145,DEMO-08-005
+Pancreas,F006,PAN06,0.7052,positive,0.0438,0.0504,0.603,146,DEMO-08-006
+Pancreas,F007,PAN07,0.9019,positive,0.0508,0.0584,1.2435,147,DEMO-08-007
+Pancreas,F008,PAN08,0.8579,positive,0.0578,0.0665,1.1,148,DEMO-08-008
+Pancreas,F009,PAN09,0.8258,positive,0.0648,0.0745,0.9957,149,DEMO-08-009
+Pancreas,F010,PAN10,0.6737,positive,0.0718,0.0826,0.5005,150,DEMO-08-010
+Pancreas,F011,PAN11,0.2792,negative,0.0788,0.0906,-0.7841,151,DEMO-08-011
+Pancreas,F012,PAN12,0.0227,negative,0.0028,0.0032,-1.6191,152,DEMO-08-012
+Pancreas,F013,PAN13,0.1582,negative,0.0098,0.0113,-1.1781,153,DEMO-08-013
+Pancreas,F014,PAN14,0.3856,negative,0.0168,0.0193,-0.4375,154,DEMO-08-014
+Pancreas,F015,PAN15,0.5306,neutral,0.0238,0.0274,0.0345,155,DEMO-08-015
+Pancreas,F016,PAN16,0.7842,positive,0.0308,0.0354,0.8602,156,DEMO-08-016
+Pancreas,F017,PAN17,1.0294,positive,0.0378,0.0435,1.6586,157,DEMO-08-017
+Pancreas,F018,PAN18,0.8969,positive,0.0448,0.0515,1.227,158,DEMO-08-018
+Pancreas,F019,PAN19,0.5196,neutral,0.0518,0.0596,-0.0013,159,DEMO-08-019
+Pancreas,F020,PAN20,0.3073,negative,0.0588,0.0676,-0.6927,160,DEMO-08-020
+Kidney,F001,KID01,0.0413,negative,0.0218,0.0251,-1.5585,161,DEMO-09-001
+Kidney,F002,KID02,0.1084,negative,0.0288,0.0331,-1.34,162,DEMO-09-002
+Kidney,F003,KID03,0.3499,negative,0.0358,0.0412,-0.5538,163,DEMO-09-003
+Kidney,F004,KID04,0.5012,neutral,0.0428,0.0492,-0.0612,164,DEMO-09-004
+Kidney,F005,KID05,0.7216,positive,0.0498,0.0573,0.6564,165,DEMO-09-005
+Kidney,F006,KID06,1.001,positive,0.0568,0.0653,1.5661,166,DEMO-09-006
+Kidney,F007,KID07,0.9579,positive,0.0638,0.0734,1.4256,167,DEMO-09-007
+Kidney,F008,KID08,0.5916,neutral,0.0708,0.0814,0.2331,168,DEMO-09-008
+Kidney,F009,KID09,0.3291,negative,0.0778,0.0895,-0.6214,169,DEMO-09-009
+Kidney,F010,KID10,0.2389,negative,0.0018,0.0021,-0.9152,170,DEMO-09-010
+Kidney,F011,KID11,0.1171,negative,0.0088,0.0101,-1.3117,171,DEMO-09-011
+Kidney,F012,KID12,0.1392,negative,0.0158,0.0182,-1.2397,172,DEMO-09-012
+Kidney,F013,KID13,0.5069,neutral,0.0228,0.0262,-0.0427,173,DEMO-09-013
+Kidney,F014,KID14,0.8734,positive,0.0298,0.0343,1.1508,174,DEMO-09-014
+Kidney,F015,KID15,0.9089,positive,0.0368,0.0423,1.2662,175,DEMO-09-015
+Kidney,F016,KID16,0.8206,positive,0.0438,0.0504,0.9786,176,DEMO-09-016
+Kidney,F017,KID17,0.7491,positive,0.0508,0.0584,0.7457,177,DEMO-09-017
+Kidney,F018,KID18,0.4758,neutral,0.0578,0.0665,-0.1439,178,DEMO-09-018
+Kidney,F019,KID19,0.0953,negative,0.0648,0.0745,-1.3826,179,DEMO-09-019
+Kidney,F020,KID20,0.0414,negative,0.0718,0.0826,-1.5581,180,DEMO-09-020
+Bladder,F001,BLA01,0.1075,negative,0.0348,0.04,-1.343,181,DEMO-10-001
+Bladder,F002,BLA02,0.4149,negative,0.0418,0.0481,-0.3423,182,DEMO-10-002
+Bladder,F003,BLA03,0.8243,positive,0.0488,0.0561,0.9909,183,DEMO-10-003
+Bladder,F004,BLA04,0.9252,positive,0.0558,0.0642,1.3192,184,DEMO-10-004
+Bladder,F005,BLA05,0.8336,positive,0.0628,0.0722,1.0212,185,DEMO-10-005
+Bladder,F006,BLA06,0.7699,positive,0.0698,0.0803,0.8137,186,DEMO-10-006
+Bladder,F007,BLA07,0.5514,neutral,0.0768,0.0883,0.1021,187,DEMO-10-007
+Bladder,F008,BLA08,0.1583,negative,0.0008,0.0009,-1.1775,188,DEMO-10-008
+Bladder,F009,BLA09,0.0157,negative,0.0078,0.009,-1.6418,189,DEMO-10-009
+Bladder,F010,BLA10,0.2404,negative,0.0148,0.017,-0.9105,190,DEMO-10-010
+Bladder,F011,BLA11,0.4701,neutral,0.0218,0.0251,-0.1625,191,DEMO-10-011
+Bladder,F012,BLA12,0.6202,positive,0.0288,0.0331,0.3263,192,DEMO-10-012
+Bladder,F013,BLA13,0.8758,positive,0.0358,0.0412,1.1583,193,DEMO-10-013
+Bladder,F014,BLA14,1.029,positive,0.0428,0.0492,1.6572,194,DEMO-10-014
+Bladder,F015,BLA15,0.7813,positive,0.0498,0.0573,0.8508,195,DEMO-10-015
+Bladder,F016,BLA16,0.4003,negative,0.0568,0.0653,-0.3898,196,DEMO-10-016
+Bladder,F017,BLA17,0.2459,negative,0.0638,0.0734,-0.8925,197,DEMO-10-017
+Bladder,F018,BLA18,0.183,negative,0.0708,0.0814,-1.0972,198,DEMO-10-018
+Bladder,F019,BLA19,0.1118,negative,0.0778,0.0895,-1.3289,199,DEMO-10-019
+Bladder,F020,BLA20,0.3064,negative,0.0018,0.0021,-0.6955,200,DEMO-10-020
+Stomach,F001,STO01,0.5867,neutral,0.0478,0.055,0.2173,201,DEMO-11-001
+Stomach,F002,STO02,0.818,positive,0.0548,0.063,0.9703,202,DEMO-11-002
+Stomach,F003,STO03,1.0264,positive,0.0618,0.0711,1.6487,203,DEMO-11-003
+Stomach,F004,STO04,0.8591,positive,0.0688,0.0791,1.104,204,DEMO-11-004
+Stomach,F005,STO05,0.4632,neutral,0.0758,0.0872,-0.1851,205,DEMO-11-005
+Stomach,F006,STO06,0.2577,negative,0.0828,0.0952,-0.8541,206,DEMO-11-006
+Stomach,F007,STO07,0.2,negative,0.0068,0.0078,-1.0418,207,DEMO-11-007
+Stomach,F008,STO08,0.1166,negative,0.0138,0.0159,-1.3133,208,DEMO-11-008
+Stomach,F009,STO09,0.2377,negative,0.0208,0.0239,-0.919,209,DEMO-11-009
+Stomach,F010,STO10,0.6546,positive,0.0278,0.032,0.4381,210,DEMO-11-010
+Stomach,F011,STO11,0.9437,positive,0.0348,0.04,1.3794,211,DEMO-11-011
+Stomach,F012,STO12,0.8907,positive,0.0418,0.0481,1.207,212,DEMO-11-012
+Stomach,F013,STO13,0.7754,positive,0.0488,0.0561,0.8317,213,DEMO-11-013
+Stomach,F014,STO14,0.6618,positive,0.0558,0.0642,0.4616,214,DEMO-11-014
+Stomach,F015,STO15,0.3431,negative,0.0628,0.0722,-0.5761,215,DEMO-11-015
+Stomach,F016,STO16,0.0257,negative,0.0698,0.0803,-1.6092,216,DEMO-11-016
+Stomach,F017,STO17,0.0968,negative,0.0768,0.0883,-1.3778,217,DEMO-11-017
+Stomach,F018,STO18,0.396,negative,0.0008,0.0009,-0.4037,218,DEMO-11-018
+Stomach,F019,STO19,0.5801,neutral,0.0078,0.009,0.1957,219,DEMO-11-019
+Stomach,F020,STO20,0.7499,positive,0.0148,0.017,0.7484,220,DEMO-11-020
+Thyroid,F001,THY01,0.9189,positive,0.0608,0.0699,1.2987,221,DEMO-12-001
+Thyroid,F002,THY02,0.7915,positive,0.0678,0.078,0.884,222,DEMO-12-002
+Thyroid,F003,THY03,0.6948,positive,0.0748,0.086,0.5692,223,DEMO-12-003
+Thyroid,F004,THY04,0.4222,neutral,0.0818,0.0941,-0.3183,224,DEMO-12-004
+Thyroid,F005,THY05,0.0661,negative,0.0058,0.0067,-1.4778,225,DEMO-12-005
+Thyroid,F006,THY06,0.0491,negative,0.0128,0.0147,-1.5331,226,DEMO-12-006
+Thyroid,F007,THY07,0.3394,negative,0.0198,0.0228,-0.5881,227,DEMO-12-007
+Thyroid,F008,THY08,0.5553,neutral,0.0268,0.0308,0.1149,228,DEMO-12-008
+Thyroid,F009,THY09,0.7068,positive,0.0338,0.0389,0.6083,229,DEMO-12-009
+Thyroid,F010,THY10,0.9432,positive,0.0408,0.0469,1.378,230,DEMO-12-010
+Thyroid,F011,THY11,0.987,positive,0.0478,0.055,1.5204,231,DEMO-12-011
+Thyroid,F012,THY12,0.6464,positive,0.0548,0.063,0.4117,232,DEMO-12-012
+Thyroid,F013,THY13,0.2944,negative,0.0618,0.0711,-0.7344,233,DEMO-12-013
+Thyroid,F014,THY14,0.2034,negative,0.0688,0.0791,-1.0308,234,DEMO-12-014
+Thyroid,F015,THY15,0.167,negative,0.0758,0.0872,-1.1492,235,DEMO-12-015
+Thyroid,F016,THY16,0.1594,negative,0.0828,0.0952,-1.174,236,DEMO-12-016
+Thyroid,F017,THY17,0.4438,neutral,0.0068,0.0078,-0.2482,237,DEMO-12-017
+Thyroid,F018,THY18,0.8605,positive,0.0138,0.0159,1.1086,238,DEMO-12-018
+Thyroid,F019,THY19,0.9674,positive,0.0208,0.0239,1.4566,239,DEMO-12-019
+Thyroid,F020,THY20,0.8149,positive,0.0278,0.032,0.96,240,DEMO-12-020
diff --git a/examples/circos_v2/circos_v2_180mm.source_links.csv b/examples/circos_v2/circos_v2_180mm.source_links.csv
new file mode 100644
index 0000000..dae9d0c
--- /dev/null
+++ b/examples/circos_v2/circos_v2_180mm.source_links.csv
@@ -0,0 +1,22 @@
+from_sector,from_feature,to_sector,to_feature,weight,link_type
+Lung,F001,Liver,F001,1.2,shared_feature
+Breast,F001,Pancreas,F001,1.0,shared_feature
+Colon,F001,Kidney,F001,0.8,shared_feature
+Melanoma,F001,Bladder,F001,0.6,shared_feature
+Ovarian,F001,Stomach,F001,1.6,shared_feature
+Prostate,F001,Thyroid,F001,1.4,shared_feature
+Lung,F002,Pancreas,F002,1.6,shared_feature
+Breast,F002,Kidney,F002,1.4,shared_feature
+Colon,F002,Bladder,F002,1.2,shared_feature
+Melanoma,F002,Stomach,F002,1.0,shared_feature
+Ovarian,F002,Thyroid,F002,0.8,shared_feature
+Lung,F003,Kidney,F003,0.8,shared_feature
+Breast,F003,Bladder,F003,0.6,shared_feature
+Colon,F003,Stomach,F003,1.6,shared_feature
+Melanoma,F003,Thyroid,F003,1.4,shared_feature
+Lung,F004,Bladder,F004,1.2,shared_feature
+Breast,F004,Stomach,F004,1.0,shared_feature
+Colon,F004,Thyroid,F004,0.8,shared_feature
+Lung,F005,Stomach,F005,1.6,shared_feature
+Breast,F005,Thyroid,F005,1.4,shared_feature
+Lung,F006,Thyroid,F006,0.8,shared_feature
diff --git a/examples/circos_v2/circos_v2_180mm.source_sectors.csv b/examples/circos_v2/circos_v2_180mm.source_sectors.csv
new file mode 100644
index 0000000..b37ad6a
--- /dev/null
+++ b/examples/circos_v2/circos_v2_180mm.source_sectors.csv
@@ -0,0 +1,13 @@
+sector,display_name,order
+Lung,Lung,0
+Breast,Breast,1
+Colon,Colorectal,2
+Melanoma,Melanoma,3
+Ovarian,Ovarian,4
+Prostate,Prostate,5
+Liver,Liver,6
+Pancreas,Pancreas,7
+Kidney,Kidney,8
+Bladder,Bladder,9
+Stomach,Stomach,10
+Thyroid,Thyroid,11
diff --git a/examples/circos_v2/circos_v2_180mm.suppressed_labels.csv b/examples/circos_v2/circos_v2_180mm.suppressed_labels.csv
new file mode 100644
index 0000000..fb28e60
--- /dev/null
+++ b/examples/circos_v2/circos_v2_180mm.suppressed_labels.csv
@@ -0,0 +1,211 @@
+sector,feature_id,label,score,direction,fdr,p_value,effect_size,rank,suppression_reason
+Lung,F005,LUN05,0.2953,negative,0.0288,0.0331,-0.7314,5.0,below_top_k
+Lung,F006,LUN06,0.0312,negative,0.0358,0.0412,-1.5915,6.0,below_top_k
+Lung,F007,LUN07,0.101,negative,0.0428,0.0492,-1.364,7.0,below_top_k
+Lung,F008,LUN08,0.4781,neutral,0.0498,0.0573,-0.1363,8.0,below_top_k
+Lung,F009,LUN09,0.7319,positive,0.0568,0.0653,0.6899,9.0,below_top_k
+Lung,F010,LUN10,0.8127,positive,0.0638,0.0734,0.9531,10.0,below_top_k
+Lung,F011,LUN11,0.9232,positive,0.0708,0.0814,1.3127,11.0,below_top_k
+Lung,F012,LUN12,0.8798,positive,0.0778,0.0895,1.1714,12.0,below_top_k
+Lung,F013,LUN13,0.4997,neutral,0.0018,0.0021,-0.0659,13.0,below_top_k
+Lung,F014,LUN14,0.1461,negative,0.0088,0.0101,-1.2174,14.0,below_top_k
+Lung,F015,LUN15,0.1308,negative,0.0158,0.0182,-1.2672,15.0,below_top_k
+Lung,F016,LUN16,0.23,negative,0.0228,0.0262,-0.9441,16.0,below_top_k
+Lung,F017,LUN17,0.3122,negative,0.0298,0.0343,-0.6764,17.0,below_top_k
+Lung,F018,LUN18,0.5946,neutral,0.0368,0.0423,0.2429,18.0,below_top_k
+Lung,F019,LUN19,0.9633,positive,0.0438,0.0504,1.4434,19.0,below_top_k
+Lung,F020,LUN20,0.9907,positive,0.0508,0.0584,1.5325,20.0,below_top_k
+Breast,F005,BRE05,0.2153,negative,0.0418,0.0481,-0.9919,25.0,below_top_k
+Breast,F006,BRE06,0.2888,negative,0.0488,0.0561,-0.7527,26.0,below_top_k
+Breast,F007,BRE07,0.5183,neutral,0.0558,0.0642,-0.0055,27.0,below_top_k
+Breast,F008,BRE08,0.9047,positive,0.0628,0.0722,1.2524,28.0,below_top_k
+Breast,F009,BRE09,1.0215,positive,0.0698,0.0803,1.6328,29.0,below_top_k
+Breast,F010,BRE10,0.7787,positive,0.0768,0.0883,0.8424,30.0,below_top_k
+Breast,F011,BRE11,0.5473,neutral,0.0008,0.0009,0.0887,31.0,below_top_k
+Breast,F012,BRE12,0.3975,negative,0.0078,0.009,-0.3989,32.0,below_top_k
+Breast,F013,BRE13,0.148,negative,0.0148,0.017,-1.2113,33.0,below_top_k
+Breast,F014,BRE14,0.0177,negative,0.0218,0.0251,-1.6354,34.0,below_top_k
+Breast,F015,BRE15,0.2872,negative,0.0288,0.0331,-0.758,35.0,below_top_k
+Breast,F016,BRE16,0.667,positive,0.0358,0.0412,0.4785,36.0,below_top_k
+Breast,F017,BRE17,0.8085,positive,0.0428,0.0492,0.9394,37.0,below_top_k
+Breast,F018,BRE18,0.8617,positive,0.0498,0.0573,1.1126,38.0,below_top_k
+Breast,F019,BRE19,0.9175,positive,0.0568,0.0653,1.2941,39.0,below_top_k
+Breast,F020,BRE20,0.7036,positive,0.0638,0.0734,0.5978,40.0,below_top_k
+Colon,F005,COL05,0.6061,neutral,0.0548,0.063,0.2805,45.0,below_top_k
+Colon,F006,COL06,0.7991,positive,0.0618,0.0711,0.9088,46.0,below_top_k
+Colon,F007,COL07,0.8465,positive,0.0688,0.0791,1.0632,47.0,below_top_k
+Colon,F008,COL08,0.9166,positive,0.0758,0.0872,1.2913,48.0,below_top_k
+Colon,F009,COL09,0.7754,positive,0.0828,0.0952,0.8314,49.0,below_top_k
+Colon,F010,COL10,0.3535,negative,0.0068,0.0078,-0.5421,50.0,below_top_k
+Colon,F011,COL11,0.0831,negative,0.0138,0.0159,-1.4223,51.0,below_top_k
+Colon,F012,COL12,0.1555,negative,0.0208,0.0239,-1.1867,52.0,below_top_k
+Colon,F013,COL13,0.2797,negative,0.0278,0.032,-0.7825,53.0,below_top_k
+Colon,F014,COL14,0.4028,negative,0.0348,0.04,-0.3815,54.0,below_top_k
+Colon,F015,COL15,0.7253,positive,0.0418,0.0481,0.6686,55.0,below_top_k
+Colon,F016,COL16,1.0244,positive,0.0488,0.0561,1.6423,56.0,below_top_k
+Colon,F017,COL17,0.9274,positive,0.0558,0.0642,1.3264,57.0,below_top_k
+Colon,F018,COL18,0.6194,positive,0.0628,0.0722,0.3235,58.0,below_top_k
+Colon,F019,COL19,0.438,neutral,0.0698,0.0803,-0.2669,59.0,below_top_k
+Colon,F020,COL20,0.271,negative,0.0768,0.0883,-0.8105,60.0,below_top_k
+Melanoma,F005,MEL05,0.9894,positive,0.0678,0.078,1.5282,65.0,below_top_k
+Melanoma,F006,MEL06,0.9794,positive,0.0748,0.086,1.4957,66.0,below_top_k
+Melanoma,F007,MEL07,0.6761,positive,0.0818,0.0941,0.5083,67.0,below_top_k
+Melanoma,F008,MEL08,0.4622,neutral,0.0058,0.0067,-0.1881,68.0,below_top_k
+Melanoma,F009,MEL09,0.3133,negative,0.0128,0.0147,-0.673,69.0,below_top_k
+Melanoma,F010,MEL10,0.0874,negative,0.0198,0.0228,-1.4085,70.0,below_top_k
+Melanoma,F011,MEL11,0.0685,negative,0.0268,0.0308,-1.47,71.0,below_top_k
+Melanoma,F012,MEL12,0.4252,neutral,0.0338,0.0389,-0.3087,72.0,below_top_k
+Melanoma,F013,MEL13,0.7692,positive,0.0408,0.0469,0.8115,73.0,below_top_k
+Melanoma,F014,MEL14,0.8458,positive,0.0478,0.055,1.0608,74.0,below_top_k
+Melanoma,F015,MEL15,0.8719,positive,0.0548,0.063,1.1457,75.0,below_top_k
+Melanoma,F016,MEL16,0.8631,positive,0.0618,0.0711,1.1171,76.0,below_top_k
+Melanoma,F017,MEL17,0.5637,neutral,0.0688,0.0791,0.1424,77.0,below_top_k
+Melanoma,F018,MEL18,0.1553,negative,0.0758,0.0872,-1.1872,78.0,below_top_k
+Melanoma,F019,MEL19,0.0721,negative,0.0828,0.0952,-1.4584,79.0,below_top_k
+Melanoma,F020,MEL20,0.2388,negative,0.0068,0.0078,-0.9154,80.0,below_top_k
+Ovarian,F005,OVA05,0.8805,positive,0.0808,0.0929,1.1737,85.0,below_top_k
+Ovarian,F006,OVA06,0.6479,positive,0.0048,0.0055,0.4163,86.0,below_top_k
+Ovarian,F007,OVA07,0.2214,negative,0.0118,0.0136,-0.9721,87.0,below_top_k
+Ovarian,F008,OVA08,0.0558,negative,0.0188,0.0216,-1.5112,88.0,below_top_k
+Ovarian,F009,OVA09,0.2034,negative,0.0258,0.0297,-1.0307,89.0,below_top_k
+Ovarian,F010,OVA10,0.3436,negative,0.0328,0.0377,-0.5742,90.0,below_top_k
+Ovarian,F011,OVA11,0.506,neutral,0.0398,0.0458,-0.0457,91.0,below_top_k
+Ovarian,F012,OVA12,0.8432,positive,0.0468,0.0538,1.0522,92.0,below_top_k
+Ovarian,F013,OVA13,1.0444,positive,0.0538,0.0619,1.7072,93.0,below_top_k
+Ovarian,F014,OVA14,0.8339,positive,0.0608,0.0699,1.022,94.0,below_top_k
+Ovarian,F015,OVA15,0.5157,neutral,0.0678,0.078,-0.0141,95.0,below_top_k
+Ovarian,F016,OVA16,0.3612,negative,0.0748,0.086,-0.517,96.0,below_top_k
+Ovarian,F017,OVA17,0.1987,negative,0.0818,0.0941,-1.0462,97.0,below_top_k
+Ovarian,F018,OVA18,0.0437,negative,0.0058,0.0067,-1.5506,98.0,below_top_k
+Ovarian,F019,OVA19,0.2261,negative,0.0128,0.0147,-0.9568,99.0,below_top_k
+Ovarian,F020,OVA20,0.6492,positive,0.0198,0.0228,0.4207,100.0,below_top_k
+Prostate,F005,PRO05,0.3825,negative,0.0108,0.0124,-0.4477,105.0,below_top_k
+Prostate,F006,PRO06,0.2393,negative,0.0178,0.0205,-0.9139,106.0,below_top_k
+Prostate,F007,PRO07,0.0584,negative,0.0248,0.0285,-1.5028,107.0,below_top_k
+Prostate,F008,PRO08,0.1568,negative,0.0318,0.0366,-1.1827,108.0,below_top_k
+Prostate,F009,PRO09,0.5685,neutral,0.0388,0.0446,0.1578,109.0,below_top_k
+Prostate,F010,PRO10,0.8492,positive,0.0458,0.0527,1.0717,110.0,below_top_k
+Prostate,F011,PRO11,0.8623,positive,0.0528,0.0607,1.1143,111.0,below_top_k
+Prostate,F012,PRO12,0.8601,positive,0.0598,0.0688,1.1072,112.0,below_top_k
+Prostate,F013,PRO13,0.7801,positive,0.0668,0.0768,0.8469,113.0,below_top_k
+Prostate,F014,PRO14,0.4182,negative,0.0738,0.0849,-0.3314,114.0,below_top_k
+Prostate,F015,PRO15,0.0703,negative,0.0808,0.0929,-1.464,115.0,below_top_k
+Prostate,F016,PRO16,0.1001,negative,0.0048,0.0055,-1.3671,116.0,below_top_k
+Prostate,F017,PRO17,0.3069,negative,0.0118,0.0136,-0.694,117.0,below_top_k
+Prostate,F018,PRO18,0.4434,neutral,0.0188,0.0216,-0.2495,118.0,below_top_k
+Prostate,F019,PRO19,0.6766,positive,0.0258,0.0297,0.51,119.0,below_top_k
+Prostate,F020,PRO20,0.9889,positive,0.0328,0.0377,1.5265,120.0,below_top_k
+Liver,F005,LIV05,0.065,negative,0.0238,0.0274,-1.4814,125.0,below_top_k
+Liver,F006,LIV06,0.27,negative,0.0308,0.0354,-0.814,126.0,below_top_k
+Liver,F007,LIV07,0.4187,negative,0.0378,0.0435,-0.3297,127.0,below_top_k
+Liver,F008,LIV08,0.6148,neutral,0.0448,0.0515,0.3088,128.0,below_top_k
+Liver,F009,LIV09,0.9379,positive,0.0518,0.0596,1.3606,129.0,below_top_k
+Liver,F010,LIV10,1.0215,positive,0.0588,0.0676,1.6327,130.0,below_top_k
+Liver,F011,LIV11,0.7187,positive,0.0658,0.0757,0.6468,131.0,below_top_k
+Liver,F012,LIV12,0.4168,negative,0.0728,0.0837,-0.3359,132.0,below_top_k
+Liver,F013,LIV13,0.2937,negative,0.0798,0.0918,-0.7369,133.0,below_top_k
+Liver,F014,LIV14,0.1457,negative,0.0038,0.0044,-1.2187,134.0,below_top_k
+Liver,F015,LIV15,0.0731,negative,0.0108,0.0124,-1.4549,135.0,below_top_k
+Liver,F016,LIV16,0.36,negative,0.0178,0.0205,-0.521,136.0,below_top_k
+Liver,F017,LIV17,0.7729,positive,0.0248,0.0285,0.8233,137.0,below_top_k
+Liver,F018,LIV18,0.9005,positive,0.0318,0.0366,1.2387,138.0,below_top_k
+Liver,F019,LIV19,0.8482,positive,0.0388,0.0446,1.0686,139.0,below_top_k
+Liver,F020,LIV20,0.817,positive,0.0458,0.0527,0.9671,140.0,below_top_k
+Pancreas,F005,PAN05,0.2754,negative,0.0368,0.0423,-0.7962,145.0,below_top_k
+Pancreas,F006,PAN06,0.7052,positive,0.0438,0.0504,0.603,146.0,below_top_k
+Pancreas,F007,PAN07,0.9019,positive,0.0508,0.0584,1.2435,147.0,below_top_k
+Pancreas,F008,PAN08,0.8579,positive,0.0578,0.0665,1.1,148.0,below_top_k
+Pancreas,F009,PAN09,0.8258,positive,0.0648,0.0745,0.9957,149.0,below_top_k
+Pancreas,F010,PAN10,0.6737,positive,0.0718,0.0826,0.5005,150.0,below_top_k
+Pancreas,F011,PAN11,0.2792,negative,0.0788,0.0906,-0.7841,151.0,below_top_k
+Pancreas,F012,PAN12,0.0227,negative,0.0028,0.0032,-1.6191,152.0,below_top_k
+Pancreas,F013,PAN13,0.1582,negative,0.0098,0.0113,-1.1781,153.0,below_top_k
+Pancreas,F014,PAN14,0.3856,negative,0.0168,0.0193,-0.4375,154.0,below_top_k
+Pancreas,F015,PAN15,0.5306,neutral,0.0238,0.0274,0.0345,155.0,below_top_k
+Pancreas,F016,PAN16,0.7842,positive,0.0308,0.0354,0.8602,156.0,below_top_k
+Pancreas,F017,PAN17,1.0294,positive,0.0378,0.0435,1.6586,157.0,below_top_k
+Pancreas,F018,PAN18,0.8969,positive,0.0448,0.0515,1.227,158.0,below_top_k
+Pancreas,F019,PAN19,0.5196,neutral,0.0518,0.0596,-0.0013,159.0,below_top_k
+Pancreas,F020,PAN20,0.3073,negative,0.0588,0.0676,-0.6927,160.0,below_top_k
+Kidney,F005,KID05,0.7216,positive,0.0498,0.0573,0.6564,165.0,below_top_k
+Kidney,F006,KID06,1.001,positive,0.0568,0.0653,1.5661,166.0,below_top_k
+Kidney,F007,KID07,0.9579,positive,0.0638,0.0734,1.4256,167.0,below_top_k
+Kidney,F008,KID08,0.5916,neutral,0.0708,0.0814,0.2331,168.0,below_top_k
+Kidney,F009,KID09,0.3291,negative,0.0778,0.0895,-0.6214,169.0,below_top_k
+Kidney,F010,KID10,0.2389,negative,0.0018,0.0021,-0.9152,170.0,below_top_k
+Kidney,F011,KID11,0.1171,negative,0.0088,0.0101,-1.3117,171.0,below_top_k
+Kidney,F012,KID12,0.1392,negative,0.0158,0.0182,-1.2397,172.0,below_top_k
+Kidney,F013,KID13,0.5069,neutral,0.0228,0.0262,-0.0427,173.0,below_top_k
+Kidney,F014,KID14,0.8734,positive,0.0298,0.0343,1.1508,174.0,below_top_k
+Kidney,F015,KID15,0.9089,positive,0.0368,0.0423,1.2662,175.0,below_top_k
+Kidney,F016,KID16,0.8206,positive,0.0438,0.0504,0.9786,176.0,below_top_k
+Kidney,F017,KID17,0.7491,positive,0.0508,0.0584,0.7457,177.0,below_top_k
+Kidney,F018,KID18,0.4758,neutral,0.0578,0.0665,-0.1439,178.0,below_top_k
+Kidney,F019,KID19,0.0953,negative,0.0648,0.0745,-1.3826,179.0,below_top_k
+Kidney,F020,KID20,0.0414,negative,0.0718,0.0826,-1.5581,180.0,below_top_k
+Bladder,F005,BLA05,0.8336,positive,0.0628,0.0722,1.0212,185.0,below_top_k
+Bladder,F006,BLA06,0.7699,positive,0.0698,0.0803,0.8137,186.0,below_top_k
+Bladder,F007,BLA07,0.5514,neutral,0.0768,0.0883,0.1021,187.0,below_top_k
+Bladder,F008,BLA08,0.1583,negative,0.0008,0.0009,-1.1775,188.0,below_top_k
+Bladder,F009,BLA09,0.0157,negative,0.0078,0.009,-1.6418,189.0,below_top_k
+Bladder,F010,BLA10,0.2404,negative,0.0148,0.017,-0.9105,190.0,below_top_k
+Bladder,F011,BLA11,0.4701,neutral,0.0218,0.0251,-0.1625,191.0,below_top_k
+Bladder,F012,BLA12,0.6202,positive,0.0288,0.0331,0.3263,192.0,below_top_k
+Bladder,F013,BLA13,0.8758,positive,0.0358,0.0412,1.1583,193.0,below_top_k
+Bladder,F014,BLA14,1.029,positive,0.0428,0.0492,1.6572,194.0,below_top_k
+Bladder,F015,BLA15,0.7813,positive,0.0498,0.0573,0.8508,195.0,below_top_k
+Bladder,F016,BLA16,0.4003,negative,0.0568,0.0653,-0.3898,196.0,below_top_k
+Bladder,F017,BLA17,0.2459,negative,0.0638,0.0734,-0.8925,197.0,below_top_k
+Bladder,F018,BLA18,0.183,negative,0.0708,0.0814,-1.0972,198.0,below_top_k
+Bladder,F019,BLA19,0.1118,negative,0.0778,0.0895,-1.3289,199.0,below_top_k
+Bladder,F020,BLA20,0.3064,negative,0.0018,0.0021,-0.6955,200.0,below_top_k
+Stomach,F005,STO05,0.4632,neutral,0.0758,0.0872,-0.1851,205.0,below_top_k
+Stomach,F006,STO06,0.2577,negative,0.0828,0.0952,-0.8541,206.0,below_top_k
+Stomach,F007,STO07,0.2,negative,0.0068,0.0078,-1.0418,207.0,below_top_k
+Stomach,F008,STO08,0.1166,negative,0.0138,0.0159,-1.3133,208.0,below_top_k
+Stomach,F009,STO09,0.2377,negative,0.0208,0.0239,-0.919,209.0,below_top_k
+Stomach,F010,STO10,0.6546,positive,0.0278,0.032,0.4381,210.0,below_top_k
+Stomach,F011,STO11,0.9437,positive,0.0348,0.04,1.3794,211.0,below_top_k
+Stomach,F012,STO12,0.8907,positive,0.0418,0.0481,1.207,212.0,below_top_k
+Stomach,F013,STO13,0.7754,positive,0.0488,0.0561,0.8317,213.0,below_top_k
+Stomach,F014,STO14,0.6618,positive,0.0558,0.0642,0.4616,214.0,below_top_k
+Stomach,F015,STO15,0.3431,negative,0.0628,0.0722,-0.5761,215.0,below_top_k
+Stomach,F016,STO16,0.0257,negative,0.0698,0.0803,-1.6092,216.0,below_top_k
+Stomach,F017,STO17,0.0968,negative,0.0768,0.0883,-1.3778,217.0,below_top_k
+Stomach,F018,STO18,0.396,negative,0.0008,0.0009,-0.4037,218.0,below_top_k
+Stomach,F019,STO19,0.5801,neutral,0.0078,0.009,0.1957,219.0,below_top_k
+Stomach,F020,STO20,0.7499,positive,0.0148,0.017,0.7484,220.0,below_top_k
+Thyroid,F005,THY05,0.0661,negative,0.0058,0.0067,-1.4778,225.0,below_top_k
+Thyroid,F006,THY06,0.0491,negative,0.0128,0.0147,-1.5331,226.0,below_top_k
+Thyroid,F007,THY07,0.3394,negative,0.0198,0.0228,-0.5881,227.0,below_top_k
+Thyroid,F008,THY08,0.5553,neutral,0.0268,0.0308,0.1149,228.0,below_top_k
+Thyroid,F009,THY09,0.7068,positive,0.0338,0.0389,0.6083,229.0,below_top_k
+Thyroid,F010,THY10,0.9432,positive,0.0408,0.0469,1.378,230.0,below_top_k
+Thyroid,F011,THY11,0.987,positive,0.0478,0.055,1.5204,231.0,below_top_k
+Thyroid,F012,THY12,0.6464,positive,0.0548,0.063,0.4117,232.0,below_top_k
+Thyroid,F013,THY13,0.2944,negative,0.0618,0.0711,-0.7344,233.0,below_top_k
+Thyroid,F014,THY14,0.2034,negative,0.0688,0.0791,-1.0308,234.0,below_top_k
+Thyroid,F015,THY15,0.167,negative,0.0758,0.0872,-1.1492,235.0,below_top_k
+Thyroid,F016,THY16,0.1594,negative,0.0828,0.0952,-1.174,236.0,below_top_k
+Thyroid,F017,THY17,0.4438,neutral,0.0068,0.0078,-0.2482,237.0,below_top_k
+Thyroid,F018,THY18,0.8605,positive,0.0138,0.0159,1.1086,238.0,below_top_k
+Thyroid,F019,THY19,0.9674,positive,0.0208,0.0239,1.4566,239.0,below_top_k
+Thyroid,F020,THY20,0.8149,positive,0.0278,0.032,0.96,240.0,below_top_k
+Lung,F004,LUN04,0.5161,neutral,0.0218,0.0251,-0.0126,4.0,label_collision
+Breast,F003,BRE03,0.191,negative,0.0278,0.032,-1.0711,23.0,label_collision
+Colon,F003,COL03,0.0147,negative,0.0408,0.0469,-1.645,43.0,label_collision
+Colon,F004,COL04,0.2066,negative,0.0478,0.055,-1.0202,44.0,label_collision
+Melanoma,F003,MEL03,0.3676,negative,0.0538,0.0619,-0.4961,63.0,label_collision
+Ovarian,F003,OVA03,0.8456,positive,0.0668,0.0768,1.0602,83.0,label_collision
+Ovarian,F004,OVA04,0.8615,positive,0.0738,0.0849,1.1119,84.0,label_collision
+Prostate,F003,PRO03,0.9017,positive,0.0798,0.0918,1.2427,103.0,label_collision
+Liver,F003,LIV03,0.5073,neutral,0.0098,0.0113,-0.0414,123.0,label_collision
+Liver,F004,LIV04,0.1145,negative,0.0168,0.0193,-1.3203,124.0,label_collision
+Pancreas,F003,PAN03,0.181,negative,0.0228,0.0262,-1.1039,143.0,label_collision
+Pancreas,F004,PAN04,0.0648,negative,0.0298,0.0343,-1.482,144.0,label_collision
+Kidney,F004,KID04,0.5012,neutral,0.0428,0.0492,-0.0612,164.0,label_collision
+Bladder,F004,BLA04,0.9252,positive,0.0558,0.0642,1.3192,184.0,label_collision
+Stomach,F003,STO03,1.0264,positive,0.0618,0.0711,1.6487,203.0,label_collision
+Stomach,F004,STO04,0.8591,positive,0.0688,0.0791,1.104,204.0,label_collision
+Thyroid,F003,THY03,0.6948,positive,0.0748,0.086,0.5692,223.0,label_collision
+Stomach,F002,STO02,0.818,positive,0.0548,0.063,0.9703,202.0,display_bbox_overlap_gt_0.01
diff --git a/examples/circos_v2/circos_v2_180mm.svg b/examples/circos_v2/circos_v2_180mm.svg
new file mode 100644
index 0000000..afb1c6f
--- /dev/null
+++ b/examples/circos_v2/circos_v2_180mm.svg
@@ -0,0 +1,12961 @@
+
+
+
diff --git a/examples/circos_v2/circos_v2_90mm.config.yaml b/examples/circos_v2/circos_v2_90mm.config.yaml
new file mode 100644
index 0000000..1af3fca
--- /dev/null
+++ b/examples/circos_v2/circos_v2_90mm.config.yaml
@@ -0,0 +1,19 @@
+schema_version: 2.0
+configuration:
+ recipe: "circos_lollipop_chord"
+ seed: 0
+ top_k: 4
+ gap_degrees: 2
+ start_angle: 0
+ link_limit: null
+ baseline: 0
+ signed_scores: false
+ width_mm: 90.0
+ label_orientation: "tangent"
+ max_label_chars: 18
+ scale: null
+ chord_tension: 0.72
+ bundle_strength: 0.025
+ data_status: "demo"
+ inputs: {"features": "examples/circos_v2/features.csv", "links": "examples/circos_v2/links.csv", "sectors": "examples/circos_v2/sectors.csv"}
+ source_snapshot_sha256: {"features": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc", "links": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753", "sectors": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"}
diff --git a/examples/circos_v2/circos_v2_90mm.manifest.json b/examples/circos_v2/circos_v2_90mm.manifest.json
new file mode 100644
index 0000000..9a8ac02
--- /dev/null
+++ b/examples/circos_v2/circos_v2_90mm.manifest.json
@@ -0,0 +1,53 @@
+{
+ "schema_version": "2.0",
+ "input_sha256": {
+ "examples/circos_v2/features.csv": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "examples/circos_v2/links.csv": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "examples/circos_v2/sectors.csv": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"
+ },
+ "configuration": {
+ "recipe": "circos_lollipop_chord",
+ "seed": 0,
+ "top_k": 4,
+ "gap_degrees": 2,
+ "start_angle": 0,
+ "link_limit": null,
+ "baseline": 0,
+ "signed_scores": false,
+ "width_mm": 90.0,
+ "label_orientation": "tangent",
+ "max_label_chars": 18,
+ "scale": null,
+ "chord_tension": 0.72,
+ "bundle_strength": 0.025,
+ "data_status": "demo",
+ "inputs": {
+ "features": "examples/circos_v2/features.csv",
+ "links": "examples/circos_v2/links.csv",
+ "sectors": "examples/circos_v2/sectors.csv"
+ },
+ "source_snapshot_sha256": {
+ "features": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "links": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "sectors": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"
+ }
+ },
+ "software": {
+ "python": "3.14.6",
+ "matplotlib": "3.11.2",
+ "numpy": "2.5.4"
+ },
+ "data_status": "demo",
+ "output_sha256": {
+ "examples/circos_v2/circos_v2_90mm.pdf": "4a839e7c4f525f0ed3444637d84c7fdd9e81fe4f85ce44649cf15bcb678419f0",
+ "examples/circos_v2/circos_v2_90mm.svg": "0ba12031744400f5ec72940b11675d0a6f2c442267f03beb9edc971c502550c4",
+ "examples/circos_v2/circos_v2_90mm.png": "c778ab28781fe8662dbb230b9955f945dd7722d10115fdce6f77fd497a460ad2",
+ "examples/circos_v2/circos_v2_90mm.source_features.csv": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "examples/circos_v2/circos_v2_90mm.source_sectors.csv": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e",
+ "examples/circos_v2/circos_v2_90mm.source_links.csv": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "examples/circos_v2/circos_v2_90mm.suppressed_labels.csv": "fc53f14c6047499d41807afa6ea7443813d4632b17605abf6c20d7f602fbfb94",
+ "examples/circos_v2/circos_v2_90mm.metadata.json": "ef8287788144354fa8e7aa172fd2c848147fcd96643c67dfc7abff3c6e6f89c6",
+ "examples/circos_v2/circos_v2_90mm.config.yaml": "cdfac41ec1c5c7517ada78be4de13f7877a7a19afdd648729d2dbf21143e363f",
+ "examples/circos_v2/circos_v2_90mm.qc.json": "89e9174bb52fa28c422e448fdf232e097aaa800b64d17472f47053e3a2c3c00d"
+ }
+}
diff --git a/examples/circos_v2/circos_v2_90mm.metadata.json b/examples/circos_v2/circos_v2_90mm.metadata.json
new file mode 100644
index 0000000..965e2b8
--- /dev/null
+++ b/examples/circos_v2/circos_v2_90mm.metadata.json
@@ -0,0 +1,70 @@
+{
+ "schema_version": "2.0",
+ "feature_rows_input": 240,
+ "feature_rows_used": 240,
+ "link_rows_input": 21,
+ "links_after_deduplication": 21,
+ "duplicate_undirected_links_removed": 0,
+ "link_rows_removed_by_validation": 0,
+ "signed_scores": false,
+ "baseline": 0,
+ "scale": 1.0444,
+ "score_scale_method": "max absolute deviation from baseline",
+ "track_radii": {
+ "chord_endpoint": 0.5349999999999999,
+ "score_inner": 0.57,
+ "score_outer": 0.87,
+ "sector_band_inner": 0.905,
+ "sector_band_outer": 0.968,
+ "label_radius": 1.078
+ },
+ "features_drawn": 240,
+ "links_drawn": 21,
+ "links_removed_by_limit": 0,
+ "label_candidates_top_k": 48,
+ "labels_drawn": 15,
+ "labels_suppressed": 225,
+ "label_collision_threshold": 0.01,
+ "label_suppression_reasons": {
+ "below_top_k": 192,
+ "display_bbox_overlap_gt_0.01": 4,
+ "label_collision": 29
+ },
+ "link_width_cap_p95": 1.6,
+ "aggregation": "none; feature-level endpoint links",
+ "minimum_chord_radius": 0.24609999999999999,
+ "feature_angle_contract": "sector-local feature anchors shared by scores, leaders, and links",
+ "configuration": {
+ "recipe": "circos_lollipop_chord",
+ "seed": 0,
+ "top_k": 4,
+ "gap_degrees": 2,
+ "start_angle": 0,
+ "link_limit": null,
+ "baseline": 0,
+ "signed_scores": false,
+ "width_mm": 90.0,
+ "label_orientation": "tangent",
+ "max_label_chars": 18,
+ "scale": null,
+ "chord_tension": 0.72,
+ "bundle_strength": 0.025,
+ "data_status": "demo",
+ "inputs": {
+ "features": "examples/circos_v2/features.csv",
+ "links": "examples/circos_v2/links.csv",
+ "sectors": "examples/circos_v2/sectors.csv"
+ },
+ "source_snapshot_sha256": {
+ "features": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "links": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "sectors": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"
+ }
+ },
+ "input_sha256": {
+ "examples/circos_v2/features.csv": "ff9db7c77278d98744cc24eacd18fb2ff14d48520bbf41e5e7efc79504608fdc",
+ "examples/circos_v2/links.csv": "50163f91d7816275ca4baabd0bc456db9da4a4fd3590e0adf109d0624898c753",
+ "examples/circos_v2/sectors.csv": "fbff63d8be3064c51632a17444dab6ca5382478c5accab18d9b2c9321bdc2b5e"
+ },
+ "data_status": "demo"
+}
diff --git a/examples/circos_v2/circos_v2_90mm.pdf b/examples/circos_v2/circos_v2_90mm.pdf
new file mode 100644
index 0000000..a9f0fe8
Binary files /dev/null and b/examples/circos_v2/circos_v2_90mm.pdf differ
diff --git a/examples/circos_v2/circos_v2_90mm.png b/examples/circos_v2/circos_v2_90mm.png
new file mode 100644
index 0000000..95f7eda
Binary files /dev/null and b/examples/circos_v2/circos_v2_90mm.png differ
diff --git a/examples/circos_v2/circos_v2_90mm.qc.json b/examples/circos_v2/circos_v2_90mm.qc.json
new file mode 100644
index 0000000..5c8dfdc
--- /dev/null
+++ b/examples/circos_v2/circos_v2_90mm.qc.json
@@ -0,0 +1,45 @@
+{
+ "schema_version": "1.0",
+ "status": "demo",
+ "checks": {
+ "all_input_links_have_named_feature_anchors": {
+ "pass": true,
+ "links_drawn": 21
+ },
+ "chords_keep_open_center": {
+ "pass": true,
+ "minimum_sampled_radius": 0.24609999999999999
+ },
+ "feature_count_matches_render": {
+ "pass": true,
+ "features_drawn": 240
+ },
+ "suppressed_labels_are_recorded": {
+ "pass": true,
+ "suppressed_label_rows": 225
+ },
+ "vector_and_600dpi_rgb_raster_exported": {
+ "pass": true,
+ "files": [
+ "examples/circos_v2/circos_v2_90mm.pdf",
+ "examples/circos_v2/circos_v2_90mm.svg",
+ "examples/circos_v2/circos_v2_90mm.png"
+ ],
+ "raster_details": [
+ {
+ "file": "examples/circos_v2/circos_v2_90mm.png",
+ "mode": "RGB",
+ "size_px": [
+ 2125,
+ 2125
+ ],
+ "dpi": [
+ 599.9988,
+ 599.9988
+ ]
+ }
+ ]
+ }
+ },
+ "passed": true
+}
diff --git a/examples/circos_v2/circos_v2_90mm.source_features.csv b/examples/circos_v2/circos_v2_90mm.source_features.csv
new file mode 100644
index 0000000..ad70a86
--- /dev/null
+++ b/examples/circos_v2/circos_v2_90mm.source_features.csv
@@ -0,0 +1,241 @@
+sector,feature_id,label,score,direction,fdr,p_value,effect_size,rank,study_id
+Lung,F001,LUN01,1.0105,positive,0.0008,0.0009,1.5971,1,DEMO-01-001
+Lung,F002,LUN02,0.919,positive,0.0078,0.009,1.2991,2,DEMO-01-002
+Lung,F003,LUN03,0.6688,positive,0.0148,0.017,0.4846,3,DEMO-01-003
+Lung,F004,LUN04,0.5161,neutral,0.0218,0.0251,-0.0126,4,DEMO-01-004
+Lung,F005,LUN05,0.2953,negative,0.0288,0.0331,-0.7314,5,DEMO-01-005
+Lung,F006,LUN06,0.0312,negative,0.0358,0.0412,-1.5915,6,DEMO-01-006
+Lung,F007,LUN07,0.101,negative,0.0428,0.0492,-1.364,7,DEMO-01-007
+Lung,F008,LUN08,0.4781,neutral,0.0498,0.0573,-0.1363,8,DEMO-01-008
+Lung,F009,LUN09,0.7319,positive,0.0568,0.0653,0.6899,9,DEMO-01-009
+Lung,F010,LUN10,0.8127,positive,0.0638,0.0734,0.9531,10,DEMO-01-010
+Lung,F011,LUN11,0.9232,positive,0.0708,0.0814,1.3127,11,DEMO-01-011
+Lung,F012,LUN12,0.8798,positive,0.0778,0.0895,1.1714,12,DEMO-01-012
+Lung,F013,LUN13,0.4997,neutral,0.0018,0.0021,-0.0659,13,DEMO-01-013
+Lung,F014,LUN14,0.1461,negative,0.0088,0.0101,-1.2174,14,DEMO-01-014
+Lung,F015,LUN15,0.1308,negative,0.0158,0.0182,-1.2672,15,DEMO-01-015
+Lung,F016,LUN16,0.23,negative,0.0228,0.0262,-0.9441,16,DEMO-01-016
+Lung,F017,LUN17,0.3122,negative,0.0298,0.0343,-0.6764,17,DEMO-01-017
+Lung,F018,LUN18,0.5946,neutral,0.0368,0.0423,0.2429,18,DEMO-01-018
+Lung,F019,LUN19,0.9633,positive,0.0438,0.0504,1.4434,19,DEMO-01-019
+Lung,F020,LUN20,0.9907,positive,0.0508,0.0584,1.5325,20,DEMO-01-020
+Breast,F001,BRE01,0.9161,positive,0.0138,0.0159,1.2895,21,DEMO-02-001
+Breast,F002,BRE02,0.5923,neutral,0.0208,0.0239,0.2353,22,DEMO-02-002
+Breast,F003,BRE03,0.191,negative,0.0278,0.032,-1.0711,23,DEMO-02-003
+Breast,F004,BRE04,0.1112,negative,0.0348,0.04,-1.3311,24,DEMO-02-004
+Breast,F005,BRE05,0.2153,negative,0.0418,0.0481,-0.9919,25,DEMO-02-005
+Breast,F006,BRE06,0.2888,negative,0.0488,0.0561,-0.7527,26,DEMO-02-006
+Breast,F007,BRE07,0.5183,neutral,0.0558,0.0642,-0.0055,27,DEMO-02-007
+Breast,F008,BRE08,0.9047,positive,0.0628,0.0722,1.2524,28,DEMO-02-008
+Breast,F009,BRE09,1.0215,positive,0.0698,0.0803,1.6328,29,DEMO-02-009
+Breast,F010,BRE10,0.7787,positive,0.0768,0.0883,0.8424,30,DEMO-02-010
+Breast,F011,BRE11,0.5473,neutral,0.0008,0.0009,0.0887,31,DEMO-02-011
+Breast,F012,BRE12,0.3975,negative,0.0078,0.009,-0.3989,32,DEMO-02-012
+Breast,F013,BRE13,0.148,negative,0.0148,0.017,-1.2113,33,DEMO-02-013
+Breast,F014,BRE14,0.0177,negative,0.0218,0.0251,-1.6354,34,DEMO-02-014
+Breast,F015,BRE15,0.2872,negative,0.0288,0.0331,-0.758,35,DEMO-02-015
+Breast,F016,BRE16,0.667,positive,0.0358,0.0412,0.4785,36,DEMO-02-016
+Breast,F017,BRE17,0.8085,positive,0.0428,0.0492,0.9394,37,DEMO-02-017
+Breast,F018,BRE18,0.8617,positive,0.0498,0.0573,1.1126,38,DEMO-02-018
+Breast,F019,BRE19,0.9175,positive,0.0568,0.0653,1.2941,39,DEMO-02-019
+Breast,F020,BRE20,0.7036,positive,0.0638,0.0734,0.5978,40,DEMO-02-020
+Colon,F001,COL01,0.4311,neutral,0.0268,0.0308,-0.2896,41,DEMO-03-001
+Colon,F002,COL02,0.2033,negative,0.0338,0.0389,-1.0312,42,DEMO-03-002
+Colon,F003,COL03,0.0147,negative,0.0408,0.0469,-1.645,43,DEMO-03-003
+Colon,F004,COL04,0.2066,negative,0.0478,0.055,-1.0202,44,DEMO-03-004
+Colon,F005,COL05,0.6061,neutral,0.0548,0.063,0.2805,45,DEMO-03-005
+Colon,F006,COL06,0.7991,positive,0.0618,0.0711,0.9088,46,DEMO-03-006
+Colon,F007,COL07,0.8465,positive,0.0688,0.0791,1.0632,47,DEMO-03-007
+Colon,F008,COL08,0.9166,positive,0.0758,0.0872,1.2913,48,DEMO-03-008
+Colon,F009,COL09,0.7754,positive,0.0828,0.0952,0.8314,49,DEMO-03-009
+Colon,F010,COL10,0.3535,negative,0.0068,0.0078,-0.5421,50,DEMO-03-010
+Colon,F011,COL11,0.0831,negative,0.0138,0.0159,-1.4223,51,DEMO-03-011
+Colon,F012,COL12,0.1555,negative,0.0208,0.0239,-1.1867,52,DEMO-03-012
+Colon,F013,COL13,0.2797,negative,0.0278,0.032,-0.7825,53,DEMO-03-013
+Colon,F014,COL14,0.4028,negative,0.0348,0.04,-0.3815,54,DEMO-03-014
+Colon,F015,COL15,0.7253,positive,0.0418,0.0481,0.6686,55,DEMO-03-015
+Colon,F016,COL16,1.0244,positive,0.0488,0.0561,1.6423,56,DEMO-03-016
+Colon,F017,COL17,0.9274,positive,0.0558,0.0642,1.3264,57,DEMO-03-017
+Colon,F018,COL18,0.6194,positive,0.0628,0.0722,0.3235,58,DEMO-03-018
+Colon,F019,COL19,0.438,neutral,0.0698,0.0803,-0.2669,59,DEMO-03-019
+Colon,F020,COL20,0.271,negative,0.0768,0.0883,-0.8105,60,DEMO-03-020
+Melanoma,F001,MEL01,0.1245,negative,0.0398,0.0458,-1.2877,61,DEMO-04-001
+Melanoma,F002,MEL02,0.2622,negative,0.0468,0.0538,-0.8392,62,DEMO-04-002
+Melanoma,F003,MEL03,0.3676,negative,0.0538,0.0619,-0.4961,63,DEMO-04-003
+Melanoma,F004,MEL04,0.6468,positive,0.0608,0.0699,0.4129,64,DEMO-04-004
+Melanoma,F005,MEL05,0.9894,positive,0.0678,0.078,1.5282,65,DEMO-04-005
+Melanoma,F006,MEL06,0.9794,positive,0.0748,0.086,1.4957,66,DEMO-04-006
+Melanoma,F007,MEL07,0.6761,positive,0.0818,0.0941,0.5083,67,DEMO-04-007
+Melanoma,F008,MEL08,0.4622,neutral,0.0058,0.0067,-0.1881,68,DEMO-04-008
+Melanoma,F009,MEL09,0.3133,negative,0.0128,0.0147,-0.673,69,DEMO-04-009
+Melanoma,F010,MEL10,0.0874,negative,0.0198,0.0228,-1.4085,70,DEMO-04-010
+Melanoma,F011,MEL11,0.0685,negative,0.0268,0.0308,-1.47,71,DEMO-04-011
+Melanoma,F012,MEL12,0.4252,neutral,0.0338,0.0389,-0.3087,72,DEMO-04-012
+Melanoma,F013,MEL13,0.7692,positive,0.0408,0.0469,0.8115,73,DEMO-04-013
+Melanoma,F014,MEL14,0.8458,positive,0.0478,0.055,1.0608,74,DEMO-04-014
+Melanoma,F015,MEL15,0.8719,positive,0.0548,0.063,1.1457,75,DEMO-04-015
+Melanoma,F016,MEL16,0.8631,positive,0.0618,0.0711,1.1171,76,DEMO-04-016
+Melanoma,F017,MEL17,0.5637,neutral,0.0688,0.0791,0.1424,77,DEMO-04-017
+Melanoma,F018,MEL18,0.1553,negative,0.0758,0.0872,-1.1872,78,DEMO-04-018
+Melanoma,F019,MEL19,0.0721,negative,0.0828,0.0952,-1.4584,79,DEMO-04-019
+Melanoma,F020,MEL20,0.2388,negative,0.0068,0.0078,-0.9154,80,DEMO-04-020
+Ovarian,F001,OVA01,0.3367,negative,0.0528,0.0607,-0.5967,81,DEMO-05-001
+Ovarian,F002,OVA02,0.7232,positive,0.0598,0.0688,0.6617,82,DEMO-05-002
+Ovarian,F003,OVA03,0.8456,positive,0.0668,0.0768,1.0602,83,DEMO-05-003
+Ovarian,F004,OVA04,0.8615,positive,0.0738,0.0849,1.1119,84,DEMO-05-004
+Ovarian,F005,OVA05,0.8805,positive,0.0808,0.0929,1.1737,85,DEMO-05-005
+Ovarian,F006,OVA06,0.6479,positive,0.0048,0.0055,0.4163,86,DEMO-05-006
+Ovarian,F007,OVA07,0.2214,negative,0.0118,0.0136,-0.9721,87,DEMO-05-007
+Ovarian,F008,OVA08,0.0558,negative,0.0188,0.0216,-1.5112,88,DEMO-05-008
+Ovarian,F009,OVA09,0.2034,negative,0.0258,0.0297,-1.0307,89,DEMO-05-009
+Ovarian,F010,OVA10,0.3436,negative,0.0328,0.0377,-0.5742,90,DEMO-05-010
+Ovarian,F011,OVA11,0.506,neutral,0.0398,0.0458,-0.0457,91,DEMO-05-011
+Ovarian,F012,OVA12,0.8432,positive,0.0468,0.0538,1.0522,92,DEMO-05-012
+Ovarian,F013,OVA13,1.0444,positive,0.0538,0.0619,1.7072,93,DEMO-05-013
+Ovarian,F014,OVA14,0.8339,positive,0.0608,0.0699,1.022,94,DEMO-05-014
+Ovarian,F015,OVA15,0.5157,neutral,0.0678,0.078,-0.0141,95,DEMO-05-015
+Ovarian,F016,OVA16,0.3612,negative,0.0748,0.086,-0.517,96,DEMO-05-016
+Ovarian,F017,OVA17,0.1987,negative,0.0818,0.0941,-1.0462,97,DEMO-05-017
+Ovarian,F018,OVA18,0.0437,negative,0.0058,0.0067,-1.5506,98,DEMO-05-018
+Ovarian,F019,OVA19,0.2261,negative,0.0128,0.0147,-0.9568,99,DEMO-05-019
+Ovarian,F020,OVA20,0.6492,positive,0.0198,0.0228,0.4207,100,DEMO-05-020
+Prostate,F001,PRO01,0.7696,positive,0.0658,0.0757,0.8125,101,DEMO-06-001
+Prostate,F002,PRO02,1.0362,positive,0.0728,0.0837,1.6807,102,DEMO-06-002
+Prostate,F003,PRO03,0.9017,positive,0.0798,0.0918,1.2427,103,DEMO-06-003
+Prostate,F004,PRO04,0.5667,neutral,0.0038,0.0044,0.152,104,DEMO-06-004
+Prostate,F005,PRO05,0.3825,negative,0.0108,0.0124,-0.4477,105,DEMO-06-005
+Prostate,F006,PRO06,0.2393,negative,0.0178,0.0205,-0.9139,106,DEMO-06-006
+Prostate,F007,PRO07,0.0584,negative,0.0248,0.0285,-1.5028,107,DEMO-06-007
+Prostate,F008,PRO08,0.1568,negative,0.0318,0.0366,-1.1827,108,DEMO-06-008
+Prostate,F009,PRO09,0.5685,neutral,0.0388,0.0446,0.1578,109,DEMO-06-009
+Prostate,F010,PRO10,0.8492,positive,0.0458,0.0527,1.0717,110,DEMO-06-010
+Prostate,F011,PRO11,0.8623,positive,0.0528,0.0607,1.1143,111,DEMO-06-011
+Prostate,F012,PRO12,0.8601,positive,0.0598,0.0688,1.1072,112,DEMO-06-012
+Prostate,F013,PRO13,0.7801,positive,0.0668,0.0768,0.8469,113,DEMO-06-013
+Prostate,F014,PRO14,0.4182,negative,0.0738,0.0849,-0.3314,114,DEMO-06-014
+Prostate,F015,PRO15,0.0703,negative,0.0808,0.0929,-1.464,115,DEMO-06-015
+Prostate,F016,PRO16,0.1001,negative,0.0048,0.0055,-1.3671,116,DEMO-06-016
+Prostate,F017,PRO17,0.3069,negative,0.0118,0.0136,-0.694,117,DEMO-06-017
+Prostate,F018,PRO18,0.4434,neutral,0.0188,0.0216,-0.2495,118,DEMO-06-018
+Prostate,F019,PRO19,0.6766,positive,0.0258,0.0297,0.51,119,DEMO-06-019
+Prostate,F020,PRO20,0.9889,positive,0.0328,0.0377,1.5265,120,DEMO-06-020
+Liver,F001,LIV01,0.8562,positive,0.0788,0.0906,1.0946,121,DEMO-07-001
+Liver,F002,LIV02,0.8158,positive,0.0028,0.0032,0.9631,122,DEMO-07-002
+Liver,F003,LIV03,0.5073,neutral,0.0098,0.0113,-0.0414,123,DEMO-07-003
+Liver,F004,LIV04,0.1145,negative,0.0168,0.0193,-1.3203,124,DEMO-07-004
+Liver,F005,LIV05,0.065,negative,0.0238,0.0274,-1.4814,125,DEMO-07-005
+Liver,F006,LIV06,0.27,negative,0.0308,0.0354,-0.814,126,DEMO-07-006
+Liver,F007,LIV07,0.4187,negative,0.0378,0.0435,-0.3297,127,DEMO-07-007
+Liver,F008,LIV08,0.6148,neutral,0.0448,0.0515,0.3088,128,DEMO-07-008
+Liver,F009,LIV09,0.9379,positive,0.0518,0.0596,1.3606,129,DEMO-07-009
+Liver,F010,LIV10,1.0215,positive,0.0588,0.0676,1.6327,130,DEMO-07-010
+Liver,F011,LIV11,0.7187,positive,0.0658,0.0757,0.6468,131,DEMO-07-011
+Liver,F012,LIV12,0.4168,negative,0.0728,0.0837,-0.3359,132,DEMO-07-012
+Liver,F013,LIV13,0.2937,negative,0.0798,0.0918,-0.7369,133,DEMO-07-013
+Liver,F014,LIV14,0.1457,negative,0.0038,0.0044,-1.2187,134,DEMO-07-014
+Liver,F015,LIV15,0.0731,negative,0.0108,0.0124,-1.4549,135,DEMO-07-015
+Liver,F016,LIV16,0.36,negative,0.0178,0.0205,-0.521,136,DEMO-07-016
+Liver,F017,LIV17,0.7729,positive,0.0248,0.0285,0.8233,137,DEMO-07-017
+Liver,F018,LIV18,0.9005,positive,0.0318,0.0366,1.2387,138,DEMO-07-018
+Liver,F019,LIV19,0.8482,positive,0.0388,0.0446,1.0686,139,DEMO-07-019
+Liver,F020,LIV20,0.817,positive,0.0458,0.0527,0.9671,140,DEMO-07-020
+Pancreas,F001,PAN01,0.4587,neutral,0.0088,0.0101,-0.1996,141,DEMO-08-001
+Pancreas,F002,PAN02,0.3121,negative,0.0158,0.0182,-0.6769,142,DEMO-08-002
+Pancreas,F003,PAN03,0.181,negative,0.0228,0.0262,-1.1039,143,DEMO-08-003
+Pancreas,F004,PAN04,0.0648,negative,0.0298,0.0343,-1.482,144,DEMO-08-004
+Pancreas,F005,PAN05,0.2754,negative,0.0368,0.0423,-0.7962,145,DEMO-08-005
+Pancreas,F006,PAN06,0.7052,positive,0.0438,0.0504,0.603,146,DEMO-08-006
+Pancreas,F007,PAN07,0.9019,positive,0.0508,0.0584,1.2435,147,DEMO-08-007
+Pancreas,F008,PAN08,0.8579,positive,0.0578,0.0665,1.1,148,DEMO-08-008
+Pancreas,F009,PAN09,0.8258,positive,0.0648,0.0745,0.9957,149,DEMO-08-009
+Pancreas,F010,PAN10,0.6737,positive,0.0718,0.0826,0.5005,150,DEMO-08-010
+Pancreas,F011,PAN11,0.2792,negative,0.0788,0.0906,-0.7841,151,DEMO-08-011
+Pancreas,F012,PAN12,0.0227,negative,0.0028,0.0032,-1.6191,152,DEMO-08-012
+Pancreas,F013,PAN13,0.1582,negative,0.0098,0.0113,-1.1781,153,DEMO-08-013
+Pancreas,F014,PAN14,0.3856,negative,0.0168,0.0193,-0.4375,154,DEMO-08-014
+Pancreas,F015,PAN15,0.5306,neutral,0.0238,0.0274,0.0345,155,DEMO-08-015
+Pancreas,F016,PAN16,0.7842,positive,0.0308,0.0354,0.8602,156,DEMO-08-016
+Pancreas,F017,PAN17,1.0294,positive,0.0378,0.0435,1.6586,157,DEMO-08-017
+Pancreas,F018,PAN18,0.8969,positive,0.0448,0.0515,1.227,158,DEMO-08-018
+Pancreas,F019,PAN19,0.5196,neutral,0.0518,0.0596,-0.0013,159,DEMO-08-019
+Pancreas,F020,PAN20,0.3073,negative,0.0588,0.0676,-0.6927,160,DEMO-08-020
+Kidney,F001,KID01,0.0413,negative,0.0218,0.0251,-1.5585,161,DEMO-09-001
+Kidney,F002,KID02,0.1084,negative,0.0288,0.0331,-1.34,162,DEMO-09-002
+Kidney,F003,KID03,0.3499,negative,0.0358,0.0412,-0.5538,163,DEMO-09-003
+Kidney,F004,KID04,0.5012,neutral,0.0428,0.0492,-0.0612,164,DEMO-09-004
+Kidney,F005,KID05,0.7216,positive,0.0498,0.0573,0.6564,165,DEMO-09-005
+Kidney,F006,KID06,1.001,positive,0.0568,0.0653,1.5661,166,DEMO-09-006
+Kidney,F007,KID07,0.9579,positive,0.0638,0.0734,1.4256,167,DEMO-09-007
+Kidney,F008,KID08,0.5916,neutral,0.0708,0.0814,0.2331,168,DEMO-09-008
+Kidney,F009,KID09,0.3291,negative,0.0778,0.0895,-0.6214,169,DEMO-09-009
+Kidney,F010,KID10,0.2389,negative,0.0018,0.0021,-0.9152,170,DEMO-09-010
+Kidney,F011,KID11,0.1171,negative,0.0088,0.0101,-1.3117,171,DEMO-09-011
+Kidney,F012,KID12,0.1392,negative,0.0158,0.0182,-1.2397,172,DEMO-09-012
+Kidney,F013,KID13,0.5069,neutral,0.0228,0.0262,-0.0427,173,DEMO-09-013
+Kidney,F014,KID14,0.8734,positive,0.0298,0.0343,1.1508,174,DEMO-09-014
+Kidney,F015,KID15,0.9089,positive,0.0368,0.0423,1.2662,175,DEMO-09-015
+Kidney,F016,KID16,0.8206,positive,0.0438,0.0504,0.9786,176,DEMO-09-016
+Kidney,F017,KID17,0.7491,positive,0.0508,0.0584,0.7457,177,DEMO-09-017
+Kidney,F018,KID18,0.4758,neutral,0.0578,0.0665,-0.1439,178,DEMO-09-018
+Kidney,F019,KID19,0.0953,negative,0.0648,0.0745,-1.3826,179,DEMO-09-019
+Kidney,F020,KID20,0.0414,negative,0.0718,0.0826,-1.5581,180,DEMO-09-020
+Bladder,F001,BLA01,0.1075,negative,0.0348,0.04,-1.343,181,DEMO-10-001
+Bladder,F002,BLA02,0.4149,negative,0.0418,0.0481,-0.3423,182,DEMO-10-002
+Bladder,F003,BLA03,0.8243,positive,0.0488,0.0561,0.9909,183,DEMO-10-003
+Bladder,F004,BLA04,0.9252,positive,0.0558,0.0642,1.3192,184,DEMO-10-004
+Bladder,F005,BLA05,0.8336,positive,0.0628,0.0722,1.0212,185,DEMO-10-005
+Bladder,F006,BLA06,0.7699,positive,0.0698,0.0803,0.8137,186,DEMO-10-006
+Bladder,F007,BLA07,0.5514,neutral,0.0768,0.0883,0.1021,187,DEMO-10-007
+Bladder,F008,BLA08,0.1583,negative,0.0008,0.0009,-1.1775,188,DEMO-10-008
+Bladder,F009,BLA09,0.0157,negative,0.0078,0.009,-1.6418,189,DEMO-10-009
+Bladder,F010,BLA10,0.2404,negative,0.0148,0.017,-0.9105,190,DEMO-10-010
+Bladder,F011,BLA11,0.4701,neutral,0.0218,0.0251,-0.1625,191,DEMO-10-011
+Bladder,F012,BLA12,0.6202,positive,0.0288,0.0331,0.3263,192,DEMO-10-012
+Bladder,F013,BLA13,0.8758,positive,0.0358,0.0412,1.1583,193,DEMO-10-013
+Bladder,F014,BLA14,1.029,positive,0.0428,0.0492,1.6572,194,DEMO-10-014
+Bladder,F015,BLA15,0.7813,positive,0.0498,0.0573,0.8508,195,DEMO-10-015
+Bladder,F016,BLA16,0.4003,negative,0.0568,0.0653,-0.3898,196,DEMO-10-016
+Bladder,F017,BLA17,0.2459,negative,0.0638,0.0734,-0.8925,197,DEMO-10-017
+Bladder,F018,BLA18,0.183,negative,0.0708,0.0814,-1.0972,198,DEMO-10-018
+Bladder,F019,BLA19,0.1118,negative,0.0778,0.0895,-1.3289,199,DEMO-10-019
+Bladder,F020,BLA20,0.3064,negative,0.0018,0.0021,-0.6955,200,DEMO-10-020
+Stomach,F001,STO01,0.5867,neutral,0.0478,0.055,0.2173,201,DEMO-11-001
+Stomach,F002,STO02,0.818,positive,0.0548,0.063,0.9703,202,DEMO-11-002
+Stomach,F003,STO03,1.0264,positive,0.0618,0.0711,1.6487,203,DEMO-11-003
+Stomach,F004,STO04,0.8591,positive,0.0688,0.0791,1.104,204,DEMO-11-004
+Stomach,F005,STO05,0.4632,neutral,0.0758,0.0872,-0.1851,205,DEMO-11-005
+Stomach,F006,STO06,0.2577,negative,0.0828,0.0952,-0.8541,206,DEMO-11-006
+Stomach,F007,STO07,0.2,negative,0.0068,0.0078,-1.0418,207,DEMO-11-007
+Stomach,F008,STO08,0.1166,negative,0.0138,0.0159,-1.3133,208,DEMO-11-008
+Stomach,F009,STO09,0.2377,negative,0.0208,0.0239,-0.919,209,DEMO-11-009
+Stomach,F010,STO10,0.6546,positive,0.0278,0.032,0.4381,210,DEMO-11-010
+Stomach,F011,STO11,0.9437,positive,0.0348,0.04,1.3794,211,DEMO-11-011
+Stomach,F012,STO12,0.8907,positive,0.0418,0.0481,1.207,212,DEMO-11-012
+Stomach,F013,STO13,0.7754,positive,0.0488,0.0561,0.8317,213,DEMO-11-013
+Stomach,F014,STO14,0.6618,positive,0.0558,0.0642,0.4616,214,DEMO-11-014
+Stomach,F015,STO15,0.3431,negative,0.0628,0.0722,-0.5761,215,DEMO-11-015
+Stomach,F016,STO16,0.0257,negative,0.0698,0.0803,-1.6092,216,DEMO-11-016
+Stomach,F017,STO17,0.0968,negative,0.0768,0.0883,-1.3778,217,DEMO-11-017
+Stomach,F018,STO18,0.396,negative,0.0008,0.0009,-0.4037,218,DEMO-11-018
+Stomach,F019,STO19,0.5801,neutral,0.0078,0.009,0.1957,219,DEMO-11-019
+Stomach,F020,STO20,0.7499,positive,0.0148,0.017,0.7484,220,DEMO-11-020
+Thyroid,F001,THY01,0.9189,positive,0.0608,0.0699,1.2987,221,DEMO-12-001
+Thyroid,F002,THY02,0.7915,positive,0.0678,0.078,0.884,222,DEMO-12-002
+Thyroid,F003,THY03,0.6948,positive,0.0748,0.086,0.5692,223,DEMO-12-003
+Thyroid,F004,THY04,0.4222,neutral,0.0818,0.0941,-0.3183,224,DEMO-12-004
+Thyroid,F005,THY05,0.0661,negative,0.0058,0.0067,-1.4778,225,DEMO-12-005
+Thyroid,F006,THY06,0.0491,negative,0.0128,0.0147,-1.5331,226,DEMO-12-006
+Thyroid,F007,THY07,0.3394,negative,0.0198,0.0228,-0.5881,227,DEMO-12-007
+Thyroid,F008,THY08,0.5553,neutral,0.0268,0.0308,0.1149,228,DEMO-12-008
+Thyroid,F009,THY09,0.7068,positive,0.0338,0.0389,0.6083,229,DEMO-12-009
+Thyroid,F010,THY10,0.9432,positive,0.0408,0.0469,1.378,230,DEMO-12-010
+Thyroid,F011,THY11,0.987,positive,0.0478,0.055,1.5204,231,DEMO-12-011
+Thyroid,F012,THY12,0.6464,positive,0.0548,0.063,0.4117,232,DEMO-12-012
+Thyroid,F013,THY13,0.2944,negative,0.0618,0.0711,-0.7344,233,DEMO-12-013
+Thyroid,F014,THY14,0.2034,negative,0.0688,0.0791,-1.0308,234,DEMO-12-014
+Thyroid,F015,THY15,0.167,negative,0.0758,0.0872,-1.1492,235,DEMO-12-015
+Thyroid,F016,THY16,0.1594,negative,0.0828,0.0952,-1.174,236,DEMO-12-016
+Thyroid,F017,THY17,0.4438,neutral,0.0068,0.0078,-0.2482,237,DEMO-12-017
+Thyroid,F018,THY18,0.8605,positive,0.0138,0.0159,1.1086,238,DEMO-12-018
+Thyroid,F019,THY19,0.9674,positive,0.0208,0.0239,1.4566,239,DEMO-12-019
+Thyroid,F020,THY20,0.8149,positive,0.0278,0.032,0.96,240,DEMO-12-020
diff --git a/examples/circos_v2/circos_v2_90mm.source_links.csv b/examples/circos_v2/circos_v2_90mm.source_links.csv
new file mode 100644
index 0000000..dae9d0c
--- /dev/null
+++ b/examples/circos_v2/circos_v2_90mm.source_links.csv
@@ -0,0 +1,22 @@
+from_sector,from_feature,to_sector,to_feature,weight,link_type
+Lung,F001,Liver,F001,1.2,shared_feature
+Breast,F001,Pancreas,F001,1.0,shared_feature
+Colon,F001,Kidney,F001,0.8,shared_feature
+Melanoma,F001,Bladder,F001,0.6,shared_feature
+Ovarian,F001,Stomach,F001,1.6,shared_feature
+Prostate,F001,Thyroid,F001,1.4,shared_feature
+Lung,F002,Pancreas,F002,1.6,shared_feature
+Breast,F002,Kidney,F002,1.4,shared_feature
+Colon,F002,Bladder,F002,1.2,shared_feature
+Melanoma,F002,Stomach,F002,1.0,shared_feature
+Ovarian,F002,Thyroid,F002,0.8,shared_feature
+Lung,F003,Kidney,F003,0.8,shared_feature
+Breast,F003,Bladder,F003,0.6,shared_feature
+Colon,F003,Stomach,F003,1.6,shared_feature
+Melanoma,F003,Thyroid,F003,1.4,shared_feature
+Lung,F004,Bladder,F004,1.2,shared_feature
+Breast,F004,Stomach,F004,1.0,shared_feature
+Colon,F004,Thyroid,F004,0.8,shared_feature
+Lung,F005,Stomach,F005,1.6,shared_feature
+Breast,F005,Thyroid,F005,1.4,shared_feature
+Lung,F006,Thyroid,F006,0.8,shared_feature
diff --git a/examples/circos_v2/circos_v2_90mm.source_sectors.csv b/examples/circos_v2/circos_v2_90mm.source_sectors.csv
new file mode 100644
index 0000000..b37ad6a
--- /dev/null
+++ b/examples/circos_v2/circos_v2_90mm.source_sectors.csv
@@ -0,0 +1,13 @@
+sector,display_name,order
+Lung,Lung,0
+Breast,Breast,1
+Colon,Colorectal,2
+Melanoma,Melanoma,3
+Ovarian,Ovarian,4
+Prostate,Prostate,5
+Liver,Liver,6
+Pancreas,Pancreas,7
+Kidney,Kidney,8
+Bladder,Bladder,9
+Stomach,Stomach,10
+Thyroid,Thyroid,11
diff --git a/examples/circos_v2/circos_v2_90mm.suppressed_labels.csv b/examples/circos_v2/circos_v2_90mm.suppressed_labels.csv
new file mode 100644
index 0000000..76d725c
--- /dev/null
+++ b/examples/circos_v2/circos_v2_90mm.suppressed_labels.csv
@@ -0,0 +1,226 @@
+sector,feature_id,label,score,direction,fdr,p_value,effect_size,rank,suppression_reason
+Lung,F005,LUN05,0.2953,negative,0.0288,0.0331,-0.7314,5.0,below_top_k
+Lung,F006,LUN06,0.0312,negative,0.0358,0.0412,-1.5915,6.0,below_top_k
+Lung,F007,LUN07,0.101,negative,0.0428,0.0492,-1.364,7.0,below_top_k
+Lung,F008,LUN08,0.4781,neutral,0.0498,0.0573,-0.1363,8.0,below_top_k
+Lung,F009,LUN09,0.7319,positive,0.0568,0.0653,0.6899,9.0,below_top_k
+Lung,F010,LUN10,0.8127,positive,0.0638,0.0734,0.9531,10.0,below_top_k
+Lung,F011,LUN11,0.9232,positive,0.0708,0.0814,1.3127,11.0,below_top_k
+Lung,F012,LUN12,0.8798,positive,0.0778,0.0895,1.1714,12.0,below_top_k
+Lung,F013,LUN13,0.4997,neutral,0.0018,0.0021,-0.0659,13.0,below_top_k
+Lung,F014,LUN14,0.1461,negative,0.0088,0.0101,-1.2174,14.0,below_top_k
+Lung,F015,LUN15,0.1308,negative,0.0158,0.0182,-1.2672,15.0,below_top_k
+Lung,F016,LUN16,0.23,negative,0.0228,0.0262,-0.9441,16.0,below_top_k
+Lung,F017,LUN17,0.3122,negative,0.0298,0.0343,-0.6764,17.0,below_top_k
+Lung,F018,LUN18,0.5946,neutral,0.0368,0.0423,0.2429,18.0,below_top_k
+Lung,F019,LUN19,0.9633,positive,0.0438,0.0504,1.4434,19.0,below_top_k
+Lung,F020,LUN20,0.9907,positive,0.0508,0.0584,1.5325,20.0,below_top_k
+Breast,F005,BRE05,0.2153,negative,0.0418,0.0481,-0.9919,25.0,below_top_k
+Breast,F006,BRE06,0.2888,negative,0.0488,0.0561,-0.7527,26.0,below_top_k
+Breast,F007,BRE07,0.5183,neutral,0.0558,0.0642,-0.0055,27.0,below_top_k
+Breast,F008,BRE08,0.9047,positive,0.0628,0.0722,1.2524,28.0,below_top_k
+Breast,F009,BRE09,1.0215,positive,0.0698,0.0803,1.6328,29.0,below_top_k
+Breast,F010,BRE10,0.7787,positive,0.0768,0.0883,0.8424,30.0,below_top_k
+Breast,F011,BRE11,0.5473,neutral,0.0008,0.0009,0.0887,31.0,below_top_k
+Breast,F012,BRE12,0.3975,negative,0.0078,0.009,-0.3989,32.0,below_top_k
+Breast,F013,BRE13,0.148,negative,0.0148,0.017,-1.2113,33.0,below_top_k
+Breast,F014,BRE14,0.0177,negative,0.0218,0.0251,-1.6354,34.0,below_top_k
+Breast,F015,BRE15,0.2872,negative,0.0288,0.0331,-0.758,35.0,below_top_k
+Breast,F016,BRE16,0.667,positive,0.0358,0.0412,0.4785,36.0,below_top_k
+Breast,F017,BRE17,0.8085,positive,0.0428,0.0492,0.9394,37.0,below_top_k
+Breast,F018,BRE18,0.8617,positive,0.0498,0.0573,1.1126,38.0,below_top_k
+Breast,F019,BRE19,0.9175,positive,0.0568,0.0653,1.2941,39.0,below_top_k
+Breast,F020,BRE20,0.7036,positive,0.0638,0.0734,0.5978,40.0,below_top_k
+Colon,F005,COL05,0.6061,neutral,0.0548,0.063,0.2805,45.0,below_top_k
+Colon,F006,COL06,0.7991,positive,0.0618,0.0711,0.9088,46.0,below_top_k
+Colon,F007,COL07,0.8465,positive,0.0688,0.0791,1.0632,47.0,below_top_k
+Colon,F008,COL08,0.9166,positive,0.0758,0.0872,1.2913,48.0,below_top_k
+Colon,F009,COL09,0.7754,positive,0.0828,0.0952,0.8314,49.0,below_top_k
+Colon,F010,COL10,0.3535,negative,0.0068,0.0078,-0.5421,50.0,below_top_k
+Colon,F011,COL11,0.0831,negative,0.0138,0.0159,-1.4223,51.0,below_top_k
+Colon,F012,COL12,0.1555,negative,0.0208,0.0239,-1.1867,52.0,below_top_k
+Colon,F013,COL13,0.2797,negative,0.0278,0.032,-0.7825,53.0,below_top_k
+Colon,F014,COL14,0.4028,negative,0.0348,0.04,-0.3815,54.0,below_top_k
+Colon,F015,COL15,0.7253,positive,0.0418,0.0481,0.6686,55.0,below_top_k
+Colon,F016,COL16,1.0244,positive,0.0488,0.0561,1.6423,56.0,below_top_k
+Colon,F017,COL17,0.9274,positive,0.0558,0.0642,1.3264,57.0,below_top_k
+Colon,F018,COL18,0.6194,positive,0.0628,0.0722,0.3235,58.0,below_top_k
+Colon,F019,COL19,0.438,neutral,0.0698,0.0803,-0.2669,59.0,below_top_k
+Colon,F020,COL20,0.271,negative,0.0768,0.0883,-0.8105,60.0,below_top_k
+Melanoma,F005,MEL05,0.9894,positive,0.0678,0.078,1.5282,65.0,below_top_k
+Melanoma,F006,MEL06,0.9794,positive,0.0748,0.086,1.4957,66.0,below_top_k
+Melanoma,F007,MEL07,0.6761,positive,0.0818,0.0941,0.5083,67.0,below_top_k
+Melanoma,F008,MEL08,0.4622,neutral,0.0058,0.0067,-0.1881,68.0,below_top_k
+Melanoma,F009,MEL09,0.3133,negative,0.0128,0.0147,-0.673,69.0,below_top_k
+Melanoma,F010,MEL10,0.0874,negative,0.0198,0.0228,-1.4085,70.0,below_top_k
+Melanoma,F011,MEL11,0.0685,negative,0.0268,0.0308,-1.47,71.0,below_top_k
+Melanoma,F012,MEL12,0.4252,neutral,0.0338,0.0389,-0.3087,72.0,below_top_k
+Melanoma,F013,MEL13,0.7692,positive,0.0408,0.0469,0.8115,73.0,below_top_k
+Melanoma,F014,MEL14,0.8458,positive,0.0478,0.055,1.0608,74.0,below_top_k
+Melanoma,F015,MEL15,0.8719,positive,0.0548,0.063,1.1457,75.0,below_top_k
+Melanoma,F016,MEL16,0.8631,positive,0.0618,0.0711,1.1171,76.0,below_top_k
+Melanoma,F017,MEL17,0.5637,neutral,0.0688,0.0791,0.1424,77.0,below_top_k
+Melanoma,F018,MEL18,0.1553,negative,0.0758,0.0872,-1.1872,78.0,below_top_k
+Melanoma,F019,MEL19,0.0721,negative,0.0828,0.0952,-1.4584,79.0,below_top_k
+Melanoma,F020,MEL20,0.2388,negative,0.0068,0.0078,-0.9154,80.0,below_top_k
+Ovarian,F005,OVA05,0.8805,positive,0.0808,0.0929,1.1737,85.0,below_top_k
+Ovarian,F006,OVA06,0.6479,positive,0.0048,0.0055,0.4163,86.0,below_top_k
+Ovarian,F007,OVA07,0.2214,negative,0.0118,0.0136,-0.9721,87.0,below_top_k
+Ovarian,F008,OVA08,0.0558,negative,0.0188,0.0216,-1.5112,88.0,below_top_k
+Ovarian,F009,OVA09,0.2034,negative,0.0258,0.0297,-1.0307,89.0,below_top_k
+Ovarian,F010,OVA10,0.3436,negative,0.0328,0.0377,-0.5742,90.0,below_top_k
+Ovarian,F011,OVA11,0.506,neutral,0.0398,0.0458,-0.0457,91.0,below_top_k
+Ovarian,F012,OVA12,0.8432,positive,0.0468,0.0538,1.0522,92.0,below_top_k
+Ovarian,F013,OVA13,1.0444,positive,0.0538,0.0619,1.7072,93.0,below_top_k
+Ovarian,F014,OVA14,0.8339,positive,0.0608,0.0699,1.022,94.0,below_top_k
+Ovarian,F015,OVA15,0.5157,neutral,0.0678,0.078,-0.0141,95.0,below_top_k
+Ovarian,F016,OVA16,0.3612,negative,0.0748,0.086,-0.517,96.0,below_top_k
+Ovarian,F017,OVA17,0.1987,negative,0.0818,0.0941,-1.0462,97.0,below_top_k
+Ovarian,F018,OVA18,0.0437,negative,0.0058,0.0067,-1.5506,98.0,below_top_k
+Ovarian,F019,OVA19,0.2261,negative,0.0128,0.0147,-0.9568,99.0,below_top_k
+Ovarian,F020,OVA20,0.6492,positive,0.0198,0.0228,0.4207,100.0,below_top_k
+Prostate,F005,PRO05,0.3825,negative,0.0108,0.0124,-0.4477,105.0,below_top_k
+Prostate,F006,PRO06,0.2393,negative,0.0178,0.0205,-0.9139,106.0,below_top_k
+Prostate,F007,PRO07,0.0584,negative,0.0248,0.0285,-1.5028,107.0,below_top_k
+Prostate,F008,PRO08,0.1568,negative,0.0318,0.0366,-1.1827,108.0,below_top_k
+Prostate,F009,PRO09,0.5685,neutral,0.0388,0.0446,0.1578,109.0,below_top_k
+Prostate,F010,PRO10,0.8492,positive,0.0458,0.0527,1.0717,110.0,below_top_k
+Prostate,F011,PRO11,0.8623,positive,0.0528,0.0607,1.1143,111.0,below_top_k
+Prostate,F012,PRO12,0.8601,positive,0.0598,0.0688,1.1072,112.0,below_top_k
+Prostate,F013,PRO13,0.7801,positive,0.0668,0.0768,0.8469,113.0,below_top_k
+Prostate,F014,PRO14,0.4182,negative,0.0738,0.0849,-0.3314,114.0,below_top_k
+Prostate,F015,PRO15,0.0703,negative,0.0808,0.0929,-1.464,115.0,below_top_k
+Prostate,F016,PRO16,0.1001,negative,0.0048,0.0055,-1.3671,116.0,below_top_k
+Prostate,F017,PRO17,0.3069,negative,0.0118,0.0136,-0.694,117.0,below_top_k
+Prostate,F018,PRO18,0.4434,neutral,0.0188,0.0216,-0.2495,118.0,below_top_k
+Prostate,F019,PRO19,0.6766,positive,0.0258,0.0297,0.51,119.0,below_top_k
+Prostate,F020,PRO20,0.9889,positive,0.0328,0.0377,1.5265,120.0,below_top_k
+Liver,F005,LIV05,0.065,negative,0.0238,0.0274,-1.4814,125.0,below_top_k
+Liver,F006,LIV06,0.27,negative,0.0308,0.0354,-0.814,126.0,below_top_k
+Liver,F007,LIV07,0.4187,negative,0.0378,0.0435,-0.3297,127.0,below_top_k
+Liver,F008,LIV08,0.6148,neutral,0.0448,0.0515,0.3088,128.0,below_top_k
+Liver,F009,LIV09,0.9379,positive,0.0518,0.0596,1.3606,129.0,below_top_k
+Liver,F010,LIV10,1.0215,positive,0.0588,0.0676,1.6327,130.0,below_top_k
+Liver,F011,LIV11,0.7187,positive,0.0658,0.0757,0.6468,131.0,below_top_k
+Liver,F012,LIV12,0.4168,negative,0.0728,0.0837,-0.3359,132.0,below_top_k
+Liver,F013,LIV13,0.2937,negative,0.0798,0.0918,-0.7369,133.0,below_top_k
+Liver,F014,LIV14,0.1457,negative,0.0038,0.0044,-1.2187,134.0,below_top_k
+Liver,F015,LIV15,0.0731,negative,0.0108,0.0124,-1.4549,135.0,below_top_k
+Liver,F016,LIV16,0.36,negative,0.0178,0.0205,-0.521,136.0,below_top_k
+Liver,F017,LIV17,0.7729,positive,0.0248,0.0285,0.8233,137.0,below_top_k
+Liver,F018,LIV18,0.9005,positive,0.0318,0.0366,1.2387,138.0,below_top_k
+Liver,F019,LIV19,0.8482,positive,0.0388,0.0446,1.0686,139.0,below_top_k
+Liver,F020,LIV20,0.817,positive,0.0458,0.0527,0.9671,140.0,below_top_k
+Pancreas,F005,PAN05,0.2754,negative,0.0368,0.0423,-0.7962,145.0,below_top_k
+Pancreas,F006,PAN06,0.7052,positive,0.0438,0.0504,0.603,146.0,below_top_k
+Pancreas,F007,PAN07,0.9019,positive,0.0508,0.0584,1.2435,147.0,below_top_k
+Pancreas,F008,PAN08,0.8579,positive,0.0578,0.0665,1.1,148.0,below_top_k
+Pancreas,F009,PAN09,0.8258,positive,0.0648,0.0745,0.9957,149.0,below_top_k
+Pancreas,F010,PAN10,0.6737,positive,0.0718,0.0826,0.5005,150.0,below_top_k
+Pancreas,F011,PAN11,0.2792,negative,0.0788,0.0906,-0.7841,151.0,below_top_k
+Pancreas,F012,PAN12,0.0227,negative,0.0028,0.0032,-1.6191,152.0,below_top_k
+Pancreas,F013,PAN13,0.1582,negative,0.0098,0.0113,-1.1781,153.0,below_top_k
+Pancreas,F014,PAN14,0.3856,negative,0.0168,0.0193,-0.4375,154.0,below_top_k
+Pancreas,F015,PAN15,0.5306,neutral,0.0238,0.0274,0.0345,155.0,below_top_k
+Pancreas,F016,PAN16,0.7842,positive,0.0308,0.0354,0.8602,156.0,below_top_k
+Pancreas,F017,PAN17,1.0294,positive,0.0378,0.0435,1.6586,157.0,below_top_k
+Pancreas,F018,PAN18,0.8969,positive,0.0448,0.0515,1.227,158.0,below_top_k
+Pancreas,F019,PAN19,0.5196,neutral,0.0518,0.0596,-0.0013,159.0,below_top_k
+Pancreas,F020,PAN20,0.3073,negative,0.0588,0.0676,-0.6927,160.0,below_top_k
+Kidney,F005,KID05,0.7216,positive,0.0498,0.0573,0.6564,165.0,below_top_k
+Kidney,F006,KID06,1.001,positive,0.0568,0.0653,1.5661,166.0,below_top_k
+Kidney,F007,KID07,0.9579,positive,0.0638,0.0734,1.4256,167.0,below_top_k
+Kidney,F008,KID08,0.5916,neutral,0.0708,0.0814,0.2331,168.0,below_top_k
+Kidney,F009,KID09,0.3291,negative,0.0778,0.0895,-0.6214,169.0,below_top_k
+Kidney,F010,KID10,0.2389,negative,0.0018,0.0021,-0.9152,170.0,below_top_k
+Kidney,F011,KID11,0.1171,negative,0.0088,0.0101,-1.3117,171.0,below_top_k
+Kidney,F012,KID12,0.1392,negative,0.0158,0.0182,-1.2397,172.0,below_top_k
+Kidney,F013,KID13,0.5069,neutral,0.0228,0.0262,-0.0427,173.0,below_top_k
+Kidney,F014,KID14,0.8734,positive,0.0298,0.0343,1.1508,174.0,below_top_k
+Kidney,F015,KID15,0.9089,positive,0.0368,0.0423,1.2662,175.0,below_top_k
+Kidney,F016,KID16,0.8206,positive,0.0438,0.0504,0.9786,176.0,below_top_k
+Kidney,F017,KID17,0.7491,positive,0.0508,0.0584,0.7457,177.0,below_top_k
+Kidney,F018,KID18,0.4758,neutral,0.0578,0.0665,-0.1439,178.0,below_top_k
+Kidney,F019,KID19,0.0953,negative,0.0648,0.0745,-1.3826,179.0,below_top_k
+Kidney,F020,KID20,0.0414,negative,0.0718,0.0826,-1.5581,180.0,below_top_k
+Bladder,F005,BLA05,0.8336,positive,0.0628,0.0722,1.0212,185.0,below_top_k
+Bladder,F006,BLA06,0.7699,positive,0.0698,0.0803,0.8137,186.0,below_top_k
+Bladder,F007,BLA07,0.5514,neutral,0.0768,0.0883,0.1021,187.0,below_top_k
+Bladder,F008,BLA08,0.1583,negative,0.0008,0.0009,-1.1775,188.0,below_top_k
+Bladder,F009,BLA09,0.0157,negative,0.0078,0.009,-1.6418,189.0,below_top_k
+Bladder,F010,BLA10,0.2404,negative,0.0148,0.017,-0.9105,190.0,below_top_k
+Bladder,F011,BLA11,0.4701,neutral,0.0218,0.0251,-0.1625,191.0,below_top_k
+Bladder,F012,BLA12,0.6202,positive,0.0288,0.0331,0.3263,192.0,below_top_k
+Bladder,F013,BLA13,0.8758,positive,0.0358,0.0412,1.1583,193.0,below_top_k
+Bladder,F014,BLA14,1.029,positive,0.0428,0.0492,1.6572,194.0,below_top_k
+Bladder,F015,BLA15,0.7813,positive,0.0498,0.0573,0.8508,195.0,below_top_k
+Bladder,F016,BLA16,0.4003,negative,0.0568,0.0653,-0.3898,196.0,below_top_k
+Bladder,F017,BLA17,0.2459,negative,0.0638,0.0734,-0.8925,197.0,below_top_k
+Bladder,F018,BLA18,0.183,negative,0.0708,0.0814,-1.0972,198.0,below_top_k
+Bladder,F019,BLA19,0.1118,negative,0.0778,0.0895,-1.3289,199.0,below_top_k
+Bladder,F020,BLA20,0.3064,negative,0.0018,0.0021,-0.6955,200.0,below_top_k
+Stomach,F005,STO05,0.4632,neutral,0.0758,0.0872,-0.1851,205.0,below_top_k
+Stomach,F006,STO06,0.2577,negative,0.0828,0.0952,-0.8541,206.0,below_top_k
+Stomach,F007,STO07,0.2,negative,0.0068,0.0078,-1.0418,207.0,below_top_k
+Stomach,F008,STO08,0.1166,negative,0.0138,0.0159,-1.3133,208.0,below_top_k
+Stomach,F009,STO09,0.2377,negative,0.0208,0.0239,-0.919,209.0,below_top_k
+Stomach,F010,STO10,0.6546,positive,0.0278,0.032,0.4381,210.0,below_top_k
+Stomach,F011,STO11,0.9437,positive,0.0348,0.04,1.3794,211.0,below_top_k
+Stomach,F012,STO12,0.8907,positive,0.0418,0.0481,1.207,212.0,below_top_k
+Stomach,F013,STO13,0.7754,positive,0.0488,0.0561,0.8317,213.0,below_top_k
+Stomach,F014,STO14,0.6618,positive,0.0558,0.0642,0.4616,214.0,below_top_k
+Stomach,F015,STO15,0.3431,negative,0.0628,0.0722,-0.5761,215.0,below_top_k
+Stomach,F016,STO16,0.0257,negative,0.0698,0.0803,-1.6092,216.0,below_top_k
+Stomach,F017,STO17,0.0968,negative,0.0768,0.0883,-1.3778,217.0,below_top_k
+Stomach,F018,STO18,0.396,negative,0.0008,0.0009,-0.4037,218.0,below_top_k
+Stomach,F019,STO19,0.5801,neutral,0.0078,0.009,0.1957,219.0,below_top_k
+Stomach,F020,STO20,0.7499,positive,0.0148,0.017,0.7484,220.0,below_top_k
+Thyroid,F005,THY05,0.0661,negative,0.0058,0.0067,-1.4778,225.0,below_top_k
+Thyroid,F006,THY06,0.0491,negative,0.0128,0.0147,-1.5331,226.0,below_top_k
+Thyroid,F007,THY07,0.3394,negative,0.0198,0.0228,-0.5881,227.0,below_top_k
+Thyroid,F008,THY08,0.5553,neutral,0.0268,0.0308,0.1149,228.0,below_top_k
+Thyroid,F009,THY09,0.7068,positive,0.0338,0.0389,0.6083,229.0,below_top_k
+Thyroid,F010,THY10,0.9432,positive,0.0408,0.0469,1.378,230.0,below_top_k
+Thyroid,F011,THY11,0.987,positive,0.0478,0.055,1.5204,231.0,below_top_k
+Thyroid,F012,THY12,0.6464,positive,0.0548,0.063,0.4117,232.0,below_top_k
+Thyroid,F013,THY13,0.2944,negative,0.0618,0.0711,-0.7344,233.0,below_top_k
+Thyroid,F014,THY14,0.2034,negative,0.0688,0.0791,-1.0308,234.0,below_top_k
+Thyroid,F015,THY15,0.167,negative,0.0758,0.0872,-1.1492,235.0,below_top_k
+Thyroid,F016,THY16,0.1594,negative,0.0828,0.0952,-1.174,236.0,below_top_k
+Thyroid,F017,THY17,0.4438,neutral,0.0068,0.0078,-0.2482,237.0,below_top_k
+Thyroid,F018,THY18,0.8605,positive,0.0138,0.0159,1.1086,238.0,below_top_k
+Thyroid,F019,THY19,0.9674,positive,0.0208,0.0239,1.4566,239.0,below_top_k
+Thyroid,F020,THY20,0.8149,positive,0.0278,0.032,0.96,240.0,below_top_k
+Lung,F002,LUN02,0.919,positive,0.0078,0.009,1.2991,2.0,label_collision
+Lung,F004,LUN04,0.5161,neutral,0.0218,0.0251,-0.0126,4.0,label_collision
+Breast,F002,BRE02,0.5923,neutral,0.0208,0.0239,0.2353,22.0,label_collision
+Breast,F003,BRE03,0.191,negative,0.0278,0.032,-1.0711,23.0,label_collision
+Breast,F004,BRE04,0.1112,negative,0.0348,0.04,-1.3311,24.0,label_collision
+Colon,F002,COL02,0.2033,negative,0.0338,0.0389,-1.0312,42.0,label_collision
+Colon,F003,COL03,0.0147,negative,0.0408,0.0469,-1.645,43.0,label_collision
+Colon,F004,COL04,0.2066,negative,0.0478,0.055,-1.0202,44.0,label_collision
+Melanoma,F002,MEL02,0.2622,negative,0.0468,0.0538,-0.8392,62.0,label_collision
+Melanoma,F004,MEL04,0.6468,positive,0.0608,0.0699,0.4129,64.0,label_collision
+Ovarian,F003,OVA03,0.8456,positive,0.0668,0.0768,1.0602,83.0,label_collision
+Ovarian,F004,OVA04,0.8615,positive,0.0738,0.0849,1.1119,84.0,label_collision
+Prostate,F002,PRO02,1.0362,positive,0.0728,0.0837,1.6807,102.0,label_collision
+Prostate,F003,PRO03,0.9017,positive,0.0798,0.0918,1.2427,103.0,label_collision
+Prostate,F004,PRO04,0.5667,neutral,0.0038,0.0044,0.152,104.0,label_collision
+Liver,F002,LIV02,0.8158,positive,0.0028,0.0032,0.9631,122.0,label_collision
+Liver,F004,LIV04,0.1145,negative,0.0168,0.0193,-1.3203,124.0,label_collision
+Pancreas,F002,PAN02,0.3121,negative,0.0158,0.0182,-0.6769,142.0,label_collision
+Pancreas,F003,PAN03,0.181,negative,0.0228,0.0262,-1.1039,143.0,label_collision
+Pancreas,F004,PAN04,0.0648,negative,0.0298,0.0343,-1.482,144.0,label_collision
+Kidney,F002,KID02,0.1084,negative,0.0288,0.0331,-1.34,162.0,label_collision
+Kidney,F004,KID04,0.5012,neutral,0.0428,0.0492,-0.0612,164.0,label_collision
+Bladder,F003,BLA03,0.8243,positive,0.0488,0.0561,0.9909,183.0,label_collision
+Bladder,F004,BLA04,0.9252,positive,0.0558,0.0642,1.3192,184.0,label_collision
+Stomach,F002,STO02,0.818,positive,0.0548,0.063,0.9703,202.0,label_collision
+Stomach,F003,STO03,1.0264,positive,0.0618,0.0711,1.6487,203.0,label_collision
+Stomach,F004,STO04,0.8591,positive,0.0688,0.0791,1.104,204.0,label_collision
+Thyroid,F002,THY02,0.7915,positive,0.0678,0.078,0.884,222.0,label_collision
+Thyroid,F004,THY04,0.4222,neutral,0.0818,0.0941,-0.3183,224.0,label_collision
+Melanoma,F003,MEL03,0.3676,negative,0.0538,0.0619,-0.4961,63.0,display_bbox_overlap_gt_0.01
+Ovarian,F002,OVA02,0.7232,positive,0.0598,0.0688,0.6617,82.0,display_bbox_overlap_gt_0.01
+Bladder,F002,BLA02,0.4149,negative,0.0418,0.0481,-0.3423,182.0,display_bbox_overlap_gt_0.01
+Thyroid,F003,THY03,0.6948,positive,0.0748,0.086,0.5692,223.0,display_bbox_overlap_gt_0.01
diff --git a/examples/circos_v2/circos_v2_90mm.svg b/examples/circos_v2/circos_v2_90mm.svg
new file mode 100644
index 0000000..29b638c
--- /dev/null
+++ b/examples/circos_v2/circos_v2_90mm.svg
@@ -0,0 +1,12715 @@
+
+
+
diff --git a/examples/circos_v2/features.csv b/examples/circos_v2/features.csv
new file mode 100644
index 0000000..ad70a86
--- /dev/null
+++ b/examples/circos_v2/features.csv
@@ -0,0 +1,241 @@
+sector,feature_id,label,score,direction,fdr,p_value,effect_size,rank,study_id
+Lung,F001,LUN01,1.0105,positive,0.0008,0.0009,1.5971,1,DEMO-01-001
+Lung,F002,LUN02,0.919,positive,0.0078,0.009,1.2991,2,DEMO-01-002
+Lung,F003,LUN03,0.6688,positive,0.0148,0.017,0.4846,3,DEMO-01-003
+Lung,F004,LUN04,0.5161,neutral,0.0218,0.0251,-0.0126,4,DEMO-01-004
+Lung,F005,LUN05,0.2953,negative,0.0288,0.0331,-0.7314,5,DEMO-01-005
+Lung,F006,LUN06,0.0312,negative,0.0358,0.0412,-1.5915,6,DEMO-01-006
+Lung,F007,LUN07,0.101,negative,0.0428,0.0492,-1.364,7,DEMO-01-007
+Lung,F008,LUN08,0.4781,neutral,0.0498,0.0573,-0.1363,8,DEMO-01-008
+Lung,F009,LUN09,0.7319,positive,0.0568,0.0653,0.6899,9,DEMO-01-009
+Lung,F010,LUN10,0.8127,positive,0.0638,0.0734,0.9531,10,DEMO-01-010
+Lung,F011,LUN11,0.9232,positive,0.0708,0.0814,1.3127,11,DEMO-01-011
+Lung,F012,LUN12,0.8798,positive,0.0778,0.0895,1.1714,12,DEMO-01-012
+Lung,F013,LUN13,0.4997,neutral,0.0018,0.0021,-0.0659,13,DEMO-01-013
+Lung,F014,LUN14,0.1461,negative,0.0088,0.0101,-1.2174,14,DEMO-01-014
+Lung,F015,LUN15,0.1308,negative,0.0158,0.0182,-1.2672,15,DEMO-01-015
+Lung,F016,LUN16,0.23,negative,0.0228,0.0262,-0.9441,16,DEMO-01-016
+Lung,F017,LUN17,0.3122,negative,0.0298,0.0343,-0.6764,17,DEMO-01-017
+Lung,F018,LUN18,0.5946,neutral,0.0368,0.0423,0.2429,18,DEMO-01-018
+Lung,F019,LUN19,0.9633,positive,0.0438,0.0504,1.4434,19,DEMO-01-019
+Lung,F020,LUN20,0.9907,positive,0.0508,0.0584,1.5325,20,DEMO-01-020
+Breast,F001,BRE01,0.9161,positive,0.0138,0.0159,1.2895,21,DEMO-02-001
+Breast,F002,BRE02,0.5923,neutral,0.0208,0.0239,0.2353,22,DEMO-02-002
+Breast,F003,BRE03,0.191,negative,0.0278,0.032,-1.0711,23,DEMO-02-003
+Breast,F004,BRE04,0.1112,negative,0.0348,0.04,-1.3311,24,DEMO-02-004
+Breast,F005,BRE05,0.2153,negative,0.0418,0.0481,-0.9919,25,DEMO-02-005
+Breast,F006,BRE06,0.2888,negative,0.0488,0.0561,-0.7527,26,DEMO-02-006
+Breast,F007,BRE07,0.5183,neutral,0.0558,0.0642,-0.0055,27,DEMO-02-007
+Breast,F008,BRE08,0.9047,positive,0.0628,0.0722,1.2524,28,DEMO-02-008
+Breast,F009,BRE09,1.0215,positive,0.0698,0.0803,1.6328,29,DEMO-02-009
+Breast,F010,BRE10,0.7787,positive,0.0768,0.0883,0.8424,30,DEMO-02-010
+Breast,F011,BRE11,0.5473,neutral,0.0008,0.0009,0.0887,31,DEMO-02-011
+Breast,F012,BRE12,0.3975,negative,0.0078,0.009,-0.3989,32,DEMO-02-012
+Breast,F013,BRE13,0.148,negative,0.0148,0.017,-1.2113,33,DEMO-02-013
+Breast,F014,BRE14,0.0177,negative,0.0218,0.0251,-1.6354,34,DEMO-02-014
+Breast,F015,BRE15,0.2872,negative,0.0288,0.0331,-0.758,35,DEMO-02-015
+Breast,F016,BRE16,0.667,positive,0.0358,0.0412,0.4785,36,DEMO-02-016
+Breast,F017,BRE17,0.8085,positive,0.0428,0.0492,0.9394,37,DEMO-02-017
+Breast,F018,BRE18,0.8617,positive,0.0498,0.0573,1.1126,38,DEMO-02-018
+Breast,F019,BRE19,0.9175,positive,0.0568,0.0653,1.2941,39,DEMO-02-019
+Breast,F020,BRE20,0.7036,positive,0.0638,0.0734,0.5978,40,DEMO-02-020
+Colon,F001,COL01,0.4311,neutral,0.0268,0.0308,-0.2896,41,DEMO-03-001
+Colon,F002,COL02,0.2033,negative,0.0338,0.0389,-1.0312,42,DEMO-03-002
+Colon,F003,COL03,0.0147,negative,0.0408,0.0469,-1.645,43,DEMO-03-003
+Colon,F004,COL04,0.2066,negative,0.0478,0.055,-1.0202,44,DEMO-03-004
+Colon,F005,COL05,0.6061,neutral,0.0548,0.063,0.2805,45,DEMO-03-005
+Colon,F006,COL06,0.7991,positive,0.0618,0.0711,0.9088,46,DEMO-03-006
+Colon,F007,COL07,0.8465,positive,0.0688,0.0791,1.0632,47,DEMO-03-007
+Colon,F008,COL08,0.9166,positive,0.0758,0.0872,1.2913,48,DEMO-03-008
+Colon,F009,COL09,0.7754,positive,0.0828,0.0952,0.8314,49,DEMO-03-009
+Colon,F010,COL10,0.3535,negative,0.0068,0.0078,-0.5421,50,DEMO-03-010
+Colon,F011,COL11,0.0831,negative,0.0138,0.0159,-1.4223,51,DEMO-03-011
+Colon,F012,COL12,0.1555,negative,0.0208,0.0239,-1.1867,52,DEMO-03-012
+Colon,F013,COL13,0.2797,negative,0.0278,0.032,-0.7825,53,DEMO-03-013
+Colon,F014,COL14,0.4028,negative,0.0348,0.04,-0.3815,54,DEMO-03-014
+Colon,F015,COL15,0.7253,positive,0.0418,0.0481,0.6686,55,DEMO-03-015
+Colon,F016,COL16,1.0244,positive,0.0488,0.0561,1.6423,56,DEMO-03-016
+Colon,F017,COL17,0.9274,positive,0.0558,0.0642,1.3264,57,DEMO-03-017
+Colon,F018,COL18,0.6194,positive,0.0628,0.0722,0.3235,58,DEMO-03-018
+Colon,F019,COL19,0.438,neutral,0.0698,0.0803,-0.2669,59,DEMO-03-019
+Colon,F020,COL20,0.271,negative,0.0768,0.0883,-0.8105,60,DEMO-03-020
+Melanoma,F001,MEL01,0.1245,negative,0.0398,0.0458,-1.2877,61,DEMO-04-001
+Melanoma,F002,MEL02,0.2622,negative,0.0468,0.0538,-0.8392,62,DEMO-04-002
+Melanoma,F003,MEL03,0.3676,negative,0.0538,0.0619,-0.4961,63,DEMO-04-003
+Melanoma,F004,MEL04,0.6468,positive,0.0608,0.0699,0.4129,64,DEMO-04-004
+Melanoma,F005,MEL05,0.9894,positive,0.0678,0.078,1.5282,65,DEMO-04-005
+Melanoma,F006,MEL06,0.9794,positive,0.0748,0.086,1.4957,66,DEMO-04-006
+Melanoma,F007,MEL07,0.6761,positive,0.0818,0.0941,0.5083,67,DEMO-04-007
+Melanoma,F008,MEL08,0.4622,neutral,0.0058,0.0067,-0.1881,68,DEMO-04-008
+Melanoma,F009,MEL09,0.3133,negative,0.0128,0.0147,-0.673,69,DEMO-04-009
+Melanoma,F010,MEL10,0.0874,negative,0.0198,0.0228,-1.4085,70,DEMO-04-010
+Melanoma,F011,MEL11,0.0685,negative,0.0268,0.0308,-1.47,71,DEMO-04-011
+Melanoma,F012,MEL12,0.4252,neutral,0.0338,0.0389,-0.3087,72,DEMO-04-012
+Melanoma,F013,MEL13,0.7692,positive,0.0408,0.0469,0.8115,73,DEMO-04-013
+Melanoma,F014,MEL14,0.8458,positive,0.0478,0.055,1.0608,74,DEMO-04-014
+Melanoma,F015,MEL15,0.8719,positive,0.0548,0.063,1.1457,75,DEMO-04-015
+Melanoma,F016,MEL16,0.8631,positive,0.0618,0.0711,1.1171,76,DEMO-04-016
+Melanoma,F017,MEL17,0.5637,neutral,0.0688,0.0791,0.1424,77,DEMO-04-017
+Melanoma,F018,MEL18,0.1553,negative,0.0758,0.0872,-1.1872,78,DEMO-04-018
+Melanoma,F019,MEL19,0.0721,negative,0.0828,0.0952,-1.4584,79,DEMO-04-019
+Melanoma,F020,MEL20,0.2388,negative,0.0068,0.0078,-0.9154,80,DEMO-04-020
+Ovarian,F001,OVA01,0.3367,negative,0.0528,0.0607,-0.5967,81,DEMO-05-001
+Ovarian,F002,OVA02,0.7232,positive,0.0598,0.0688,0.6617,82,DEMO-05-002
+Ovarian,F003,OVA03,0.8456,positive,0.0668,0.0768,1.0602,83,DEMO-05-003
+Ovarian,F004,OVA04,0.8615,positive,0.0738,0.0849,1.1119,84,DEMO-05-004
+Ovarian,F005,OVA05,0.8805,positive,0.0808,0.0929,1.1737,85,DEMO-05-005
+Ovarian,F006,OVA06,0.6479,positive,0.0048,0.0055,0.4163,86,DEMO-05-006
+Ovarian,F007,OVA07,0.2214,negative,0.0118,0.0136,-0.9721,87,DEMO-05-007
+Ovarian,F008,OVA08,0.0558,negative,0.0188,0.0216,-1.5112,88,DEMO-05-008
+Ovarian,F009,OVA09,0.2034,negative,0.0258,0.0297,-1.0307,89,DEMO-05-009
+Ovarian,F010,OVA10,0.3436,negative,0.0328,0.0377,-0.5742,90,DEMO-05-010
+Ovarian,F011,OVA11,0.506,neutral,0.0398,0.0458,-0.0457,91,DEMO-05-011
+Ovarian,F012,OVA12,0.8432,positive,0.0468,0.0538,1.0522,92,DEMO-05-012
+Ovarian,F013,OVA13,1.0444,positive,0.0538,0.0619,1.7072,93,DEMO-05-013
+Ovarian,F014,OVA14,0.8339,positive,0.0608,0.0699,1.022,94,DEMO-05-014
+Ovarian,F015,OVA15,0.5157,neutral,0.0678,0.078,-0.0141,95,DEMO-05-015
+Ovarian,F016,OVA16,0.3612,negative,0.0748,0.086,-0.517,96,DEMO-05-016
+Ovarian,F017,OVA17,0.1987,negative,0.0818,0.0941,-1.0462,97,DEMO-05-017
+Ovarian,F018,OVA18,0.0437,negative,0.0058,0.0067,-1.5506,98,DEMO-05-018
+Ovarian,F019,OVA19,0.2261,negative,0.0128,0.0147,-0.9568,99,DEMO-05-019
+Ovarian,F020,OVA20,0.6492,positive,0.0198,0.0228,0.4207,100,DEMO-05-020
+Prostate,F001,PRO01,0.7696,positive,0.0658,0.0757,0.8125,101,DEMO-06-001
+Prostate,F002,PRO02,1.0362,positive,0.0728,0.0837,1.6807,102,DEMO-06-002
+Prostate,F003,PRO03,0.9017,positive,0.0798,0.0918,1.2427,103,DEMO-06-003
+Prostate,F004,PRO04,0.5667,neutral,0.0038,0.0044,0.152,104,DEMO-06-004
+Prostate,F005,PRO05,0.3825,negative,0.0108,0.0124,-0.4477,105,DEMO-06-005
+Prostate,F006,PRO06,0.2393,negative,0.0178,0.0205,-0.9139,106,DEMO-06-006
+Prostate,F007,PRO07,0.0584,negative,0.0248,0.0285,-1.5028,107,DEMO-06-007
+Prostate,F008,PRO08,0.1568,negative,0.0318,0.0366,-1.1827,108,DEMO-06-008
+Prostate,F009,PRO09,0.5685,neutral,0.0388,0.0446,0.1578,109,DEMO-06-009
+Prostate,F010,PRO10,0.8492,positive,0.0458,0.0527,1.0717,110,DEMO-06-010
+Prostate,F011,PRO11,0.8623,positive,0.0528,0.0607,1.1143,111,DEMO-06-011
+Prostate,F012,PRO12,0.8601,positive,0.0598,0.0688,1.1072,112,DEMO-06-012
+Prostate,F013,PRO13,0.7801,positive,0.0668,0.0768,0.8469,113,DEMO-06-013
+Prostate,F014,PRO14,0.4182,negative,0.0738,0.0849,-0.3314,114,DEMO-06-014
+Prostate,F015,PRO15,0.0703,negative,0.0808,0.0929,-1.464,115,DEMO-06-015
+Prostate,F016,PRO16,0.1001,negative,0.0048,0.0055,-1.3671,116,DEMO-06-016
+Prostate,F017,PRO17,0.3069,negative,0.0118,0.0136,-0.694,117,DEMO-06-017
+Prostate,F018,PRO18,0.4434,neutral,0.0188,0.0216,-0.2495,118,DEMO-06-018
+Prostate,F019,PRO19,0.6766,positive,0.0258,0.0297,0.51,119,DEMO-06-019
+Prostate,F020,PRO20,0.9889,positive,0.0328,0.0377,1.5265,120,DEMO-06-020
+Liver,F001,LIV01,0.8562,positive,0.0788,0.0906,1.0946,121,DEMO-07-001
+Liver,F002,LIV02,0.8158,positive,0.0028,0.0032,0.9631,122,DEMO-07-002
+Liver,F003,LIV03,0.5073,neutral,0.0098,0.0113,-0.0414,123,DEMO-07-003
+Liver,F004,LIV04,0.1145,negative,0.0168,0.0193,-1.3203,124,DEMO-07-004
+Liver,F005,LIV05,0.065,negative,0.0238,0.0274,-1.4814,125,DEMO-07-005
+Liver,F006,LIV06,0.27,negative,0.0308,0.0354,-0.814,126,DEMO-07-006
+Liver,F007,LIV07,0.4187,negative,0.0378,0.0435,-0.3297,127,DEMO-07-007
+Liver,F008,LIV08,0.6148,neutral,0.0448,0.0515,0.3088,128,DEMO-07-008
+Liver,F009,LIV09,0.9379,positive,0.0518,0.0596,1.3606,129,DEMO-07-009
+Liver,F010,LIV10,1.0215,positive,0.0588,0.0676,1.6327,130,DEMO-07-010
+Liver,F011,LIV11,0.7187,positive,0.0658,0.0757,0.6468,131,DEMO-07-011
+Liver,F012,LIV12,0.4168,negative,0.0728,0.0837,-0.3359,132,DEMO-07-012
+Liver,F013,LIV13,0.2937,negative,0.0798,0.0918,-0.7369,133,DEMO-07-013
+Liver,F014,LIV14,0.1457,negative,0.0038,0.0044,-1.2187,134,DEMO-07-014
+Liver,F015,LIV15,0.0731,negative,0.0108,0.0124,-1.4549,135,DEMO-07-015
+Liver,F016,LIV16,0.36,negative,0.0178,0.0205,-0.521,136,DEMO-07-016
+Liver,F017,LIV17,0.7729,positive,0.0248,0.0285,0.8233,137,DEMO-07-017
+Liver,F018,LIV18,0.9005,positive,0.0318,0.0366,1.2387,138,DEMO-07-018
+Liver,F019,LIV19,0.8482,positive,0.0388,0.0446,1.0686,139,DEMO-07-019
+Liver,F020,LIV20,0.817,positive,0.0458,0.0527,0.9671,140,DEMO-07-020
+Pancreas,F001,PAN01,0.4587,neutral,0.0088,0.0101,-0.1996,141,DEMO-08-001
+Pancreas,F002,PAN02,0.3121,negative,0.0158,0.0182,-0.6769,142,DEMO-08-002
+Pancreas,F003,PAN03,0.181,negative,0.0228,0.0262,-1.1039,143,DEMO-08-003
+Pancreas,F004,PAN04,0.0648,negative,0.0298,0.0343,-1.482,144,DEMO-08-004
+Pancreas,F005,PAN05,0.2754,negative,0.0368,0.0423,-0.7962,145,DEMO-08-005
+Pancreas,F006,PAN06,0.7052,positive,0.0438,0.0504,0.603,146,DEMO-08-006
+Pancreas,F007,PAN07,0.9019,positive,0.0508,0.0584,1.2435,147,DEMO-08-007
+Pancreas,F008,PAN08,0.8579,positive,0.0578,0.0665,1.1,148,DEMO-08-008
+Pancreas,F009,PAN09,0.8258,positive,0.0648,0.0745,0.9957,149,DEMO-08-009
+Pancreas,F010,PAN10,0.6737,positive,0.0718,0.0826,0.5005,150,DEMO-08-010
+Pancreas,F011,PAN11,0.2792,negative,0.0788,0.0906,-0.7841,151,DEMO-08-011
+Pancreas,F012,PAN12,0.0227,negative,0.0028,0.0032,-1.6191,152,DEMO-08-012
+Pancreas,F013,PAN13,0.1582,negative,0.0098,0.0113,-1.1781,153,DEMO-08-013
+Pancreas,F014,PAN14,0.3856,negative,0.0168,0.0193,-0.4375,154,DEMO-08-014
+Pancreas,F015,PAN15,0.5306,neutral,0.0238,0.0274,0.0345,155,DEMO-08-015
+Pancreas,F016,PAN16,0.7842,positive,0.0308,0.0354,0.8602,156,DEMO-08-016
+Pancreas,F017,PAN17,1.0294,positive,0.0378,0.0435,1.6586,157,DEMO-08-017
+Pancreas,F018,PAN18,0.8969,positive,0.0448,0.0515,1.227,158,DEMO-08-018
+Pancreas,F019,PAN19,0.5196,neutral,0.0518,0.0596,-0.0013,159,DEMO-08-019
+Pancreas,F020,PAN20,0.3073,negative,0.0588,0.0676,-0.6927,160,DEMO-08-020
+Kidney,F001,KID01,0.0413,negative,0.0218,0.0251,-1.5585,161,DEMO-09-001
+Kidney,F002,KID02,0.1084,negative,0.0288,0.0331,-1.34,162,DEMO-09-002
+Kidney,F003,KID03,0.3499,negative,0.0358,0.0412,-0.5538,163,DEMO-09-003
+Kidney,F004,KID04,0.5012,neutral,0.0428,0.0492,-0.0612,164,DEMO-09-004
+Kidney,F005,KID05,0.7216,positive,0.0498,0.0573,0.6564,165,DEMO-09-005
+Kidney,F006,KID06,1.001,positive,0.0568,0.0653,1.5661,166,DEMO-09-006
+Kidney,F007,KID07,0.9579,positive,0.0638,0.0734,1.4256,167,DEMO-09-007
+Kidney,F008,KID08,0.5916,neutral,0.0708,0.0814,0.2331,168,DEMO-09-008
+Kidney,F009,KID09,0.3291,negative,0.0778,0.0895,-0.6214,169,DEMO-09-009
+Kidney,F010,KID10,0.2389,negative,0.0018,0.0021,-0.9152,170,DEMO-09-010
+Kidney,F011,KID11,0.1171,negative,0.0088,0.0101,-1.3117,171,DEMO-09-011
+Kidney,F012,KID12,0.1392,negative,0.0158,0.0182,-1.2397,172,DEMO-09-012
+Kidney,F013,KID13,0.5069,neutral,0.0228,0.0262,-0.0427,173,DEMO-09-013
+Kidney,F014,KID14,0.8734,positive,0.0298,0.0343,1.1508,174,DEMO-09-014
+Kidney,F015,KID15,0.9089,positive,0.0368,0.0423,1.2662,175,DEMO-09-015
+Kidney,F016,KID16,0.8206,positive,0.0438,0.0504,0.9786,176,DEMO-09-016
+Kidney,F017,KID17,0.7491,positive,0.0508,0.0584,0.7457,177,DEMO-09-017
+Kidney,F018,KID18,0.4758,neutral,0.0578,0.0665,-0.1439,178,DEMO-09-018
+Kidney,F019,KID19,0.0953,negative,0.0648,0.0745,-1.3826,179,DEMO-09-019
+Kidney,F020,KID20,0.0414,negative,0.0718,0.0826,-1.5581,180,DEMO-09-020
+Bladder,F001,BLA01,0.1075,negative,0.0348,0.04,-1.343,181,DEMO-10-001
+Bladder,F002,BLA02,0.4149,negative,0.0418,0.0481,-0.3423,182,DEMO-10-002
+Bladder,F003,BLA03,0.8243,positive,0.0488,0.0561,0.9909,183,DEMO-10-003
+Bladder,F004,BLA04,0.9252,positive,0.0558,0.0642,1.3192,184,DEMO-10-004
+Bladder,F005,BLA05,0.8336,positive,0.0628,0.0722,1.0212,185,DEMO-10-005
+Bladder,F006,BLA06,0.7699,positive,0.0698,0.0803,0.8137,186,DEMO-10-006
+Bladder,F007,BLA07,0.5514,neutral,0.0768,0.0883,0.1021,187,DEMO-10-007
+Bladder,F008,BLA08,0.1583,negative,0.0008,0.0009,-1.1775,188,DEMO-10-008
+Bladder,F009,BLA09,0.0157,negative,0.0078,0.009,-1.6418,189,DEMO-10-009
+Bladder,F010,BLA10,0.2404,negative,0.0148,0.017,-0.9105,190,DEMO-10-010
+Bladder,F011,BLA11,0.4701,neutral,0.0218,0.0251,-0.1625,191,DEMO-10-011
+Bladder,F012,BLA12,0.6202,positive,0.0288,0.0331,0.3263,192,DEMO-10-012
+Bladder,F013,BLA13,0.8758,positive,0.0358,0.0412,1.1583,193,DEMO-10-013
+Bladder,F014,BLA14,1.029,positive,0.0428,0.0492,1.6572,194,DEMO-10-014
+Bladder,F015,BLA15,0.7813,positive,0.0498,0.0573,0.8508,195,DEMO-10-015
+Bladder,F016,BLA16,0.4003,negative,0.0568,0.0653,-0.3898,196,DEMO-10-016
+Bladder,F017,BLA17,0.2459,negative,0.0638,0.0734,-0.8925,197,DEMO-10-017
+Bladder,F018,BLA18,0.183,negative,0.0708,0.0814,-1.0972,198,DEMO-10-018
+Bladder,F019,BLA19,0.1118,negative,0.0778,0.0895,-1.3289,199,DEMO-10-019
+Bladder,F020,BLA20,0.3064,negative,0.0018,0.0021,-0.6955,200,DEMO-10-020
+Stomach,F001,STO01,0.5867,neutral,0.0478,0.055,0.2173,201,DEMO-11-001
+Stomach,F002,STO02,0.818,positive,0.0548,0.063,0.9703,202,DEMO-11-002
+Stomach,F003,STO03,1.0264,positive,0.0618,0.0711,1.6487,203,DEMO-11-003
+Stomach,F004,STO04,0.8591,positive,0.0688,0.0791,1.104,204,DEMO-11-004
+Stomach,F005,STO05,0.4632,neutral,0.0758,0.0872,-0.1851,205,DEMO-11-005
+Stomach,F006,STO06,0.2577,negative,0.0828,0.0952,-0.8541,206,DEMO-11-006
+Stomach,F007,STO07,0.2,negative,0.0068,0.0078,-1.0418,207,DEMO-11-007
+Stomach,F008,STO08,0.1166,negative,0.0138,0.0159,-1.3133,208,DEMO-11-008
+Stomach,F009,STO09,0.2377,negative,0.0208,0.0239,-0.919,209,DEMO-11-009
+Stomach,F010,STO10,0.6546,positive,0.0278,0.032,0.4381,210,DEMO-11-010
+Stomach,F011,STO11,0.9437,positive,0.0348,0.04,1.3794,211,DEMO-11-011
+Stomach,F012,STO12,0.8907,positive,0.0418,0.0481,1.207,212,DEMO-11-012
+Stomach,F013,STO13,0.7754,positive,0.0488,0.0561,0.8317,213,DEMO-11-013
+Stomach,F014,STO14,0.6618,positive,0.0558,0.0642,0.4616,214,DEMO-11-014
+Stomach,F015,STO15,0.3431,negative,0.0628,0.0722,-0.5761,215,DEMO-11-015
+Stomach,F016,STO16,0.0257,negative,0.0698,0.0803,-1.6092,216,DEMO-11-016
+Stomach,F017,STO17,0.0968,negative,0.0768,0.0883,-1.3778,217,DEMO-11-017
+Stomach,F018,STO18,0.396,negative,0.0008,0.0009,-0.4037,218,DEMO-11-018
+Stomach,F019,STO19,0.5801,neutral,0.0078,0.009,0.1957,219,DEMO-11-019
+Stomach,F020,STO20,0.7499,positive,0.0148,0.017,0.7484,220,DEMO-11-020
+Thyroid,F001,THY01,0.9189,positive,0.0608,0.0699,1.2987,221,DEMO-12-001
+Thyroid,F002,THY02,0.7915,positive,0.0678,0.078,0.884,222,DEMO-12-002
+Thyroid,F003,THY03,0.6948,positive,0.0748,0.086,0.5692,223,DEMO-12-003
+Thyroid,F004,THY04,0.4222,neutral,0.0818,0.0941,-0.3183,224,DEMO-12-004
+Thyroid,F005,THY05,0.0661,negative,0.0058,0.0067,-1.4778,225,DEMO-12-005
+Thyroid,F006,THY06,0.0491,negative,0.0128,0.0147,-1.5331,226,DEMO-12-006
+Thyroid,F007,THY07,0.3394,negative,0.0198,0.0228,-0.5881,227,DEMO-12-007
+Thyroid,F008,THY08,0.5553,neutral,0.0268,0.0308,0.1149,228,DEMO-12-008
+Thyroid,F009,THY09,0.7068,positive,0.0338,0.0389,0.6083,229,DEMO-12-009
+Thyroid,F010,THY10,0.9432,positive,0.0408,0.0469,1.378,230,DEMO-12-010
+Thyroid,F011,THY11,0.987,positive,0.0478,0.055,1.5204,231,DEMO-12-011
+Thyroid,F012,THY12,0.6464,positive,0.0548,0.063,0.4117,232,DEMO-12-012
+Thyroid,F013,THY13,0.2944,negative,0.0618,0.0711,-0.7344,233,DEMO-12-013
+Thyroid,F014,THY14,0.2034,negative,0.0688,0.0791,-1.0308,234,DEMO-12-014
+Thyroid,F015,THY15,0.167,negative,0.0758,0.0872,-1.1492,235,DEMO-12-015
+Thyroid,F016,THY16,0.1594,negative,0.0828,0.0952,-1.174,236,DEMO-12-016
+Thyroid,F017,THY17,0.4438,neutral,0.0068,0.0078,-0.2482,237,DEMO-12-017
+Thyroid,F018,THY18,0.8605,positive,0.0138,0.0159,1.1086,238,DEMO-12-018
+Thyroid,F019,THY19,0.9674,positive,0.0208,0.0239,1.4566,239,DEMO-12-019
+Thyroid,F020,THY20,0.8149,positive,0.0278,0.032,0.96,240,DEMO-12-020
diff --git a/examples/circos_v2/figure_qc.json b/examples/circos_v2/figure_qc.json
new file mode 100644
index 0000000..e09e1ff
--- /dev/null
+++ b/examples/circos_v2/figure_qc.json
@@ -0,0 +1,34 @@
+[
+ {
+ "file": "examples/circos_v2/circos_v2_180mm.png",
+ "kind": "FINAL_FIGURE",
+ "status": "PASS",
+ "mode": "RGB",
+ "width_px": 4251,
+ "height_px": 4251,
+ "dpi_x": 600.0,
+ "dpi_y": 600.0,
+ "rgb_ok": true,
+ "dpi_ok": true,
+ "pdf_ok": true,
+ "svg_ok": true,
+ "sha256": "1cd959dce49fe7707281eea4505a3da350fc0408e7c9110c461036b756431988",
+ "size_mb": 1.946
+ },
+ {
+ "file": "examples/circos_v2/circos_v2_90mm.png",
+ "kind": "FINAL_FIGURE",
+ "status": "PASS",
+ "mode": "RGB",
+ "width_px": 2125,
+ "height_px": 2125,
+ "dpi_x": 600.0,
+ "dpi_y": 600.0,
+ "rgb_ok": true,
+ "dpi_ok": true,
+ "pdf_ok": true,
+ "svg_ok": true,
+ "sha256": "c778ab28781fe8662dbb230b9955f945dd7722d10115fdce6f77fd497a460ad2",
+ "size_mb": 0.901
+ }
+]
diff --git a/examples/circos_v2/figure_qc.tsv b/examples/circos_v2/figure_qc.tsv
new file mode 100644
index 0000000..12a2706
--- /dev/null
+++ b/examples/circos_v2/figure_qc.tsv
@@ -0,0 +1,3 @@
+dpi_ok dpi_x dpi_y file height_px kind mode pdf_ok rgb_ok sha256 size_mb status svg_ok width_px
+True 600.0 600.0 examples/circos_v2/circos_v2_180mm.png 4251 FINAL_FIGURE RGB True True 1cd959dce49fe7707281eea4505a3da350fc0408e7c9110c461036b756431988 1.946 PASS True 4251
+True 600.0 600.0 examples/circos_v2/circos_v2_90mm.png 2125 FINAL_FIGURE RGB True True c778ab28781fe8662dbb230b9955f945dd7722d10115fdce6f77fd497a460ad2 0.901 PASS True 2125
diff --git a/examples/circos_v2/links.csv b/examples/circos_v2/links.csv
new file mode 100644
index 0000000..dae9d0c
--- /dev/null
+++ b/examples/circos_v2/links.csv
@@ -0,0 +1,22 @@
+from_sector,from_feature,to_sector,to_feature,weight,link_type
+Lung,F001,Liver,F001,1.2,shared_feature
+Breast,F001,Pancreas,F001,1.0,shared_feature
+Colon,F001,Kidney,F001,0.8,shared_feature
+Melanoma,F001,Bladder,F001,0.6,shared_feature
+Ovarian,F001,Stomach,F001,1.6,shared_feature
+Prostate,F001,Thyroid,F001,1.4,shared_feature
+Lung,F002,Pancreas,F002,1.6,shared_feature
+Breast,F002,Kidney,F002,1.4,shared_feature
+Colon,F002,Bladder,F002,1.2,shared_feature
+Melanoma,F002,Stomach,F002,1.0,shared_feature
+Ovarian,F002,Thyroid,F002,0.8,shared_feature
+Lung,F003,Kidney,F003,0.8,shared_feature
+Breast,F003,Bladder,F003,0.6,shared_feature
+Colon,F003,Stomach,F003,1.6,shared_feature
+Melanoma,F003,Thyroid,F003,1.4,shared_feature
+Lung,F004,Bladder,F004,1.2,shared_feature
+Breast,F004,Stomach,F004,1.0,shared_feature
+Colon,F004,Thyroid,F004,0.8,shared_feature
+Lung,F005,Stomach,F005,1.6,shared_feature
+Breast,F005,Thyroid,F005,1.4,shared_feature
+Lung,F006,Thyroid,F006,0.8,shared_feature
diff --git a/examples/circos_v2/sectors.csv b/examples/circos_v2/sectors.csv
new file mode 100644
index 0000000..b37ad6a
--- /dev/null
+++ b/examples/circos_v2/sectors.csv
@@ -0,0 +1,13 @@
+sector,display_name,order
+Lung,Lung,0
+Breast,Breast,1
+Colon,Colorectal,2
+Melanoma,Melanoma,3
+Ovarian,Ovarian,4
+Prostate,Prostate,5
+Liver,Liver,6
+Pancreas,Pancreas,7
+Kidney,Kidney,8
+Bladder,Bladder,9
+Stomach,Stomach,10
+Thyroid,Thyroid,11
diff --git a/gallery/README.md b/gallery/README.md
new file mode 100644
index 0000000..badf71b
--- /dev/null
+++ b/gallery/README.md
@@ -0,0 +1,3 @@
+# Circos V2 visual comparison
+
+Left: user-supplied target crop. Center: preserved failed V1 repository output. Right: V2 render using deterministic synthetic demonstration tables; it is labeled as synthetic and must not be cited as biological evidence. Use the high-resolution 90 mm or 180 mm PDF/SVG/PNG outputs under `examples/circos_v2/` for print review.
diff --git a/gallery/circos_v2_comparison.png b/gallery/circos_v2_comparison.png
new file mode 100644
index 0000000..4361008
Binary files /dev/null and b/gallery/circos_v2_comparison.png differ
diff --git a/references/plot-catalog.md b/references/plot-catalog.md
index efb24d6..4681655 100644
--- a/references/plot-catalog.md
+++ b/references/plot-catalog.md
@@ -1,6 +1,6 @@
# Plot catalog
-The bundled renderer exposes 128 deterministic recipe names. They are grouped by evidence morphology rather than by a single software package. A recipe can be rebuilt from project-native source data; the renderer’s built-in data are smoke-test data only.
+The bundled renderer exposes 129 recipe names. Most catalog entries are deterministic smoke-test renderers; `circos_lollipop_chord` is a data-driven recipe and requires input tables.
## Selection rule
@@ -38,7 +38,31 @@ Choose the smallest recipe that answers the panel question. Keep raw observation
### Genomics, spatial, and mechanism
-`protein_track`, `mutation_lollipop`, `genome_track`, `chromosome_ideogram`, `circos_overview`, `variant_burden`, `allele_frequency_spectrum`, `spatial_feature`, `spatial_grid`, `spatial_hexbin`, `spatial_dotplot`, `image_quantification`, `cell_type_composition`, `ligand_receptor_lollipop`, `mechanism_schematic`, `graphical_abstract`
+`protein_track`, `mutation_lollipop`, `genome_track`, `chromosome_ideogram`, `circos_overview`, `circos_lollipop_chord`, `variant_burden`, `allele_frequency_spectrum`, `spatial_feature`, `spatial_grid`, `spatial_hexbin`, `spatial_dotplot`, `image_quantification`, `cell_type_composition`, `ligand_receptor_lollipop`, `mechanism_schematic`, `graphical_abstract`
+
+## Data-driven Circos composite
+
+`circos_lollipop_chord` consumes feature-level V2 tables and draws score lollipops, a single pale sector-name ring, prioritized collision-aware labels, and feature-anchored links in one native Matplotlib polar figure. `examples/circos_v2/` is synthetic software demonstration data only; it is not biological evidence.
+
+Input contract (schema version 2.0):
+
+- `features.csv` requires `sector,feature_id,score,direction`. Optional columns: `label,p_value,fdr,effect_size,rank,study_id`. Each `(sector,feature_id)` is unique. Scores and all supplied numeric values must be finite; p-value/FDR lie in `[0,1]`. Negative scores require `--signed-scores`. In signed mode, `--baseline` maps to the track midpoint and `--scale` fixes the symmetric deviation range; otherwise the maximum absolute deviation from baseline is used. Values outside an explicit scale are rejected, never clipped.
+- `direction` accepts `positive,negative,neutral`; legacy aliases `up,risk,down,protective` are preserved. Positive/up/risk use blue, negative/down/protective use coral, neutral uses gray. Score sign and direction are separate inputs and both are retained.
+- `links.csv` requires `from_sector,from_feature,to_sector,to_feature`; optional `weight,link_type`. Both endpoint keys must exist in `features.csv`. `shared_feature` links require identical feature IDs observed in at least two sectors. Duplicate undirected endpoint pairs with identical type/weight are deduplicated and counted; conflicting duplicates fail. Missing weight defaults to 1. Sector-only links and silent sector-center fallback are not supported. Links are associations and do not establish causality.
+- `sectors.csv` optionally defines `sector,display_name,order,color`. Each row must refer to a sector present in the feature table. Feature angles are computed once and reused for score marks, label leaders, and link endpoints.
+- Sector spans are proportional to feature count. Labels are prioritized by explicit rank, then FDR/p-value, effect magnitude, and score deviation; `--top-k` limits candidates per sector. Collision/clipping-suppressed labels, along with the reason, are retained in a CSV sidecar.
+- The score ticks are numerically stated in the figure key. Only one pale sector band is drawn. Chords are cubic Beziers with endpoints at exact feature angles and the inner score-track radius; their sampled radii remain positive so the center stays open. Teal chord color does not encode direction; width represents weight and is capped at the 95th percentile.
+
+Example:
+
+```bash
+python scripts/figure_studio.py render --kind circos_lollipop_chord \
+ --features examples/circos_v2/features.csv --links examples/circos_v2/links.csv \
+ --sectors examples/circos_v2/sectors.csv --data-status demo \
+ --top-k 4 --width-mm 180 --formats pdf,svg,png --out results/circos_v2
+```
+
+The PNG is RGB at 600 dpi; PDF/SVG are editable vector outputs. Alongside each output stem the renderer writes `.source_*.csv` input snapshots, `.config.yaml`, `.manifest.json` with SHA-256 hashes, `.metadata.json`, `.suppressed_labels.csv`, and `.qc.json`. The `--scores` option remains a legacy adapter for old tables, but legacy links must carry a feature identifier present in both sectors. `--gap-degrees`, `--start-angle`, optional `--link-limit`, `--label-orientation`, `--max-label-chars`, `--chord-tension`, and `--bundle-strength` control layout and links. Long display labels are ellipsized while their full value remains in the source table.
## Evidence-aware mapping
diff --git a/scripts/circos_geometry.py b/scripts/circos_geometry.py
new file mode 100644
index 0000000..f0cda6b
--- /dev/null
+++ b/scripts/circos_geometry.py
@@ -0,0 +1,160 @@
+"""Pure geometry helpers for feature-anchored polar Circos tracks and chords."""
+from __future__ import annotations
+
+import math
+from dataclasses import dataclass
+from typing import Any
+
+import numpy as np
+
+
+@dataclass(frozen=True)
+class SectorInterval:
+ start: float
+ end: float
+
+ @property
+ def span(self) -> float:
+ return self.end - self.start
+
+ @property
+ def midpoint(self) -> float:
+ return (self.start + self.end) / 2
+
+
+@dataclass(frozen=True)
+class ChordGeometry:
+ start_angle: float
+ end_angle: float
+ inner_radius: float
+ theta: np.ndarray
+ radius: np.ndarray
+
+
+def sector_intervals(sectors: list[str], counts: dict[str, int], *,
+ gap_degrees: float = 2.0, start_degrees: float = 0.0) -> dict[str, SectorInterval]:
+ if not sectors or len(set(sectors)) != len(sectors):
+ raise ValueError("sectors must be a non-empty ordered list of unique names")
+ if not math.isfinite(gap_degrees) or not 0 <= gap_degrees < 30:
+ raise ValueError("gap_degrees must be finite and in [0, 30)")
+ if not math.isfinite(start_degrees):
+ raise ValueError("start_degrees must be finite")
+ if any(counts.get(name, 0) <= 0 for name in sectors):
+ raise ValueError("each sector must contain at least one feature")
+ total_gap = math.radians(gap_degrees) * len(sectors)
+ if total_gap >= 2 * math.pi:
+ raise ValueError("sector gaps consume the full circle")
+ available = 2 * math.pi - total_gap
+ total_features = sum(counts[name] for name in sectors)
+ cursor = math.radians(start_degrees)
+ output: dict[str, SectorInterval] = {}
+ for name in sectors:
+ end = cursor + available * counts[name] / total_features
+ output[name] = SectorInterval(cursor, end)
+ cursor = end + math.radians(gap_degrees)
+ return output
+
+
+def feature_angles(features: list[dict[str, Any]], intervals: dict[str, SectorInterval], *,
+ pad_fraction: float = 0.02) -> dict[tuple[str, str], float]:
+ """Place every observed feature monotonically within its ordered sector span."""
+ if not 0 <= pad_fraction < 0.25:
+ raise ValueError("pad_fraction must be in [0, 0.25)")
+ output: dict[tuple[str, str], float] = {}
+ for sector, arc in intervals.items():
+ rows = sorted((row for row in features if row["sector"] == sector),
+ key=lambda row: (float(row["_score"]), row["feature_id"]))
+ if not rows:
+ raise ValueError(f"sector {sector!r} has no features")
+ pad = arc.span * pad_fraction
+ for i, row in enumerate(rows):
+ key = (sector, row["feature_id"])
+ if key in output:
+ raise ValueError(f"duplicate feature anchor {key!r}")
+ output[key] = arc.start + pad + (i + 0.5) / len(rows) * (arc.span - 2 * pad)
+ return output
+
+
+def score_radii(features: list[dict[str, Any]], *, inner_radius: float, outer_radius: float,
+ baseline: float = 0.0, scale: float | None = None,
+ signed: bool = False) -> tuple[dict[tuple[str, str], float], dict[str, float]]:
+ """Map numeric scores to radial positions without discarding sign."""
+ if not 0 < inner_radius < outer_radius:
+ raise ValueError("score track radii must satisfy 0 < inner_radius < outer_radius")
+ if not math.isfinite(baseline):
+ raise ValueError("score baseline must be finite")
+ values = [float(row["_score"]) for row in features]
+ if not signed and any(value < 0 for value in values):
+ raise ValueError("negative scores require signed=True")
+ if not signed and baseline != 0:
+ raise ValueError("a non-zero baseline requires signed=True")
+ if signed:
+ deviations = [abs(value - baseline) for value in values]
+ observed_scale = max(deviations, default=0.0)
+ used_scale = scale if scale is not None else observed_scale or 1.0
+ if not math.isfinite(used_scale) or used_scale <= 0:
+ raise ValueError("score scale must be finite and positive")
+ if observed_scale > used_scale:
+ raise ValueError("an observed score exceeds the configured symmetric scale")
+ zero_radius = (inner_radius + outer_radius) / 2
+ half_span = (outer_radius - inner_radius) / 2
+ radii = { (row["sector"], row["feature_id"]): zero_radius +
+ half_span * (float(row["_score"]) - baseline) / used_scale for row in features }
+ else:
+ observed_scale = max((value - baseline for value in values), default=0.0)
+ used_scale = scale if scale is not None else observed_scale or 1.0
+ if not math.isfinite(used_scale) or used_scale <= 0:
+ raise ValueError("score scale must be finite and positive")
+ if any(value < baseline for value in values):
+ raise ValueError("non-negative score is below the configured baseline")
+ if observed_scale > used_scale:
+ raise ValueError("an observed score exceeds the configured scale")
+ zero_radius = inner_radius
+ span = outer_radius - inner_radius
+ radii = {(row["sector"], row["feature_id"]): inner_radius + span *
+ (float(row["_score"]) - baseline) / used_scale for row in features}
+ return radii, {"baseline": baseline, "scale": float(used_scale),
+ "observed_max_deviation": float(observed_scale), "baseline_radius": zero_radius,
+ "signed": signed}
+
+
+def cubic_chord(theta_start: float, theta_end: float, inner_radius: float, *,
+ tension: float = 0.72, bundle_offset: float = 0.0,
+ samples: int = 81) -> ChordGeometry:
+ """Sample a cubic Bezier in polar coordinates with an open, non-zero center."""
+ if not all(math.isfinite(value) for value in (theta_start, theta_end, inner_radius, tension, bundle_offset)):
+ raise ValueError("chord geometry parameters must be finite")
+ if inner_radius <= 0 or not 0.45 <= tension <= 0.85 or abs(bundle_offset) > 0.12:
+ raise ValueError("require inner_radius>0, tension in [0.45, 0.85], and |bundle_offset|<=0.12")
+ if samples < 5:
+ raise ValueError("samples must be at least 5")
+ delta = (theta_end - theta_start + math.pi) % (2 * math.pi) - math.pi
+ end = theta_start + delta
+ control_radius = inner_radius * (1 - tension)
+ p0 = np.array([theta_start, inner_radius])
+ p1 = np.array([theta_start + delta / 3 + bundle_offset, control_radius])
+ p2 = np.array([theta_start + 2 * delta / 3 + bundle_offset, control_radius])
+ p3 = np.array([end, inner_radius])
+ t = np.linspace(0.0, 1.0, samples)[:, None]
+ curve = ((1 - t) ** 3 * p0 + 3 * (1 - t) ** 2 * t * p1 +
+ 3 * (1 - t) * t**2 * p2 + t**3 * p3)
+ return ChordGeometry(theta_start, end, inner_radius, curve[:, 0], curve[:, 1])
+
+
+def link_geometry(links: list[dict[str, Any]], anchors: dict[tuple[str, str], float], *,
+ inner_radius: float, tension: float = 0.72,
+ bundle_strength: float = 0.02) -> list[ChordGeometry]:
+ if not 0 <= bundle_strength <= 0.12:
+ raise ValueError("bundle_strength must be in [0, 0.12]")
+ result = []
+ for i, link in enumerate(links):
+ source_key = (link["from_sector"], link["from_feature"])
+ target_key = (link["to_sector"], link["to_feature"])
+ if source_key not in anchors or target_key not in anchors:
+ raise ValueError(f"missing feature anchor for link {source_key!r} -> {target_key!r}")
+ # Stable alternating lanes separate dense links without moving their endpoints.
+ lane = ((i % 9) - 4) / 4 if bundle_strength else 0.0
+ offset = lane * bundle_strength
+ result.append(cubic_chord(anchors[source_key], anchors[target_key], inner_radius,
+ tension=tension, bundle_offset=offset))
+ return result
diff --git a/scripts/circos_recipe.py b/scripts/circos_recipe.py
new file mode 100644
index 0000000..5b79611
--- /dev/null
+++ b/scripts/circos_recipe.py
@@ -0,0 +1,554 @@
+"""Validated, feature-anchored native Matplotlib Circos composite."""
+from __future__ import annotations
+
+import csv
+import hashlib
+import json
+import math
+import platform
+import shutil
+from pathlib import Path
+from typing import Any
+
+import matplotlib
+import matplotlib.pyplot as plt
+import numpy as np
+from matplotlib.colors import is_color_like
+
+from circos_geometry import feature_angles, link_geometry, score_radii, sector_intervals
+
+BLUE = "#2878A8"
+CORAL = "#D97862"
+TEAL = "#456F6B"
+NEUTRAL = "#78858A"
+INK = "#3F484C"
+GRID = "#D6DADD"
+SECTOR_PALE = "#ECEFF0"
+DIRECTION_COLORS = {
+ "positive": BLUE, "up": BLUE, "risk": BLUE,
+ "negative": CORAL, "down": CORAL, "protective": CORAL,
+ "neutral": NEUTRAL,
+}
+SCHEMA_VERSION = "2.0"
+
+
+def _read_csv(path: Path, required: set[str], name: str) -> list[dict[str, str]]:
+ if not path.is_file():
+ raise ValueError(f"{name}: file not found: {path}")
+ with path.open(newline="", encoding="utf-8-sig") as stream:
+ reader = csv.DictReader(stream)
+ missing = sorted(required - set(reader.fieldnames or []))
+ if missing:
+ raise ValueError(f"{name}: missing required columns: {', '.join(missing)}")
+ return [{key: (value or "").strip() for key, value in row.items()} for row in reader]
+
+
+def _optional_float(row: dict[str, str], column: str, *, low: float | None = None,
+ high: float | None = None, row_number: int, table: str) -> float | None:
+ raw = row.get(column, "")
+ if raw == "":
+ return None
+ try:
+ value = float(raw)
+ except ValueError as exc:
+ raise ValueError(f"{table} row {row_number}: {column} must be numeric") from exc
+ if not math.isfinite(value) or (low is not None and value < low) or (high is not None and value > high):
+ limit = f" in [{low:g}, {high:g}]" if low is not None and high is not None else " finite"
+ raise ValueError(f"{table} row {row_number}: {column} must be{limit}")
+ return value
+
+
+def _sector_metadata(sectors_path: Path | None, names: list[str], table_name: str = "sectors.csv") -> tuple[list[str], dict[str, dict[str, Any]]]:
+ metadata: dict[str, dict[str, Any]] = {}
+ if sectors_path is not None:
+ rows = _read_csv(sectors_path, {"sector"}, table_name)
+ for line, row in enumerate(rows, 2):
+ sector = row["sector"]
+ if not sector or sector not in names:
+ raise ValueError(f"{table_name} row {line}: sector {sector!r} is absent from feature data")
+ if sector in metadata:
+ raise ValueError(f"{table_name} row {line}: duplicate sector {sector!r}")
+ order = _optional_float(row, "order", row_number=line, table=table_name)
+ color = row.get("color", "")
+ if color and not is_color_like(color):
+ raise ValueError(f"{table_name} row {line}: invalid color {color!r}")
+ metadata[sector] = {"name": row.get("display_name") or sector,
+ "order": order if order is not None else float(len(metadata)),
+ "color": color or None}
+ for sector in names:
+ metadata.setdefault(sector, {"name": sector, "order": float(len(metadata)), "color": None})
+ names.sort(key=lambda sector: (metadata[sector]["order"], sector))
+ return names, metadata
+
+
+def _validate(features: list[dict[str, str]], raw_links: list[dict[str, str]],
+ sectors_path: Path | None, *, signed_scores: bool,
+ feature_table: str = "features.csv", link_table: str = "links.csv",
+ legacy: bool = False) -> dict[str, Any]:
+ if not features:
+ raise ValueError(f"{feature_table}: at least one feature row is required")
+ feature_keys: set[tuple[str, str]] = set()
+ feature_sectors: dict[str, set[str]] = {}
+ normalized_features: list[dict[str, Any]] = []
+ for line, row in enumerate(features, 2):
+ sector, feature_id = row.get("sector", ""), row.get("feature_id", "")
+ if not sector or not feature_id:
+ raise ValueError(f"{feature_table} row {line}: sector and feature_id must be non-empty")
+ key = (sector, feature_id)
+ if key in feature_keys:
+ raise ValueError(f"{feature_table} row {line}: duplicate (sector, feature_id) {key!r}")
+ feature_keys.add(key)
+ feature_sectors.setdefault(feature_id, set()).add(sector)
+ try:
+ score = float(row.get("score", ""))
+ except ValueError as exc:
+ raise ValueError(f"{feature_table} row {line}: score is missing or not numeric") from exc
+ if not math.isfinite(score):
+ raise ValueError(f"{feature_table} row {line}: score must be finite")
+ if score < 0 and not signed_scores:
+ raise ValueError(f"{feature_table} row {line}: negative score requires --signed-scores")
+ direction = row.get("direction", "").strip().lower()
+ if direction not in DIRECTION_COLORS:
+ raise ValueError(f"{feature_table} row {line}: unknown direction {direction!r}; expected positive, negative, or neutral (legacy aliases up/down/risk/protective are accepted)")
+ fdr = _optional_float(row, "fdr", low=0, high=1, row_number=line, table=feature_table)
+ p_value = _optional_float(row, "p_value", low=0, high=1, row_number=line, table=feature_table)
+ effect = _optional_float(row, "effect_size", row_number=line, table=feature_table)
+ rank = _optional_float(row, "rank", row_number=line, table=feature_table)
+ legacy_priority = _optional_float(row, "_legacy_priority", row_number=line, table=feature_table)
+ normalized_features.append({**row, "sector": sector, "feature_id": feature_id,
+ "label": row.get("label") or feature_id, "direction": direction,
+ "_score": score, "_fdr": fdr, "_p_value": p_value,
+ "_effect": effect, "_rank": rank,
+ "_legacy_priority": legacy_priority})
+
+ sector_names = list(dict.fromkeys(row["sector"] for row in normalized_features))
+ link_keys: dict[tuple[tuple[str, str], tuple[str, str]], dict[str, Any]] = {}
+ normalized_links: list[dict[str, Any]] = []
+ duplicate_links_removed = 0
+ for line, row in enumerate(raw_links, 2):
+ from_sector = row.get("from_sector", "").strip()
+ to_sector = row.get("to_sector", "").strip()
+ from_feature = row.get("from_feature", "").strip()
+ to_feature = row.get("to_feature", "").strip()
+ if not all((from_sector, to_sector, from_feature, to_feature)):
+ raise ValueError(f"{link_table} row {line}: from/to sector and feature anchors are required; unanchored sector-only links are not accepted")
+ raw_weight = row.get("weight", "").strip()
+ try:
+ weight = float(raw_weight) if raw_weight else 1.0
+ except ValueError as exc:
+ raise ValueError(f"{link_table} row {line}: weight must be numeric") from exc
+ if not math.isfinite(weight) or weight <= 0:
+ raise ValueError(f"{link_table} row {line}: weight must be finite and positive")
+ if from_sector == to_sector:
+ raise ValueError(f"{link_table} row {line}: inter-sector links must connect different sectors")
+ source_key, target_key = (from_sector, from_feature), (to_sector, to_feature)
+ if source_key not in feature_keys:
+ raise ValueError(f"{link_table} row {line}: source anchor {source_key!r} is absent from {feature_table}")
+ if target_key not in feature_keys:
+ raise ValueError(f"{link_table} row {line}: target anchor {target_key!r} is absent from {feature_table}")
+ link_type = row.get("link_type", "").strip() or "shared_feature"
+ if link_type == "shared_feature":
+ if from_feature != to_feature:
+ raise ValueError(f"{link_table} row {line}: shared_feature links require identical feature IDs")
+ if len(feature_sectors.get(from_feature, set())) < 2:
+ raise ValueError(f"{link_table} row {line}: shared feature {from_feature!r} must occur in at least two sectors")
+ pair = tuple(sorted((source_key, target_key)))
+ current = {"from_sector": from_sector, "from_feature": from_feature,
+ "to_sector": to_sector, "to_feature": to_feature,
+ "link_type": link_type, "_weight": weight}
+ if pair in link_keys:
+ prior = link_keys[pair]
+ if prior["link_type"] != link_type or not math.isclose(prior["_weight"], weight):
+ raise ValueError(f"{link_table} row {line}: duplicate undirected endpoint pair has conflicting type or weight: {pair!r}")
+ duplicate_links_removed += 1
+ continue
+ link_keys[pair] = current
+ normalized_links.append(current)
+
+ sector_names, sector_meta = _sector_metadata(sectors_path, sector_names)
+ normalized_links.sort(key=lambda row: (row["from_sector"], row["from_feature"], row["to_sector"], row["to_feature"], row["link_type"]))
+ return {"features": normalized_features, "scores": normalized_features,
+ "links": normalized_links, "sectors": sector_names, "sector_meta": sector_meta,
+ "signed_scores": signed_scores,
+ "provenance": {"schema_version": "1.0-legacy" if legacy else SCHEMA_VERSION,
+ "feature_rows_input": len(features), "feature_rows_used": len(normalized_features),
+ "link_rows_input": len(raw_links), "links_after_deduplication": len(normalized_links),
+ "duplicate_undirected_links_removed": duplicate_links_removed,
+ "link_rows_removed_by_validation": 0}}
+
+
+def load_features_data(features_path: Path, links_path: Path,
+ sectors_path: Path | None = None, *, signed_scores: bool = False) -> dict[str, Any]:
+ features = _read_csv(features_path, {"sector", "feature_id", "score", "direction"}, "features.csv")
+ links = _read_csv(links_path, {"from_sector", "from_feature", "to_sector", "to_feature"}, "links.csv")
+ return _validate(features, links, sectors_path, signed_scores=signed_scores)
+
+
+def load_legacy_data(scores_path: Path, links_path: Path,
+ sectors_path: Path | None = None, *, signed_scores: bool = False) -> dict[str, Any]:
+ """Compatibility adapter for V1 gene_scores/source_sector tables."""
+ score_rows = _read_csv(scores_path, {"sector", "gene", "score", "direction"}, "gene_scores.csv")
+ features = []
+ for row in score_rows:
+ features.append({"sector": row["sector"], "feature_id": row["gene"],
+ "score": row["score"], "direction": row["direction"],
+ "label": row.get("display_label") or row["gene"],
+ "fdr": row.get("fdr", ""), "p_value": row.get("p_value", ""),
+ "effect_size": row.get("effect_size", ""),
+ "_legacy_priority": str(-float(row["label_priority"])) if row.get("label_priority") else ""})
+ old_links = _read_csv(links_path, {"source_sector", "target_sector"}, "legacy links.csv")
+ links = []
+ for line, row in enumerate(old_links, 2):
+ feature = row.get("feature", "").strip()
+ if not feature:
+ raise ValueError(f"legacy links.csv row {line}: feature is required; V1 sector-only midpoint links cannot be carried forward")
+ links.append({"from_sector": row["source_sector"], "from_feature": feature,
+ "to_sector": row["target_sector"], "to_feature": feature,
+ "weight": row.get("weight", ""), "link_type": "shared_feature"})
+ return _validate(features, links, sectors_path, signed_scores=signed_scores,
+ feature_table="gene_scores.csv", link_table="legacy links.csv", legacy=True)
+
+
+def load_data(scores_path: Path, links_path: Path, sectors_path: Path | None = None,
+ *, signed_scores: bool = False) -> dict[str, Any]:
+ """Retained V1 callable API; V2 callers should use load_features_data."""
+ return load_legacy_data(scores_path, links_path, sectors_path, signed_scores=signed_scores)
+
+
+def _rank_key(row: dict[str, Any], baseline: float) -> tuple[Any, ...]:
+ fdr = row.get("_fdr")
+ p_value = row.get("_p_value")
+ effect = abs(row.get("_effect") or 0.0)
+ score_effect = abs(float(row["_score"]) - baseline)
+ if row.get("_rank") is not None:
+ return (0, row["_rank"], fdr if fdr is not None else 1.0,
+ p_value if p_value is not None else 1.0, -effect, -score_effect, row["feature_id"])
+ if row.get("_legacy_priority") is not None:
+ return (0, row["_legacy_priority"], fdr if fdr is not None else 1.0,
+ p_value if p_value is not None else 1.0, -effect, -score_effect, row["feature_id"])
+ significance = fdr if fdr is not None else p_value if p_value is not None else 1.0
+ return (1, significance, -effect, -score_effect, row["feature_id"])
+
+
+def _display_label(row: dict[str, Any], limit: int) -> str:
+ label = str(row.get("label") or row["feature_id"])
+ return label if len(label) <= limit else label[:limit - 1].rstrip() + "…"
+
+
+def _collision_placements(features: list[dict[str, Any]], anchors: dict[tuple[str, str], float],
+ intervals: dict[str, Any], *, top_k: int, max_chars: int,
+ font_size: float, figure_inches: float, label_radius: float,
+ baseline: float) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]:
+ candidates: list[dict[str, Any]] = []
+ suppressed: list[dict[str, Any]] = []
+ for sector, arc in intervals.items():
+ rows = sorted((row for row in features if row["sector"] == sector), key=lambda row: _rank_key(row, baseline))
+ for row in rows[top_k:]:
+ suppressed.append({**row, "suppression_reason": "below_top_k"})
+ candidates.extend(rows[:top_k])
+ candidates.sort(key=lambda row: (_rank_key(row, baseline), row["sector"], row["feature_id"]))
+ placed: list[dict[str, Any]] = []
+ # Radius in display space is normalized to the polar axes' outer limit.
+ radius_inches = figure_inches * 0.39 * label_radius / (label_radius + .15)
+ placed_widths: list[tuple[float, float]] = []
+ for row in candidates:
+ source = anchors[(row["sector"], row["feature_id"])]
+ label = _display_label(row, max_chars)
+ # Uppercase identifiers and digits occupy more width than spaces/punctuation.
+ em_width = sum(.66 if c.isupper() else .57 if c.isdigit() else .38 if c in " _-." else .52 for c in label)
+ half_angle = (em_width * font_size / 72 / radius_inches) / 2
+ arc = intervals[row["sector"]]
+ pad = arc.span * .015
+ step = math.radians(1.0)
+ max_shift = min(arc.span * .38, math.radians(18))
+ offsets = [0.0]
+ for tick in range(1, int(max_shift / step) + 1):
+ offsets.extend([tick * step, -tick * step])
+ slot = None
+ for offset in offsets:
+ angle = source + offset
+ if not arc.start + pad <= angle <= arc.end - pad:
+ continue
+ required = half_angle + math.radians(1.4)
+ if all(_angular_distance(angle, other_angle) >= required + other_half
+ for other_angle, other_half in placed_widths):
+ slot = angle
+ break
+ if slot is None:
+ suppressed.append({**row, "suppression_reason": "label_collision"})
+ else:
+ item = {**row, "display_text": label, "source_angle": source, "display_angle": slot,
+ "half_angle": half_angle}
+ placed.append(item)
+ placed_widths.append((slot, half_angle))
+ return placed, suppressed
+
+
+def _angular_distance(a: float, b: float) -> float:
+ return abs((a - b + math.pi) % (2 * math.pi) - math.pi)
+
+
+def _upright_rotation(theta: float, orientation: str, *, theta_offset: float = math.pi / 2) -> float:
+ radial = math.degrees(theta_offset - theta)
+ angle = radial if orientation == "radial" else radial + 90
+ angle = (angle + 180) % 360 - 180
+ if angle < -90:
+ angle += 180
+ if angle > 90:
+ angle -= 180
+ return angle
+
+
+def render(data: dict[str, Any], *, top_n: int = 4, gap_degrees: float = 2.0,
+ start_degrees: float = 0.0, link_limit: int | None = None,
+ baseline: float = 0.0, score_scale: float | None = None,
+ signed_scores: bool | None = None, width_mm: float = 180.0,
+ figsize: float | None = None, label_orientation: str = "tangent",
+ max_label_chars: int = 18, chord_tension: float = 0.72,
+ bundle_strength: float = 0.025, data_status: str = "real") -> plt.Figure:
+ if top_n < 0 or link_limit is not None and link_limit < 0:
+ raise ValueError("top_k and link_limit must be non-negative")
+ if label_orientation not in {"tangent", "radial"}:
+ raise ValueError("label_orientation must be tangent or radial")
+ if max_label_chars < 4:
+ raise ValueError("max_label_chars must be at least 4")
+ if not math.isfinite(width_mm) or not 50 <= width_mm <= 300:
+ raise ValueError("width_mm must be finite and between 50 and 300")
+ if not math.isfinite(start_degrees):
+ raise ValueError("start_angle must be finite")
+ features, links, sectors = data["features"], data["links"], data["sectors"]
+ signed = data.get("signed_scores", False) if signed_scores is None else signed_scores
+ figure_inches = figsize if figsize is not None else width_mm / 25.4
+ if not math.isfinite(figure_inches) or figure_inches <= 0:
+ raise ValueError("figure size must be finite and positive")
+ counts = {sector: sum(row["sector"] == sector for row in features) for sector in sectors}
+ intervals = sector_intervals(sectors, counts, gap_degrees=gap_degrees, start_degrees=start_degrees)
+
+ score_inner, score_outer = 0.57, 0.87
+ chord_radius = score_inner - 0.035
+ sector_band_inner = score_outer + 0.035
+ band_width = max(.045, .078 - .0025 * max(0, len(sectors) - 6))
+ sector_band_outer = sector_band_inner + band_width
+ label_radius = sector_band_outer + .11
+ requested_labels = min(top_n * len(sectors), len(features))
+ font_size = min(7.4, max(4.8, 7.5 - .18 * math.log2(max(1, len(sectors) / 6)) -
+ .28 * math.log2(max(1, requested_labels / 24))))
+ max_radius = label_radius + .15
+ anchors = feature_angles(features, intervals, pad_fraction=.02)
+ radii, scale_info = score_radii(features, inner_radius=score_inner, outer_radius=score_outer,
+ baseline=baseline, scale=score_scale, signed=signed)
+ placed_labels, suppressed = _collision_placements(
+ features, anchors, intervals, top_k=top_n, max_chars=max_label_chars,
+ font_size=font_size, figure_inches=figure_inches, label_radius=label_radius,
+ baseline=baseline)
+
+ weight_values = [float(link["_weight"]) for link in links]
+ weight_cap = float(np.percentile(weight_values, 95)) if weight_values else 1.0
+ weight_cap = max(weight_cap, np.finfo(float).eps)
+ ordered_links = sorted(links, key=lambda row: (-row["_weight"], row["from_sector"], row["from_feature"],
+ row["to_sector"], row["to_feature"], row["link_type"]))
+ drawn_links = ordered_links if link_limit is None else ordered_links[:link_limit]
+ link_curves = link_geometry(drawn_links, anchors, inner_radius=chord_radius,
+ tension=chord_tension, bundle_strength=bundle_strength)
+
+ fig = plt.figure(figsize=(figure_inches, figure_inches), facecolor="#FFFFFF")
+ ax = fig.add_subplot(111, projection="polar", facecolor="#FFFFFF")
+ ax.set_theta_direction(-1)
+ ax.set_theta_offset(math.pi / 2)
+ ax.set_ylim(0, max_radius)
+ ax.set_axis_off()
+
+ # Chords are sampled cubic Beziers in the same polar frame as every track.
+ for link, curve in zip(drawn_links, link_curves):
+ fraction = min(float(link["_weight"]), weight_cap) / weight_cap
+ width = float(np.clip(.32 + .72 * math.sqrt(fraction), .32, 1.04))
+ style = "-" if link["link_type"] == "shared_feature" else (0, (1.8, 1.1))
+ ax.plot(curve.theta, curve.radius, color=TEAL, alpha=.42, linewidth=width,
+ linestyle=style, zorder=1, solid_capstyle="round")
+
+ tick_fractions = (-1, -.5, 0, .5, 1) if signed else (0, .25, .5, .75, 1)
+ baseline_radius = scale_info["baseline_radius"]
+ for sector in sectors:
+ arc = intervals[sector]
+ theta_grid = np.linspace(arc.start, arc.end, 90)
+ for fraction in tick_fractions:
+ radius = baseline_radius + fraction * ((score_outer - score_inner) / 2) if signed else score_inner + fraction * (score_outer - score_inner)
+ color = "#AAB1B4" if signed and fraction == 0 else GRID
+ style = "--" if signed and fraction == 0 else "-"
+ ax.plot(theta_grid, np.full_like(theta_grid, radius), color=color,
+ linewidth=.48 if style == "--" else .34, linestyle=style, zorder=0)
+ boundary_radius = np.linspace(chord_radius, sector_band_outer, 20)
+ ax.plot([arc.start] * len(boundary_radius), boundary_radius, color=INK, linewidth=.48, zorder=4)
+ ax.plot([arc.end] * len(boundary_radius), boundary_radius, color=INK, linewidth=.48, zorder=4)
+
+ # One pale neutral sector band; no decorative stacked annuli.
+ for sector in sectors:
+ arc = intervals[sector]
+ info = data["sector_meta"][sector]
+ face = info["color"] or SECTOR_PALE
+ ax.bar(arc.midpoint, band_width, width=arc.span, bottom=sector_band_inner,
+ color=face, edgecolor="#646D71", linewidth=.48, align="center", zorder=4)
+ name = str(info["name"])
+ rotation = _upright_rotation(arc.midpoint, "tangent")
+ ax.text(arc.midpoint, (sector_band_inner + sector_band_outer) / 2, name,
+ rotation=rotation, rotation_mode="anchor", ha="center", va="center",
+ fontsize=max(5.0, font_size - .25), color=INK, zorder=5, clip_on=False)
+
+ # All score points and stems use the same sector-local feature anchor angles as links.
+ for row in features:
+ key = (row["sector"], row["feature_id"])
+ theta, radius = anchors[key], radii[key]
+ color = DIRECTION_COLORS[row["direction"]]
+ ax.plot([theta, theta], [baseline_radius, radius], color=color, alpha=.58,
+ linewidth=.42, zorder=2)
+ marker_size = max(5, 12 * (figure_inches / (180 / 25.4)) ** 2)
+ ax.scatter([theta], [radius], s=marker_size, color=color, edgecolors="#FFFFFF",
+ linewidths=.28, zorder=3)
+
+ label_artists: list[tuple[dict[str, Any], Any, Any]] = []
+ for index, item in enumerate(placed_labels):
+ theta, display_theta = item["source_angle"], item["display_angle"]
+ score_radius = radii[(item["sector"], item["feature_id"])]
+ ring_radius = sector_band_outer + .035
+ label_r = label_radius + (index % 2) * .035
+ # Leaders begin at the actual point angle and route around the sector band.
+ line, = ax.plot([theta, theta, display_theta], [score_radius, ring_radius, ring_radius],
+ color="#737C80", linewidth=.42, zorder=5)
+ rotation = _upright_rotation(display_theta, label_orientation)
+ side = "left" if math.cos(display_theta) >= 0 else "right"
+ text_artist = ax.text(display_theta, label_r, item["display_text"], rotation=rotation,
+ rotation_mode="anchor", ha=side, va="center", fontsize=font_size,
+ color=INK, clip_on=False, zorder=6)
+ label_artists.append((item, line, text_artist))
+
+ # Explicit DEMO stamp prevents a screenshot from being detached from its synthetic-data note.
+ if data_status == "demo":
+ fig.text(.5, .965, "DEMO · SYNTHETIC DATA ONLY", ha="center", va="center",
+ fontsize=7, weight="bold", color="#A54E4A")
+
+ direction_handles = [plt.Line2D([], [], marker="o", linestyle="", color=BLUE, markersize=4, label="positive / up / risk"),
+ plt.Line2D([], [], marker="o", linestyle="", color=CORAL, markersize=4, label="negative / down / protective"),
+ plt.Line2D([], [], marker="o", linestyle="", color=NEUTRAL, markersize=4, label="neutral")]
+ link_types = sorted({row["link_type"] for row in drawn_links})
+ link_handles = [plt.Line2D([], [], color=TEAL, linewidth=.8,
+ linestyle="-" if kind == "shared_feature" else "--",
+ label=f"{kind.replace('_', ' ')} links") for kind in link_types]
+ handles = direction_handles + link_handles
+ fig.legend(handles=handles, loc="lower center", bbox_to_anchor=(.5, .035),
+ ncol=min(4, max(1, len(handles))), frameon=False, fontsize=6.4,
+ handlelength=1.4, columnspacing=1.0)
+ tick_text = ", ".join(f"{baseline + fraction * scale_info['scale']:g}" for fraction in tick_fractions)
+ score_mode = (f"signed: baseline={baseline:g}, scale=±{scale_info['scale']:g}"
+ if signed else f"non-negative: baseline={baseline:g}, scale={scale_info['scale']:g}")
+ fig.text(.5, .105, f"Radial score ({score_mode}); tick values: {tick_text}",
+ ha="center", va="center", fontsize=6.2, color=INK)
+ cap_note = f"weight width capped at 95th percentile ({weight_cap:g})" if drawn_links else "no links supplied"
+ fig.text(.5, .078, f"Links connect named feature anchors; link color is neutral teal; {cap_note}",
+ ha="center", va="center", fontsize=5.9, color=INK)
+ fig.subplots_adjust(left=0, right=1, top=1, bottom=0)
+ ax.set_position([.14, .22, .72, .72])
+
+ # Render once for display-space checks; clip/collision failures are recorded, not silently omitted.
+ fig.canvas.draw()
+ kept: list[tuple[dict[str, Any], Any, Any]] = []
+ for item, line, text_artist in label_artists:
+ box = text_artist.get_window_extent(renderer=fig.canvas.get_renderer())
+ if box.x0 < 1 or box.y0 < 1 or box.x1 > fig.bbox.width - 1 or box.y1 > fig.bbox.height - 1:
+ text_artist.remove(); line.remove()
+ suppressed.append({**item, "suppression_reason": "outside_canvas"})
+ else:
+ kept.append((item, line, text_artist))
+ kept_by_priority = sorted(kept, key=lambda triplet: (_rank_key(triplet[0], baseline), triplet[0]["sector"], triplet[0]["feature_id"]))
+ final_kept: list[tuple[dict[str, Any], Any, Any]] = []
+ for item, line, text_artist in kept_by_priority:
+ box = text_artist.get_window_extent(renderer=fig.canvas.get_renderer())
+ overlap = False
+ for _, _, prior_artist in final_kept:
+ prior = prior_artist.get_window_extent(renderer=fig.canvas.get_renderer())
+ width = max(0, min(box.x1, prior.x1) - max(box.x0, prior.x0))
+ height = max(0, min(box.y1, prior.y1) - max(box.y0, prior.y0))
+ area = width * height
+ smaller = min(max(1, box.width * box.height), max(1, prior.width * prior.height))
+ if area / smaller > .01:
+ overlap = True
+ break
+ if overlap:
+ text_artist.remove(); line.remove()
+ suppressed.append({**item, "suppression_reason": "display_bbox_overlap_gt_0.01"})
+ else:
+ final_kept.append((item, line, text_artist))
+
+ observed_labels = len(final_kept)
+ provenance = {**data["provenance"], "signed_scores": signed,
+ "baseline": baseline, "scale": scale_info["scale"],
+ "score_scale_method": "user-specified" if score_scale is not None else "max absolute deviation from baseline",
+ "track_radii": {"chord_endpoint": chord_radius, "score_inner": score_inner,
+ "score_outer": score_outer, "sector_band_inner": sector_band_inner,
+ "sector_band_outer": sector_band_outer, "label_radius": label_radius},
+ "features_drawn": len(features), "links_drawn": len(drawn_links),
+ "links_removed_by_limit": len(links) - len(drawn_links),
+ "label_candidates_top_k": requested_labels, "labels_drawn": observed_labels,
+ "labels_suppressed": len(suppressed), "label_collision_threshold": .01,
+ "label_suppression_reasons": {reason: sum(row.get("suppression_reason") == reason for row in suppressed)
+ for reason in sorted({row.get("suppression_reason") for row in suppressed})},
+ "link_width_cap_p95": weight_cap, "aggregation": "none; feature-level endpoint links",
+ "minimum_chord_radius": min((float(curve.radius.min()) for curve in link_curves), default=None),
+ "feature_angle_contract": "sector-local feature anchors shared by scores, leaders, and links"}
+ fig._circos_provenance = provenance
+ fig._circos_suppressed = suppressed
+ return fig
+
+
+def hashes(paths: list[Path]) -> dict[str, str]:
+ return {str(path): hashlib.sha256(path.read_bytes()).hexdigest() for path in paths if path is not None}
+
+
+def _payload(input_sha256: dict[str, str], config: dict[str, Any], status: str) -> dict[str, Any]:
+ return {"schema_version": SCHEMA_VERSION, "input_sha256": input_sha256,
+ "configuration": config, "software": {"python": platform.python_version(),
+ "matplotlib": matplotlib.__version__, "numpy": np.__version__},
+ "data_status": status}
+
+
+def write_metadata(path: Path, input_sha256: dict[str, str], config: dict[str, Any], status: str) -> None:
+ path.write_text(json.dumps(_payload(input_sha256, config, status), indent=2) + "\n", encoding="utf-8")
+
+
+def write_suppressed_labels(path: Path, rows: list[dict[str, Any]]) -> None:
+ fields = ["sector", "feature_id", "label", "score", "direction", "fdr", "p_value", "effect_size", "rank", "suppression_reason"]
+ with path.open("w", newline="", encoding="utf-8") as stream:
+ writer = csv.DictWriter(stream, fieldnames=fields, extrasaction="ignore")
+ writer.writeheader()
+ for row in rows:
+ writer.writerow({"sector": row.get("sector"), "feature_id": row.get("feature_id"),
+ "label": row.get("label"), "score": row.get("_score"),
+ "direction": row.get("direction"), "fdr": row.get("_fdr"),
+ "p_value": row.get("_p_value"), "effect_size": row.get("_effect"),
+ "rank": row.get("_rank"), "suppression_reason": row.get("suppression_reason")})
+
+
+def write_config_yaml(path: Path, config: dict[str, Any]) -> None:
+ # JSON scalar syntax is valid YAML 1.2; this avoids an extra YAML runtime dependency.
+ lines = [f"schema_version: {SCHEMA_VERSION}", "configuration:"]
+ for key, value in config.items():
+ lines.append(f" {key}: {json.dumps(value, ensure_ascii=False)}")
+ path.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+
+def snapshot_inputs(out: Path, inputs: dict[str, Path | None]) -> dict[str, str]:
+ copied: dict[str, str] = {}
+ for label, source in inputs.items():
+ if source is None:
+ continue
+ target = out.parent / f"{out.name}.source_{label}.csv"
+ if target.resolve() != source.resolve():
+ shutil.copy2(source, target)
+ copied[label] = hashlib.sha256(target.read_bytes()).hexdigest()
+ return copied
+
+
+def write_run_manifest(path: Path, input_sha256: dict[str, str], output_sha256: dict[str, str],
+ config: dict[str, Any], status: str) -> None:
+ payload = _payload(input_sha256, config, status)
+ payload["output_sha256"] = output_sha256
+ path.write_text(json.dumps(payload, indent=2) + "\n", encoding="utf-8")
diff --git a/scripts/figure_studio.py b/scripts/figure_studio.py
index 818e2b9..ab59ab2 100644
--- a/scripts/figure_studio.py
+++ b/scripts/figure_studio.py
@@ -78,7 +78,7 @@
"risk_table",
),
"genomics_spatial_mechanism": (
- "protein_track", "mutation_lollipop", "genome_track", "chromosome_ideogram", "circos_overview",
+ "protein_track", "mutation_lollipop", "genome_track", "chromosome_ideogram", "circos_overview", "circos_lollipop_chord",
"variant_burden", "allele_frequency_spectrum", "spatial_feature", "spatial_grid", "spatial_hexbin",
"spatial_dotplot", "image_quantification", "cell_type_composition", "ligand_receptor_lollipop",
"mechanism_schematic", "graphical_abstract",
@@ -88,7 +88,7 @@
CATALOG: dict[str, str] = {
name: group for group, names in CATALOG_GROUPS.items() for name in names
}
-assert len(CATALOG) == 128, f"catalog must contain 128 unique recipes, found {len(CATALOG)}"
+assert len(CATALOG) == 129, f"catalog must contain 129 unique recipes, found {len(CATALOG)}"
def _style() -> None:
@@ -302,8 +302,29 @@ def _draw_genomics(ax: plt.Axes, kind: str, rng: np.random.Generator) -> None:
_title(ax, kind)
-def render_kind(kind: str, *, seed: int = 0, ax: plt.Axes | None = None) -> plt.Figure:
- if kind not in CATALOG: raise ValueError(f"Unknown recipe {kind!r}; use `catalog` to list 128 recipes")
+def render_kind(kind: str, *, seed: int = 0, ax: plt.Axes | None = None,
+ scores: Path | None = None, links: Path | None = None, sectors: Path | None = None,
+ features: Path | None = None,
+ signed_scores: bool = False, baseline: float = 0, top_n: int = 4,
+ gap_degrees: float = 3, link_limit: int | None = None, figsize: float | None = None,
+ label_orientation: str = "tangent", inner_radius: float = .48,
+ outer_radius: float = .83, max_label_chars: int = 18,
+ score_scale: float | None = None, start_angle: float = 0,
+ width_mm: float = 180, chord_tension: float = .72,
+ bundle_strength: float = .025, data_status: str = "real") -> plt.Figure:
+ if kind not in CATALOG: raise ValueError(f"Unknown recipe {kind!r}; use `catalog` to list 129 recipes")
+ if kind == "circos_lollipop_chord":
+ if links is None or (features is None and scores is None):
+ raise ValueError("circos_lollipop_chord requires --features and --links (or legacy --scores and --links)")
+ from circos_recipe import load_features_data, load_legacy_data, render
+ data = (load_features_data(features, links, sectors, signed_scores=signed_scores)
+ if features is not None else
+ load_legacy_data(scores, links, sectors, signed_scores=signed_scores))
+ return render(data, top_n=top_n, gap_degrees=gap_degrees, link_limit=link_limit,
+ baseline=baseline, score_scale=score_scale, figsize=figsize,
+ label_orientation=label_orientation, max_label_chars=max_label_chars,
+ start_degrees=start_angle, width_mm=width_mm, chord_tension=chord_tension,
+ bundle_strength=bundle_strength, data_status=data_status)
_style(); own = ax is None
fig = plt.figure(figsize=(183 / 25.4, 105 / 25.4), facecolor=BG) if own else ax.figure
target = ax or fig.add_subplot(111)
@@ -329,15 +350,17 @@ def _save_rgb_raster(path: Path, dpi: int, *, tiff: bool = False) -> None:
else: rgb.save(path, dpi=(dpi, dpi))
-def export_figure(fig: plt.Figure, out: Path, formats: Iterable[str]) -> list[Path]:
+def export_figure(fig: plt.Figure, out: Path, formats: Iterable[str], *, png_dpi: int = 350,
+ tight: bool = True) -> list[Path]:
out.parent.mkdir(parents=True, exist_ok=True)
saved: list[Path] = []
for fmt in formats:
fmt = fmt.lower().lstrip(".")
path = out.with_suffix(f".{fmt}")
- if fmt in {"pdf", "svg"}: fig.savefig(path, format=fmt, bbox_inches="tight", facecolor=BG)
- elif fmt == "png": fig.savefig(path, format=fmt, dpi=350, bbox_inches="tight", facecolor=BG); _save_rgb_raster(path, 350)
- elif fmt in {"tif", "tiff"}: fig.savefig(path, format="tiff", dpi=600, bbox_inches="tight", facecolor=BG); _save_rgb_raster(path, 600, tiff=True)
+ bbox = "tight" if tight else None
+ if fmt in {"pdf", "svg"}: fig.savefig(path, format=fmt, bbox_inches=bbox, facecolor=fig.get_facecolor())
+ elif fmt == "png": fig.savefig(path, format=fmt, dpi=png_dpi, bbox_inches=bbox, facecolor=fig.get_facecolor()); _save_rgb_raster(path, png_dpi)
+ elif fmt in {"tif", "tiff"}: fig.savefig(path, format="tiff", dpi=600, bbox_inches=bbox, facecolor=fig.get_facecolor()); _save_rgb_raster(path, 600, tiff=True)
else: raise ValueError(f"Unsupported format: {fmt}")
saved.append(path)
return saved
@@ -353,8 +376,86 @@ def cmd_catalog(args: argparse.Namespace) -> int:
def cmd_render(args: argparse.Namespace) -> int:
- fig = render_kind(args.kind, seed=args.seed)
- saved = export_figure(fig, Path(args.out), args.formats.split(","))
+ try:
+ fig = render_kind(args.kind, seed=args.seed, scores=getattr(args, "scores", None), links=getattr(args, "links", None),
+ features=getattr(args, "features", None),
+ sectors=getattr(args, "sectors", None), signed_scores=getattr(args, "signed_scores", False),
+ baseline=getattr(args, "baseline", 0), top_n=getattr(args, "top_n", 4),
+ gap_degrees=getattr(args, "gap_degrees", 2), link_limit=getattr(args, "link_limit", None),
+ figsize=getattr(args, "figsize", None), label_orientation=getattr(args, "label_orientation", "tangent"),
+ max_label_chars=getattr(args, "max_label_chars", 24), score_scale=getattr(args, "scale", None),
+ start_angle=getattr(args, "start_angle", 0), width_mm=getattr(args, "width_mm", 180),
+ chord_tension=getattr(args, "chord_tension", .72),
+ bundle_strength=getattr(args, "bundle_strength", .025),
+ data_status=getattr(args, "data_status", "real"))
+ except ValueError as exc:
+ raise SystemExit(str(exc)) from exc
+ circos = args.kind == "circos_lollipop_chord"
+ saved = export_figure(fig, Path(args.out), args.formats.split(","), png_dpi=600 if circos else 350,
+ tight=not circos)
+ if circos:
+ from circos_recipe import (hashes, snapshot_inputs, write_config_yaml, write_metadata,
+ write_run_manifest, write_suppressed_labels)
+ input_paths = {"features": getattr(args, "features", None) or args.scores,
+ "links": args.links, "sectors": args.sectors}
+ input_hashes = hashes([path for path in input_paths.values() if path is not None])
+ config = {"recipe": args.kind, "seed": args.seed, "top_k": args.top_n,
+ "gap_degrees": args.gap_degrees, "start_angle": args.start_angle,
+ "link_limit": args.link_limit, "baseline": args.baseline,
+ "signed_scores": args.signed_scores, "width_mm": args.width_mm,
+ "label_orientation": args.label_orientation, "max_label_chars": args.max_label_chars,
+ "scale": args.scale, "chord_tension": args.chord_tension,
+ "bundle_strength": args.bundle_strength, "data_status": args.data_status,
+ "inputs": {name: str(path) if path else None for name, path in input_paths.items()}}
+ out = Path(args.out)
+ source_hashes = snapshot_inputs(out, input_paths)
+ config["source_snapshot_sha256"] = source_hashes
+ metadata = dict(getattr(fig, "_circos_provenance", {}))
+ metadata["configuration"] = config
+ metadata["input_sha256"] = input_hashes
+ metadata["data_status"] = args.data_status
+ Path(args.out).with_suffix(".metadata.json").write_text(json.dumps(metadata, indent=2) + "\n", encoding="utf-8")
+ write_config_yaml(Path(args.out).with_suffix(".config.yaml"), config)
+ suppressed_path = Path(args.out).with_suffix(".suppressed_labels.csv")
+ write_suppressed_labels(suppressed_path, getattr(fig, "_circos_suppressed", []))
+ raster_paths = [path for path in saved if path.suffix.lower() == ".png"]
+ raster_ok = False
+ raster_details = []
+ if raster_paths:
+ from PIL import Image
+ raster_ok = True
+ for path in raster_paths:
+ with Image.open(path) as image:
+ dpi = image.info.get("dpi", (0, 0))
+ item = {"file": str(path), "mode": image.mode, "size_px": [image.width, image.height],
+ "dpi": [float(dpi[0]), float(dpi[1])] if isinstance(dpi, tuple) else [float(dpi), float(dpi)]}
+ raster_details.append(item)
+ raster_ok = raster_ok and image.mode == "RGB" and min(item["dpi"]) >= 599
+ export_extensions = {p.suffix.lower() for p in saved}
+ vector_raster_ok = {".pdf", ".svg", ".png"} <= export_extensions and raster_ok
+ qc = {"schema_version": "1.0", "status": args.data_status,
+ "checks": {
+ "all_input_links_have_named_feature_anchors": {"pass": True, "links_drawn": metadata.get("links_drawn", 0)},
+ "chords_keep_open_center": {"pass": metadata.get("minimum_chord_radius") is None or metadata["minimum_chord_radius"] > 0,
+ "minimum_sampled_radius": metadata.get("minimum_chord_radius")},
+ "feature_count_matches_render": {"pass": metadata.get("features_drawn", 0) > 0,
+ "features_drawn": metadata.get("features_drawn", 0)},
+ "suppressed_labels_are_recorded": {"pass": suppressed_path.is_file(),
+ "suppressed_label_rows": len(getattr(fig, "_circos_suppressed", []))},
+ "vector_and_600dpi_rgb_raster_exported": {"pass": vector_raster_ok,
+ "files": [str(p) for p in saved],
+ "raster_details": raster_details},
+ }}
+ qc["passed"] = all(item["pass"] for item in qc["checks"].values())
+ qc_path = Path(args.out).with_suffix(".qc.json")
+ qc_path.write_text(json.dumps(qc, indent=2) + "\n", encoding="utf-8")
+ output_hashes = hashes(saved)
+ output_hashes.update({str(p): hashes([p])[str(p)] for p in Path(args.out).parent.glob(Path(args.out).name + ".source_*.csv")})
+ output_hashes[str(suppressed_path)] = hashes([suppressed_path])[str(suppressed_path)]
+ output_hashes[str(Path(args.out).with_suffix(".metadata.json"))] = hashes([Path(args.out).with_suffix(".metadata.json")])[str(Path(args.out).with_suffix(".metadata.json"))]
+ output_hashes[str(Path(args.out).with_suffix(".config.yaml"))] = hashes([Path(args.out).with_suffix(".config.yaml")])[str(Path(args.out).with_suffix(".config.yaml"))]
+ output_hashes[str(qc_path)] = hashes([qc_path])[str(qc_path)]
+ write_run_manifest(Path(args.out).with_suffix(".manifest.json"), input_hashes, output_hashes, config, args.data_status)
plt.close(fig)
print(json.dumps({"kind": args.kind, "seed": args.seed, "files": [str(p) for p in saved]}, indent=2))
return 0
@@ -377,10 +478,26 @@ def cmd_prompt(args: argparse.Namespace) -> int:
def build_parser() -> argparse.ArgumentParser:
- parser = argparse.ArgumentParser(description="Scientific Figure Studio: 128 recipes, exports, and mechanism prompt scaffolding")
+ parser = argparse.ArgumentParser(description="Scientific Figure Studio: 129 recipes, exports, and mechanism prompt scaffolding")
sub = parser.add_subparsers(dest="command", required=True)
- p = sub.add_parser("catalog", help="list the 128 plot recipes"); p.add_argument("--json", action="store_true"); p.set_defaults(func=cmd_catalog)
- p = sub.add_parser("render", help="render one deterministic recipe"); p.add_argument("--kind", required=True, choices=sorted(CATALOG)); p.add_argument("--out", required=True); p.add_argument("--seed", type=int, default=0); p.add_argument("--formats", default="pdf,svg,png,tiff"); p.set_defaults(func=cmd_render)
+ p = sub.add_parser("catalog", help="list the 129 plot recipes"); p.add_argument("--json", action="store_true"); p.set_defaults(func=cmd_catalog)
+ p = sub.add_parser("render", help="render one deterministic recipe"); p.add_argument("--kind", required=True, choices=sorted(CATALOG)); p.add_argument("--out", required=True); p.add_argument("--seed", type=int, default=0); p.add_argument("--formats", default="pdf,svg,png")
+ p.add_argument("--features", type=Path, help="V2 features.csv with feature-anchored scores")
+ p.add_argument("--scores", type=Path, help="legacy V1 gene_scores.csv compatibility input")
+ p.add_argument("--links", type=Path, help="V2 endpoint-anchored links.csv")
+ p.add_argument("--sectors", type=Path)
+ p.add_argument("--signed-scores", action="store_true", help="allow signed score values")
+ p.add_argument("--baseline", type=float, default=0, help="reference value for radial score scaling")
+ p.add_argument("--scale", type=float, help="positive score-deviation scale; defaults to max absolute deviation")
+ p.add_argument("--top-n", "--top-k", dest="top_n", type=int, default=4); p.add_argument("--gap-degrees", type=float, default=2)
+ p.add_argument("--start-angle", type=float, default=0)
+ p.add_argument("--link-limit", type=int, default=None, help="optional cap; omitted means draw all validated links")
+ p.add_argument("--figsize", type=float, help="legacy explicit square size in inches")
+ p.add_argument("--width-mm", type=float, choices=(90, 180), default=180)
+ p.add_argument("--chord-tension", type=float, default=.72); p.add_argument("--bundle-strength", type=float, default=.025)
+ p.add_argument("--label-orientation", choices=("tangent", "radial"), default="tangent")
+ p.add_argument("--max-label-chars", type=int, default=18)
+ p.add_argument("--data-status", choices=("demo", "real"), default="real"); p.set_defaults(func=cmd_render)
p = sub.add_parser("contact-sheet", help="render a catalog contact sheet"); p.add_argument("--out", required=True); p.add_argument("--limit", type=int, default=32); p.add_argument("--start", type=int, default=0); p.add_argument("--columns", type=int, default=4); p.add_argument("--seed", type=int, default=0); p.set_defaults(func=cmd_contact)
p = sub.add_parser("mechanism-prompt", help="print built-in imagegen prompt scaffolding"); p.add_argument("--request", default="a bounded scientific mechanism linking a measured state to context-specific outputs"); p.set_defaults(func=cmd_prompt)
return parser
diff --git a/scripts/test_catalog.py b/scripts/test_catalog.py
index 1ab384e..3c16f38 100644
--- a/scripts/test_catalog.py
+++ b/scripts/test_catalog.py
@@ -12,11 +12,15 @@
def main() -> int:
- parser = argparse.ArgumentParser(); parser.add_argument("--out-dir", type=Path, required=True); parser.add_argument("--limit", type=int, default=128)
+ parser = argparse.ArgumentParser(); parser.add_argument("--out-dir", type=Path, required=True); parser.add_argument("--limit", type=int, default=129)
args = parser.parse_args(); args.out_dir.mkdir(parents=True, exist_ok=True)
names = list(CATALOG)[:args.limit]
for i, name in enumerate(names):
- fig = render_kind(name, seed=i)
+ if name == "circos_lollipop_chord":
+ examples = Path(__file__).resolve().parents[1] / "examples" / "circos"
+ fig = render_kind(name, seed=i, scores=examples / "gene_scores.csv", links=examples / "links.csv", sectors=examples / "sectors.csv")
+ else:
+ fig = render_kind(name, seed=i)
export_figure(fig, args.out_dir / name, ["png"])
plt.close(fig)
expected = {f"{name}.png" for name in names}; actual = {p.name for p in args.out_dir.glob("*.png")}
diff --git a/tests/golden/circos_v2_six_sector.png b/tests/golden/circos_v2_six_sector.png
new file mode 100644
index 0000000..b53e585
Binary files /dev/null and b/tests/golden/circos_v2_six_sector.png differ
diff --git a/tests/test_circos_geometry.py b/tests/test_circos_geometry.py
new file mode 100644
index 0000000..e5aa40d
--- /dev/null
+++ b/tests/test_circos_geometry.py
@@ -0,0 +1,103 @@
+"""Numeric geometry tests run before any V2 rendering/export work."""
+from __future__ import annotations
+
+import math
+import sys
+import unittest
+from pathlib import Path
+
+sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
+from circos_geometry import feature_angles, link_geometry, score_radii, sector_intervals
+
+
+def fixture(n_sectors: int, n_features: int) -> tuple[list[str], list[dict[str, object]]]:
+ names = [f"S{i:02d}" for i in range(n_sectors)]
+ rows = []
+ for index in range(n_features):
+ sector = names[index % n_sectors]
+ score = ((index * 37) % 101) / 100
+ rows.append({"sector": sector, "feature_id": f"F{index:04d}", "_score": score})
+ return names, rows
+
+
+class CircosGeometryTests(unittest.TestCase):
+ def test_six_sector_asymmetric_layout_maps_all_features_monotonically(self):
+ names, rows = fixture(6, 63)
+ counts = {name: sum(row["sector"] == name for row in rows) for name in names}
+ intervals = sector_intervals(names, counts, gap_degrees=2.5, start_degrees=-37)
+ anchors = feature_angles(rows, intervals)
+ self.assertEqual(len(anchors), 63)
+ self.assertAlmostEqual(sum(arc.span for arc in intervals.values()) + math.radians(2.5)*6, 2*math.pi)
+ self.assertNotEqual(len({round(arc.span, 8) for arc in intervals.values()}), 1)
+ for name, arc in intervals.items():
+ angles = [angle for (sector, _), angle in anchors.items() if sector == name]
+ self.assertEqual(angles, sorted(angles))
+ self.assertGreater(min(angles), arc.start)
+ self.assertLess(max(angles), arc.end)
+
+ def test_twelve_sector_two_hundred_plus_feature_layout_and_sparse_dense_links(self):
+ names, rows = fixture(12, 240)
+ counts = {name: sum(row["sector"] == name for row in rows) for name in names}
+ intervals = sector_intervals(names, counts, gap_degrees=1.5)
+ anchors = feature_angles(rows, intervals)
+ sparse = [{"from_sector": names[0], "from_feature": "F0000", "to_sector": names[6], "to_feature": "F0006"}]
+ dense = []
+ for i in range(60):
+ source_index, target_index = i, i + 120
+ dense.append({"from_sector": names[source_index % 12], "from_feature": f"F{source_index:04d}",
+ "to_sector": names[target_index % 12], "to_feature": f"F{target_index:04d}"})
+ self.assertEqual(len(link_geometry(sparse, anchors, inner_radius=.53)), 1)
+ paths = link_geometry(dense, anchors, inner_radius=.53, tension=.74, bundle_strength=.025)
+ self.assertEqual(len(paths), 60)
+ self.assertTrue(all(path.radius.min() > 0 for path in paths))
+
+ def test_chord_endpoints_are_named_feature_angles_at_inner_radius(self):
+ names, rows = fixture(6, 60)
+ counts = {name: 10 for name in names}
+ anchors = feature_angles(rows, sector_intervals(names, counts, gap_degrees=2))
+ link = {"from_sector": "S00", "from_feature": "F0000", "to_sector": "S03", "to_feature": "F0003"}
+ path, = link_geometry([link], anchors, inner_radius=.57, tension=.7)
+ self.assertAlmostEqual(path.radius[0], .57)
+ self.assertAlmostEqual(path.radius[-1], .57)
+ self.assertAlmostEqual(path.theta[0], anchors[("S00", "F0000")])
+ delta = (path.theta[-1] - anchors[("S03", "F0003")]) % (2*math.pi)
+ self.assertAlmostEqual(min(delta, 2*math.pi-delta), 0)
+ self.assertGreater(path.radius.min(), .2)
+
+ def test_missing_named_anchor_fails_instead_of_using_sector_midpoint(self):
+ with self.assertRaisesRegex(ValueError, "missing feature anchor"):
+ link_geometry([{"from_sector": "S00", "from_feature": "MISSING",
+ "to_sector": "S01", "to_feature": "F0001"}], {}, inner_radius=.5)
+
+ def test_signed_score_radius_preserves_sign_and_zero_baseline(self):
+ rows = [{"sector": "A", "feature_id": "n", "_score": -2.0},
+ {"sector": "A", "feature_id": "z", "_score": 0.0},
+ {"sector": "A", "feature_id": "p", "_score": 4.0}]
+ radii, info = score_radii(rows, inner_radius=.6, outer_radius=.9, baseline=0, signed=True, scale=4)
+ self.assertLess(radii[("A", "n")], info["baseline_radius"])
+ self.assertAlmostEqual(radii[("A", "z")], info["baseline_radius"])
+ self.assertGreater(radii[("A", "p")], info["baseline_radius"])
+ self.assertAlmostEqual(radii[("A", "p")], .9)
+ with self.assertRaisesRegex(ValueError, "negative scores require signed=True"):
+ score_radii(rows, inner_radius=.6, outer_radius=.9)
+
+ def test_nonnegative_score_radius_is_linear_and_zero_is_baseline(self):
+ rows = [{"sector": "A", "feature_id": "0", "_score": 0.0},
+ {"sector": "A", "feature_id": "5", "_score": 5.0},
+ {"sector": "A", "feature_id": "10", "_score": 10.0}]
+ radii, info = score_radii(rows, inner_radius=.6, outer_radius=.9, scale=10)
+ self.assertAlmostEqual(radii[("A", "0")], .6)
+ self.assertAlmostEqual(radii[("A", "5")], .75)
+ self.assertAlmostEqual(radii[("A", "10")], .9)
+ self.assertFalse(info["signed"])
+
+ def test_geometry_is_deterministic(self):
+ first = fixture(6, 60)
+ second = fixture(6, 60)
+ intervals_a = sector_intervals(first[0], {name: 10 for name in first[0]})
+ intervals_b = sector_intervals(second[0], {name: 10 for name in second[0]})
+ self.assertEqual(feature_angles(first[1], intervals_a), feature_angles(second[1], intervals_b))
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/tests/test_circos_recipe.py b/tests/test_circos_recipe.py
new file mode 100644
index 0000000..39fe7f4
--- /dev/null
+++ b/tests/test_circos_recipe.py
@@ -0,0 +1,120 @@
+import csv
+import sys
+import tempfile
+import unittest
+from pathlib import Path
+
+import matplotlib.pyplot as plt
+
+ROOT = Path(__file__).resolve().parents[1]
+sys.path.insert(0, str(ROOT / "scripts"))
+from circos_recipe import load_data, render # noqa: E402
+from figure_studio import export_figure, render_kind # noqa: E402
+
+
+class CircosRecipeTests(unittest.TestCase):
+ def setUp(self):
+ self.tmp = tempfile.TemporaryDirectory()
+ self.root = Path(self.tmp.name)
+
+ def tearDown(self):
+ self.tmp.cleanup()
+
+ def write(self, name, columns, rows):
+ path = self.root / name
+ with path.open("w", newline="", encoding="utf-8") as handle:
+ writer = csv.writer(handle); writer.writerow(columns); writer.writerows(rows)
+ return path
+
+ def data(self, sector_sizes=(8, 10, 12), links=None, long=False):
+ names = [f"Sector{i}" for i in range(len(sector_sizes))]
+ score_rows = []
+ for si, (sector, size) in enumerate(zip(names, sector_sizes)):
+ for gi in range(size):
+ gene = ("VeryLongGeneLabel_" + "X" * 45 + str(gi)) if long else f"Gene{gi}"
+ score_rows.append([sector, gene, gi + 1, ("up", "down", "risk", "protective", "neutral")[gi % 5], "", 0])
+ scores = self.write("scores.csv", ["sector", "gene", "score", "direction", "display_label", "label_priority"], score_rows)
+ link_feature = score_rows[1][1] if long else "Gene1"
+ link_rows = links if links is not None else [[names[i], names[i+1], link_feature, 1] for i in range(len(names)-1)]
+ link_path = self.write("links.csv", ["source_sector", "target_sector", "feature", "weight"], link_rows)
+ sectors = self.write("sectors.csv", ["sector", "display_name", "order", "color"], [[n, n, i, "#DCE8EF"] for i, n in enumerate(names)])
+ return load_data(scores, link_path, sectors), scores, link_path, sectors
+
+ def test_many_asymmetric_sectors_mixed_directions_and_long_labels(self):
+ data, *_ = self.data((8, 9, 10, 11, 12, 13, 20), long=True)
+ fig = render(data, top_n=2)
+ self.assertEqual(len(fig.axes), 1)
+ self.assertGreater(len(fig.axes[0].collections), 0)
+ label_texts = [text.get_text() for text in fig.axes[0].texts if text.get_text().startswith("VeryLong")]
+ self.assertTrue(label_texts)
+ self.assertTrue(all(len(label) <= 18 and label.endswith("…") for label in label_texts))
+ plt.close(fig)
+
+ def test_empty_links_and_limit_are_stable(self):
+ data, *_ = self.data(links=[])
+ fig0 = render(data); lines0 = len(fig0.axes[0].lines); plt.close(fig0)
+ data, *_ = self.data()
+ fig1 = render(data, link_limit=1); lines1 = len(fig1.axes[0].lines); plt.close(fig1)
+ fig2 = render(data, link_limit=2); lines2 = len(fig2.axes[0].lines); plt.close(fig2)
+ self.assertEqual(lines1 - lines0, 1)
+ self.assertEqual(lines2 - lines1, 1)
+
+ def test_missing_data_and_invalid_sectors_fail_clearly(self):
+ with self.assertRaisesRegex(ValueError, "requires --features and --links"):
+ render_kind("circos_lollipop_chord")
+ with self.assertRaisesRegex(ValueError, "absent from gene_scores.csv"):
+ self.data(links=[["missing", "Sector1", "Gene1", 1]])
+
+ def test_missing_score_column_and_duplicate_feature_link_fail(self):
+ bad = self.write("bad.csv", ["sector", "gene", "direction"], [["A", "G", "up"]])
+ with self.assertRaisesRegex(ValueError, "missing required columns: score"):
+ load_data(bad, self.write("emptylinks.csv", ["source_sector", "target_sector"], []))
+ duplicate = [["Sector0", "Sector1", "Gene1", 1], ["Sector0", "Sector1", "Gene1", 2]]
+ with self.assertRaisesRegex(ValueError, "conflicting type or weight"):
+ self.data(links=duplicate)
+
+ def test_nonfinite_or_negative_scores_and_unknown_directions_fail(self):
+ score = self.write("s.csv", ["sector", "gene", "score", "direction"], [["A", "G", "nan", "up"]])
+ links = self.write("l.csv", ["source_sector", "target_sector"], [])
+ with self.assertRaisesRegex(ValueError, "must be finite"):
+ load_data(score, links)
+ unknown = self.write("unknown.csv", ["sector", "gene", "score", "direction"], [["A", "G", 1, "causal"]])
+ with self.assertRaisesRegex(ValueError, "unknown direction"):
+ load_data(unknown, links)
+ negative = self.write("negative.csv", ["sector", "gene", "score", "direction"], [["A", "G", -2, "down"]])
+ with self.assertRaisesRegex(ValueError, "requires --signed-scores"):
+ load_data(negative, links)
+ data = load_data(negative, links, signed_scores=True)
+ self.assertTrue(data["signed_scores"])
+ fig = render(data, baseline=0)
+ self.assertGreater(len(fig.axes[0].lines), 0)
+ plt.close(fig)
+ with self.assertRaisesRegex(ValueError, "exceeds the configured symmetric scale"):
+ render(data, baseline=0, score_scale=1)
+ zero_weight = self.write("zero.csv", ["source_sector", "target_sector", "feature", "weight"], [["A", "A", "G", 0]])
+ with self.assertRaisesRegex(ValueError, "must be finite and positive"):
+ load_data(self.write("positive.csv", ["sector", "gene", "score", "direction"], [["A", "G", 1, "up"], ["B", "G", 1, "up"]]), zero_weight)
+
+ def test_fixed_input_produces_identical_artist_geometry(self):
+ data, *_ = self.data()
+ fig_a = render(data); fig_b = render(data)
+ self.assertEqual([line.get_xydata().tolist() for line in fig_a.axes[0].lines], [line.get_xydata().tolist() for line in fig_b.axes[0].lines])
+ plt.close(fig_a); plt.close(fig_b)
+
+ def test_vector_and_600_dpi_png_signatures(self):
+ data, *_ = self.data()
+ fig = render(data)
+ base = self.root / "figure"
+ paths = export_figure(fig, base, ["pdf", "svg", "png"], png_dpi=600)
+ self.assertEqual(paths[0].read_bytes()[:4], b"%PDF")
+ self.assertIn(b"