From e5aae85df5a0c39f48b17311a90cbedd505f52be Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 20 Jun 2024 10:33:03 +0200 Subject: [PATCH 1/2] Better endpoint --- CHANGELOG.md | 1 + docs/usage/sample-coverage.md | 38 ++++++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d2aba89..8fb05b0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [unreleased] ### Added - Condensed `/coverage/d4/genes/summary` for condensed stats over a gene list +- Documentation for new coverage summary endpoint ### Changed - GitHub tests action to use d4tools 0.3.10 ### Fixed diff --git a/docs/usage/sample-coverage.md b/docs/usage/sample-coverage.md index c2ba5582..7612b073 100644 --- a/docs/usage/sample-coverage.md +++ b/docs/usage/sample-coverage.md @@ -130,6 +130,42 @@ And it would return the following result: ] ``` +### Condensed summary stats for one or more samples over a list of HGNC IDs + +To obtain condensed statistics for one or more samples, use the `/coverage/d4/genes/summary` endpoint. +Send a request with a list of HGNC gene IDs, the path to the d4 files for the samples, and the coverage threshold for computing coverage completeness. +The endpoint will return the average coverage and coverage completeness for all the genes included in the query. +You need to provide a parameter `interval_type` to specify whether the statistics should be computed over entire genes, gene transcripts, or exons. + +#### Request example: + +``` shell +curl -X 'POST' \ + 'https://chanjo2-stage.scilifelab.se/coverage/d4/genes/summary' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "build": "GRCh37", + "samples": [ + { + "name": "Sample_Name", + "coverage_file_path": "" + } + ], + "hgnc_gene_ids": [ + 2861, 3791, 6481, 7436, 30521 + ], + "coverage_threshold": 10, + "interval_type": "genes" +}' +``` + +#### Response from chanjo2: + +``` shell +{"TestSample":{"mean_coverage":54.38,"coverage_completeness_percent":33.03}} +``` + ### Case and samples coverage queries Genes, transcripts and exons coverage data can be computed by sending POST requests to their relative endpoints: @@ -150,7 +186,7 @@ These endpoints are very similar and accept the following parameters: While the only required parameter is "build", it is necessary to specify a list of genes (either ensembl_gene_ids, hgnc_gene_ids or hgnc_gene_symbols) and either a case or a list of samples. -### Coverage and coverage completeness query esamples +### Coverage and coverage completeness query examples - Given all samples from case "internal_id", retrieve mean coverage and coverage completeness with threshold 30, 20 on the genes from the Cerebral folate deficiency PanelAPP panel (*DHFR, FOLR1, MTHFR, SLC46A1*): From a8f69a63524a9af261feda28443becf12f65dba2 Mon Sep 17 00:00:00 2001 From: Chiara Rasi Date: Thu, 20 Jun 2024 10:34:06 +0200 Subject: [PATCH 2/2] Fix sample name --- docs/usage/sample-coverage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/sample-coverage.md b/docs/usage/sample-coverage.md index 7612b073..709aeb73 100644 --- a/docs/usage/sample-coverage.md +++ b/docs/usage/sample-coverage.md @@ -148,7 +148,7 @@ curl -X 'POST' \ "build": "GRCh37", "samples": [ { - "name": "Sample_Name", + "name": "TestSample", "coverage_file_path": "" } ],