Skip to content

Commit bccc1e3

Browse files
authored
Merge pull request #500 from genestack/feature/ODM-12846-gene-summary-analytics
ODM-12846: gene summary analytics
2 parents 2f23345 + 6e0aae3 commit bccc1e3

File tree

4 files changed

+234
-0
lines changed

4 files changed

+234
-0
lines changed

openapi/v1/integrationCurator.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7075,6 +7075,59 @@ paths:
70757075
security:
70767076
- Access-token: [ ]
70777077
- Genestack-API-Token: [ ]
7078+
/api/v1/as-curator/omics/cells/analytics/gene-summary:
7079+
post:
7080+
operationId: geneSummaryAsCurator
7081+
summary: "[BETA] Compute and retrieve descriptive statistics and visual summaries for single-cell data."
7082+
tags:
7083+
- "[BETA] Analytics omics queries as Curator"
7084+
description: |+
7085+
This endpoint provides descriptive statistical metrics for gene expression across single-cell datasets.
7086+
It aggregates and summarizes expression data for each gene to help assess variability, distribution,
7087+
and intensity of expression within the population of cells.
7088+
7089+
The computed metrics include:
7090+
- `Gene name` - gene identifier.
7091+
- `Cell count` - number of cells with measurable expression for each gene.
7092+
- `Mean expression value`
7093+
- `Median expression value`
7094+
- `Quantiles` - configurable expression percentiles.
7095+
- `Histogram (density)` - binned distribution of expression levels for visualization.
7096+
- `Standard deviation` - dispersion of expression values.
7097+
- `Minimum and maximum values` - range of expression across cells.
7098+
7099+
Results are sorted by gene name.
7100+
requestBody:
7101+
required: true
7102+
content:
7103+
application/json:
7104+
schema:
7105+
$ref: "#/components/schemas/GSRequest"
7106+
responses:
7107+
"200":
7108+
description: Gene summary result
7109+
content:
7110+
application/json:
7111+
schema:
7112+
$ref: "#/components/schemas/GSResponse"
7113+
"400":
7114+
content: { }
7115+
description: Invalid data in the request. See the error message for details.
7116+
"401":
7117+
content: { }
7118+
description: |+
7119+
User is not authenticated. Please supply a valid Access Token in the `Authorization`
7120+
HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token`
7121+
header (this token may be obtained from the Genestack UI _Profile_ page).
7122+
"500":
7123+
content: { }
7124+
description: |+
7125+
An internal server error occurred. This indicates an unexpected
7126+
failure in the Genestack system, please file a bug report to support@genestack.com,
7127+
including the error details."
7128+
security:
7129+
- Access-token: [ ]
7130+
- Genestack-API-Token: [ ]
70787131
/api/v1/as-curator/integration/studies/{id}/tasks/publish-versions:
70797132
post:
70807133
description: This endpoint publishes information from staging and creates new
@@ -7430,6 +7483,10 @@ components:
74307483
$ref: "./schemas/cell/DERequest.yaml"
74317484
DEResponse:
74327485
$ref: "./schemas/cell/DEResponse.yaml"
7486+
GSRequest:
7487+
$ref: "./schemas/cell/GSRequest.yaml"
7488+
GSResponse:
7489+
$ref: "./schemas/cell/GSResponse.yaml"
74337490
securitySchemes:
74347491
Access-token:
74357492
in: header

openapi/v1/integrationUser.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5526,6 +5526,59 @@ paths:
55265526
security:
55275527
- Access-token: [ ]
55285528
- Genestack-API-Token: [ ]
5529+
/api/v1/as-user/omics/cells/analytics/gene-summary:
5530+
post:
5531+
operationId: geneSummaryAsUser
5532+
summary: "[BETA] Compute and retrieve descriptive statistics and visual summaries for single-cell data."
5533+
tags:
5534+
- "[BETA] Analytics omics queries as User"
5535+
description: |+
5536+
This endpoint provides descriptive statistical metrics for gene expression across single-cell datasets.
5537+
It aggregates and summarizes expression data for each gene to help assess variability, distribution,
5538+
and intensity of expression within the population of cells.
5539+
5540+
The computed metrics include:
5541+
- `Gene name` - gene identifier.
5542+
- `Cell count` - number of cells with measurable expression for each gene.
5543+
- `Mean expression value`
5544+
- `Median expression value`
5545+
- `Quantiles` - configurable expression percentiles.
5546+
- `Histogram (density)` - binned distribution of expression levels for visualization.
5547+
- `Standard deviation` - dispersion of expression values.
5548+
- `Minimum and maximum values` - range of expression across cells.
5549+
5550+
Results are sorted by gene name.
5551+
requestBody:
5552+
required: true
5553+
content:
5554+
application/json:
5555+
schema:
5556+
$ref: "#/components/schemas/GSRequest"
5557+
responses:
5558+
"200":
5559+
description: Gene summary result
5560+
content:
5561+
application/json:
5562+
schema:
5563+
$ref: "#/components/schemas/GSResponse"
5564+
"400":
5565+
content: { }
5566+
description: Invalid data in the request. See the error message for details.
5567+
"401":
5568+
content: { }
5569+
description: |+
5570+
User is not authenticated. Please supply a valid Access Token in the `Authorization`
5571+
HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token`
5572+
header (this token may be obtained from the Genestack UI _Profile_ page).
5573+
"500":
5574+
content: { }
5575+
description: |+
5576+
An internal server error occurred. This indicates an unexpected
5577+
failure in the Genestack system, please file a bug report to support@genestack.com,
5578+
including the error details."
5579+
security:
5580+
- Access-token: [ ]
5581+
- Genestack-API-Token: [ ]
55295582
/api/v1/as-user/integration/link/files/by/study/{id}:
55305583
get:
55315584
operationId: getFilesByStudyAsUser
@@ -5649,6 +5702,10 @@ components:
56495702
$ref: "./schemas/cell/DERequest.yaml"
56505703
DEResponse:
56515704
$ref: "./schemas/cell/DEResponse.yaml"
5705+
GSRequest:
5706+
$ref: "./schemas/cell/GSRequest.yaml"
5707+
GSResponse:
5708+
$ref: "./schemas/cell/GSResponse.yaml"
56525709
securitySchemes:
56535710
Access-token:
56545711
in: header
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
type: object
2+
properties:
3+
cellGroup:
4+
$ref: '#/components/schemas/CellGroupRequest'
5+
geneNames:
6+
type: array
7+
items:
8+
type: string
9+
example:
10+
- "ENSG00000230368"
11+
- "ENSG00000188976"
12+
- "ENSG00000188982"
13+
exQuery:
14+
type: string
15+
example: '-3 < value < 3'
16+
required:
17+
- geneNames
18+
components:
19+
schemas:
20+
CellGroupRequest:
21+
type: object
22+
properties:
23+
studyFilter:
24+
type: string
25+
example: '"Study Source"=ArrayExpress'
26+
studyQuery:
27+
type: string
28+
example: 'RNA-Seq of human dendritic cells'
29+
sampleFilter:
30+
type: string
31+
example: '"Species or strain"="Homo sapiens"'
32+
sampleQuery:
33+
type: string
34+
example: 'Clozapine'
35+
libraryFilter:
36+
type: string
37+
example: '"Library Type"=RNA-Seq-1'
38+
libraryQuery:
39+
type: string
40+
example: 'illumina HiSeq500'
41+
preparationFilter:
42+
type: string
43+
example: 'Digestion=Trypsin'
44+
preparationQuery:
45+
type: string
46+
example: 'reversed-phase liquid chromatography'
47+
cellQuery:
48+
type: string
49+
example: 'cellType=Macrophage,Monocyte'
50+
searchSpecificTerms:
51+
type: boolean
52+
example: false
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
type: object
2+
properties:
3+
resultsPerGene:
4+
type: array
5+
items:
6+
$ref: '#/components/schemas/GeneSummaryEntry'
7+
components:
8+
schemas:
9+
GeneSummaryEntry:
10+
type: object
11+
description: Per-gene summary statistics.
12+
properties:
13+
geneId:
14+
type: string
15+
description: Gene identifier.
16+
example: "ENSG00000111640"
17+
cellCount:
18+
type: integer
19+
format: int32
20+
description: Number of cells expressing the gene.
21+
example: 8968167
22+
mean:
23+
type: number
24+
format: double
25+
description: Mean expression
26+
example: 7.747614311820911
27+
median:
28+
type: number
29+
format: double
30+
description: Median expression
31+
example: 7
32+
stdDev:
33+
type: number
34+
format: double
35+
description: Standard deviation
36+
example: 6.499314669429827
37+
min:
38+
type: number
39+
format: double
40+
description: Minimum value
41+
example: 1
42+
max:
43+
type: number
44+
format: double
45+
description: Maximum value
46+
example: 496
47+
quantiles:
48+
type: array
49+
description: |
50+
List of quantile values from 0 to 1 (inclusive), with step 0.1
51+
example: |
52+
[1, 1, 2, 3, 5, 7, 10, 12, 15, 27, 192]
53+
items:
54+
type: number
55+
format: double
56+
histogram:
57+
type: array
58+
description: |
59+
Histogram as a list of [binStart, binEnd, count] triples.
60+
Length depends of the selected sample size, maximum is 20.
61+
example: |
62+
[(1, 15.50289002318, 7686678.375), (15.50289002318, 35.49570418233824, 1229164),
63+
(35.49570418233824, 56.93121325335453, 36531.25), (56.93121325335453, 77.21467372919479, 6910.625)]
64+
items:
65+
type: array
66+
items:
67+
type: number
68+
format: double

0 commit comments

Comments
 (0)