about summary refs log tree commit diff
path: root/test/python/test_openapi.py
diff options
context:
space:
mode:
authorPjotr Prins <pjotr.public01@thebird.nl>2026-11-16 16:18:05 +0000
committerPjotr Prins <pjotr.public01@thebird.nl>2026-11-16 16:18:05 +0000
commit33e837e771e07936c808fb3aeb3540525691718c (patch)
tree597a452051f2cd6f901c39b95acad2d1bafc6352 /test/python/test_openapi.py
parent0e94a6a728e08feb69f183667f62dfabf86768d8 (diff)
downloadgenenetwork4-33e837e771e07936c808fb3aeb3540525691718c.tar.gz
plot: the scree plot of a matrix PCA, which GN2 draws client-side
GN2 renders a scree plot with Plotly in the browser, from the explained
variance ratios its matrix page computed. This is the same figure as a file:
`POST /plot/pca` takes the matrix reply (with `"pca": true`) as-is and returns
image/svg+xml, like every other plot endpoint -- the plot is of the numbers
that were computed, nothing is recomputed.

scripts/plot-pca.py draws a bar per component (its share of the variance,
GN2's number), a cumulative line with the 80%-of-variance crossing annotated
(what a reader actually uses to choose how many components to keep), the
eigenvalue in each bar's tooltip, and the traits the PCA had to drop for gaps
in the matrix -- the one thing GN2 hides by mutating its shared-sample list.
`kind=N` on the request caps how many components are drawn, since a
200-trait matrix would otherwise draw 200 bars.

Also: the monitor's SVG judge now understands a binary reply (the client hands
back content type and size, not the bytes), and `plot-pca` is a check of its
own: it asks the matrix for a PCA and posts the reply to the plotter.

Deployed: PCA_PLOTTER is pinned in env.sh (the code default is a relative
path, which only resolves when the service's working directory is the
checkout). plot-pca and plot-genotypes both ok.
Diffstat (limited to 'test/python/test_openapi.py')
0 files changed, 0 insertions, 0 deletions