diff options
| author | Pjotr Prins <pjotr.public01@thebird.nl> | 2026-10-03 16:14:58 +0000 |
|---|---|---|
| committer | Pjotr <wrk@bosa.lan> | 2026-10-04 06:31:16 +0000 |
| commit | 11be60ffc1d3a4717b796cb93bb6c7542aa04119 (patch) | |
| tree | 397675b277a4b6fbbe1ffd40402b9cbb86a2fb29 /docs | |
| parent | e7191463db66fcc3c2618ccdf004e798e1d3ac6a (diff) | |
| download | genenetwork4-11be60ffc1d3a4717b796cb93bb6c7542aa04119.tar.gz | |
doc: Add ProbeSetXRef section to genenetwork_datatypes.md.
* docs/genenetwork_datatypes.md (ProbeSetXRef): New section, the expression (mRNA) counterpart to the PublishXRef section above: ProbeSetXRef's own fields, its relationships to ProbeSetFreeze/ ProbeFreeze/InbredSet/Tissue, ProbeSet, and ProbeSetData/ProbeSetSE/ Strain, and the lack of a declared uniqueness constraint on (ProbeSetFreezeId, ProbeSetId). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XDDpXvZBQat9uSgDeEMJ8d
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/genenetwork_datatypes.md | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/docs/genenetwork_datatypes.md b/docs/genenetwork_datatypes.md index f55752e..495a8c3 100644 --- a/docs/genenetwork_datatypes.md +++ b/docs/genenetwork_datatypes.md @@ -283,3 +283,80 @@ and surfacing its `Phenotype`/`Publication` metadata alongside them. (the `PublishXRef`/`Phenotype`/`Publication` join above, generalized to any group) and `GET /groups/{group}/traits/{trait_id}/values` (per-strain `PublishData` values). + +## ProbeSetXRef + +The `ProbeSetXRef` table (full `CREATE TABLE` in +`docs/mariadb_db-webqtl.md`) is the expression (mRNA) counterpart to +`PublishXRef`: one row per probe/gene per expression dataset, tying +together a probe's actual per-strain values (`ProbeSetData`) with a +single best QTL hit (`Locus`/`LRS`/`pValue`/`additive`/`mean`). Unlike +`PublishXRef`, it has no single `Id` column of its own -- its primary +key is `DataId`, and the natural key identifying one row is the pair +`(ProbeSetFreezeId, ProbeSetId)`. + +### Fields + +| Field | Meaning | +|--------------------|------------------------------------------------------------------------------------------| +| `ProbeSetFreezeId` | FK to `ProbeSetFreeze`; identifies the expression dataset this row's mapping belongs to. | +| `ProbeSetId` | FK to `ProbeSet`; the probe/gene this row's mapping belongs to. | +| `DataId` | Primary key; FK to `ProbeSetData.Id`, the trait's actual per-strain values. | +| `mean` | Mean expression value across strains. | +| `se` | Standard error of the mean. | +| `Locus` | Marker/SNP name of this trait's single stored QTL hit. | +| `LRS` | LOD/LRS score of that hit. | +| `pValue` | p-value of that hit. | +| `additive` | Additive effect size of that hit. | +| `h2` | Heritability estimate. | + +### Relationships + +- `ProbeSetXRef.ProbeSetFreezeId` -> `ProbeSetFreeze` -- the expression + dataset (e.g. a tissue/platform/batch combination) this mapping + belongs to. `ProbeSetFreeze.ProbeFreezeId` -> `ProbeFreeze.ProbeFreezeId` + (the same "set equal to the primary key after insert" pattern as + `Species.SpeciesId`/`InbredSet.InbredSetId`) -> `ProbeFreeze.InbredSetId` + -> `InbredSet` is how an expression dataset is scoped to a group; + `ProbeFreeze.TissueId` -> `Tissue` names the tissue it was measured + in. +- `ProbeSetXRef.ProbeSetId` -> `ProbeSet` -- the probe/gene annotation + (`Name`, `Symbol`, `description`, `Chr`, `Mb`, `alias`, `GeneId`, ...). + `ProbeSet.Name` is only unique per `(ChipId, Name)`, not globally, but + is unique in practice within one dataset's member probes, which is + how GeneNetwork2 and this repo both address a probe (dataset name + plus `ProbeSet.Name`) without needing `ProbeSetId` in the URL. +- `ProbeSetXRef.DataId` -> `ProbeSetData.Id` -- the trait's actual + per-strain values; `ProbeSetData.StrainId` -> `Strain` names them. + `ProbeSetSE` (per-strain standard error) keys off the same + `(DataId, StrainId)` pair, optional (left-joined in GeneNetwork2's + own queries), same pattern as `PublishSE` for `PublishData`. + +### Known quirks + +- No `(ProbeSetFreezeId, ProbeSetId)` `UNIQUE KEY` is declared in the + schema (only separate, non-unique `KEY`s on each column) -- a probe + is assumed to appear at most once per dataset by convention, not by + a database constraint; both GeneNetwork2 and this repo rely on that + assumption (`exec_first`/`fetchone()`). +- Only a single highest-LRS hit is stored per probe, the same + limitation `PublishXRef` has (see its Known quirks above) -- the + same precompute docs discuss extending both tables to store more + hits. + +### Existing implementations + +- **GeneNetwork2** (`gn2/wqflask/api/router.py`): `get_datasets_for_group` + (list, `ProbeSetFreeze` joined to `ProbeFreeze`/`InbredSet`), + `get_dataset_info`'s ProbeSet branch (one dataset, joined to + `Tissue`), `trait_sample_data`'s ProbeSet branch (per-strain + `ProbeSetData` values), `get_trait_info`'s ProbeSet branch + (`ProbeSet` annotation plus `ProbeSetXRef` mapping stats, minus + `pValue`). +- **GeneNetwork4** (this repo): `GET /groups/{group}/datasets` (list), + `GET /datasets/{dataset}` (one dataset -- not scoped under + `/groups/{group}`, since a dataset name is globally unique on its + own), `GET /datasets/{dataset}/probesets/{probeset}` (the + `ProbeSetXRef`/`ProbeSet` join above) and + `GET /datasets/{dataset}/probesets/{probeset}/values` (per-strain + `ProbeSetData` values). |
