diff options
| author | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-16 18:14:29 +0000 |
|---|---|---|
| committer | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-11-16 18:14:29 +0000 |
| commit | 304b92e310df9570a67ef3cdd3bbcc714569bc83 (patch) | |
| tree | 9ed8dbda8f62f23f04e255bc31d41093a7878eda /src/plot.rs | |
| parent | 061b76a5d963b7d5e2ce9d858094b305929766f2 (diff) | |
| download | genenetwork4-304b92e310df9570a67ef3cdd3bbcc714569bc83.tar.gz | |
correlation: PC traits as basket columns, and compare-two-traits
**PC traits.** `pca.traits` carries each component *as a trait*: PC1, PC2, ... with a score per individual, so a component can be used the way GN2's "PCA traits" are -- correlated, mapped, plotted, saved. Scores are the standardised values projected onto the loadings, standardised with the sample standard deviation because that is what the correlation matrix was built from; a constant trait has no z-score and refuses rather than filling a zero. They live on the complete cases of the kept traits (31 of 34 in the fixture), which is the honest reading of "a PCA is defined on a rectangle". The module story is a basket: POST /baskets with a PC's values gives a per-user, versioned, digest-recorded column (verified: 201, revision 1, values read back), which the mapping and plotting endpoints already accept. No new store, no new dataset concept. **Compare traits.** POST /compute/compare takes two trait references, keeps the individuals with a value for both, and returns r, p, n *and* the pairs -- the statistic and the data behind it. It agrees with the matrix: the same pair is r = 0.6756270426459695 in both. POST /plot/compare draws the scatter (6 303 bytes) with the individual's name in each tooltip and the OLS line implied by r and the two means; nothing is refitted. Monitor gained compute-compare and plot-compare; full run 49 ok, 0 failed, 1 skipped. Not done, deliberately: limit_to/ids_only/names_only. The listing handlers return typed rows (Envelope<Vec<TraitInfo>>), so "names only" is a shape change in every one of them -- a pass of its own rather than a query parameter.
Diffstat (limited to 'src/plot.rs')
0 files changed, 0 insertions, 0 deletions
