From e7191463db66fcc3c2618ccdf004e798e1d3ac6a Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Sat, 3 Oct 2026 16:14:49 +0000 Subject: Add ProbeSetXRef endpoints: datasets, probesets, probeset values. The expression (ProbeSet) counterpart to the PublishXRef endpoints: ProbeSetXRef has no single Id column of its own (its primary key is DataId; the natural key is the pair (ProbeSetFreezeId, ProbeSetId)), so a trait here is addressed by dataset name plus ProbeSet.Name instead of a single numeric trait id. * src/db.rs (Dataset): New struct, one ProbeSetFreeze row. (get_group_datasets): New function. Joins ProbeSetFreeze and ProbeFreeze by group Id, matching GeneNetwork2's wqflask.api.router.get_datasets_for_group. (get_dataset_by_name): New function. Matches Name, Name2, FullName, ShortName or numeric Id, matching wqflask.api.router.get_dataset_info's ProbeSet-branch matching logic. A dataset name is globally unique on its own, unlike a group's traits, so this isn't scoped by group. (ProbeSetInfo): New struct, a probe's ProbeSetXRef mapping stats plus its ProbeSet gene annotation. (get_dataset_probeset_info): New function, matching wqflask.api.router.get_trait_info's ProbeSet branch. (ProbeSetValue): New struct. (get_dataset_probeset_values): New function, matching wqflask.api.router.trait_sample_data's ProbeSet branch. * src/lib.rs (DatasetProbesetLookup): New enum, the expression-dataset equivalent of GroupTraitLookup -- distinguishes a missing dataset from a missing probeset in an existing dataset. (group_datasets): New handler for GET /groups/{group}/datasets. (dataset_by_name): New handler for GET /datasets/{dataset}. (get_dataset_probeset_info_result, dataset_probeset_info): New function and handler for GET /datasets/{dataset}/probesets/{probeset}. (get_dataset_probeset_values_result, dataset_probeset_values): New function and handler for GET /datasets/{dataset}/probesets/{probeset}/values. (app): Register all four. * tests/group_datasets.rs, tests/dataset_by_name.rs, tests/dataset_probeset_info.rs, tests/dataset_probeset_values.rs, test/python/test_group_datasets.py, test/python/test_dataset_by_name.py, test/python/test_dataset_probeset_info.py, test/python/test_dataset_probeset_values.py: New files. Br_U_0803_M (dataset) / 100001_at (probeset, gene symbol Cd3g) in BXD are real rows used as fixtures. * tests/openapi.rs, test/python/test_openapi.py: Check the four new paths are in the generated spec. * README.md: Document the four new endpoints and list the new test files. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01XDDpXvZBQat9uSgDeEMJ8d --- test/python/test_openapi.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/python/test_openapi.py') diff --git a/test/python/test_openapi.py b/test/python/test_openapi.py index 3b4b704..c66a0c8 100644 --- a/test/python/test_openapi.py +++ b/test/python/test_openapi.py @@ -30,6 +30,10 @@ class OpenApiTest(ServerTestCase): "/groups/{group}/strains", "/groups/{group}/traits/{trait_id}", "/groups/{group}/traits/{trait_id}/values", + "/groups/{group}/datasets", + "/datasets/{dataset}", + "/datasets/{dataset}/probesets/{probeset}", + "/datasets/{dataset}/probesets/{probeset}/values", ): self.assertIn(path, doc["paths"]) -- cgit 1.4.1