Skip to content

Commit 2f23345

Browse files
authored
ODM-12847: Differential expression for cell analysis (#492)
* ODM-12847: cell analysis: diff expression
1 parent d57c084 commit 2f23345

File tree

5 files changed

+267
-1
lines changed

5 files changed

+267
-1
lines changed

build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ tasks {
6060
// Workaround for https://github.com/OpenAPITools/openapi-generator/issues/21619
6161
// The second version asks for license, which we can't provide due to unavailability of
6262
// "licenseName" and "licenseUrl" fields in the specification for python generator.
63-
"poetry1" to "true"
63+
"poetry1" to "true",
64+
// All float fields accept "NaN", "Infinity", "-Infinity" values
65+
"mapNumberTo" to "float"
6466
// "disallowAdditionalPropertiesIfNotPresent" to "true"
6567
)
6668
}

openapi/v1/integrationCurator.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7021,6 +7021,60 @@ paths:
70217021
summary: Stream data from a given VCF file
70227022
tags:
70237023
- Omics queries as Curator
7024+
/api/v1/as-curator/omics/cells/analytics/differential-expression:
7025+
post:
7026+
operationId: differentialExpressionAsCurator
7027+
summary: "[BETA] Perform differential gene expression analytics between case and control cell groups"
7028+
tags:
7029+
- "[BETA] Analytics omics queries as Curator"
7030+
# The descriptions below are also duplicated in the schema description, make sure to keep them in sync.
7031+
description: |+
7032+
This endpoint computes differential gene expression between two specified cell groups (case vs control) within single-cell data.
7033+
7034+
Consult `/omics` search endpoints to find description of parameters within the cell groups.
7035+
The response includes per-gene metrics that characterize expression differences between the two groups:
7036+
- `Gene name` - gene identifier.
7037+
- `Case cell count` - number of cells expressing the gene in the case group.
7038+
- `Control cell count` - number of cells expressing the gene in the control group.
7039+
- `Average expression (case)` - mean expression level across case cells.
7040+
- `Average expression (control)` - mean expression level across control cells.
7041+
- `Expression difference` - numerical difference between average expressions.
7042+
- `Fold change` - ratio of average expressions between case and control groups.
7043+
- `U statistic` - Mann–Whitney U test statistic that measures the difference between Case and Control groups.
7044+
- `p-value` - the probability of observing results as extreme as (or more extreme than) those obtained, assuming that the null hypothesis is true.
7045+
7046+
Results are sorted by absolute value of fold change in descending order, allowing easy identification of the most differentially expressed genes.
7047+
7048+
Request and response parameters are subject to change as this feature is in BETA.
7049+
requestBody:
7050+
content:
7051+
application/json:
7052+
schema:
7053+
$ref: "#/components/schemas/DERequest"
7054+
required: true
7055+
responses:
7056+
"200":
7057+
content:
7058+
application/json:
7059+
schema:
7060+
$ref: "#/components/schemas/DEResponse"
7061+
description: Differential expression result
7062+
"400":
7063+
content: { }
7064+
description: Entities cannot be retrieved.
7065+
"401":
7066+
content: { }
7067+
description: |-
7068+
User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token])
7069+
or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI _Profile_ page).
7070+
"500":
7071+
content: { }
7072+
description: "An internal server error occurred. This indicates an unexpected\
7073+
\ failure in the Genestack system, please file a bug report to support@genestack.com,\
7074+
\ including the error details."
7075+
security:
7076+
- Access-token: [ ]
7077+
- Genestack-API-Token: [ ]
70247078
/api/v1/as-curator/integration/studies/{id}/tasks/publish-versions:
70257079
post:
70267080
description: This endpoint publishes information from staging and creates new
@@ -7372,6 +7426,10 @@ components:
73727426
$ref: "./schemas/integration/FilterOption.yaml"
73737427
AFile:
73747428
$ref: "./schemas/afile/AFile.yaml"
7429+
DERequest:
7430+
$ref: "./schemas/cell/DERequest.yaml"
7431+
DEResponse:
7432+
$ref: "./schemas/cell/DEResponse.yaml"
73757433
securitySchemes:
73767434
Access-token:
73777435
in: header

openapi/v1/integrationUser.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5472,6 +5472,60 @@ paths:
54725472
summary: Stream data from a given VCF file
54735473
tags:
54745474
- Omics queries as User
5475+
/api/v1/as-user/omics/cells/analytics/differential-expression:
5476+
post:
5477+
operationId: differentialExpressionAsUser
5478+
summary: "[BETA] Perform differential gene expression analytics between case and control cell groups"
5479+
tags:
5480+
- "[BETA] Analytics omics queries as User"
5481+
# The descriptions below are also duplicated in the schema description, make sure to keep them in sync.
5482+
description: |+
5483+
This endpoint computes differential gene expression between two specified cell groups (case vs control) within single-cell data.
5484+
5485+
Consult `/omics` search endpoints to find description of parameters within the cell groups.
5486+
The response includes per-gene metrics that characterize expression differences between the two groups:
5487+
- `Gene name` - gene identifier.
5488+
- `Case cell count` - number of cells expressing the gene in the case group.
5489+
- `Control cell count` - number of cells expressing the gene in the control group.
5490+
- `Average expression (case)` - mean expression level across case cells.
5491+
- `Average expression (control)` - mean expression level across control cells.
5492+
- `Expression difference` - numerical difference between average expressions.
5493+
- `Fold change` - ratio of average expressions between case and control groups.
5494+
- `U statistic` - Mann–Whitney U test statistic that measures the difference between Case and Control groups.
5495+
- `p-value` - the probability of observing results as extreme as (or more extreme than) those obtained, assuming that the null hypothesis is true.
5496+
5497+
Results are sorted by absolute value of fold change in descending order, allowing easy identification of the most differentially expressed genes.
5498+
5499+
Request and response parameters are subject to change as this feature is in BETA.
5500+
requestBody:
5501+
content:
5502+
application/json:
5503+
schema:
5504+
$ref: "#/components/schemas/DERequest"
5505+
required: true
5506+
responses:
5507+
"200":
5508+
content:
5509+
application/json:
5510+
schema:
5511+
$ref: "#/components/schemas/DEResponse"
5512+
description: Differential expression result
5513+
"400":
5514+
content: { }
5515+
description: Entities cannot be retrieved.
5516+
"401":
5517+
content: { }
5518+
description: |-
5519+
User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token])
5520+
or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI _Profile_ page).
5521+
"500":
5522+
content: { }
5523+
description: "An internal server error occurred. This indicates an unexpected\
5524+
\ failure in the Genestack system, please file a bug report to support@genestack.com,\
5525+
\ including the error details."
5526+
security:
5527+
- Access-token: [ ]
5528+
- Genestack-API-Token: [ ]
54755529
/api/v1/as-user/integration/link/files/by/study/{id}:
54765530
get:
54775531
operationId: getFilesByStudyAsUser
@@ -5591,6 +5645,10 @@ components:
55915645
$ref: "./schemas/integration/FilterOption.yaml"
55925646
AFile:
55935647
$ref: "./schemas/afile/AFile.yaml"
5648+
DERequest:
5649+
$ref: "./schemas/cell/DERequest.yaml"
5650+
DEResponse:
5651+
$ref: "./schemas/cell/DEResponse.yaml"
55945652
securitySchemes:
55955653
Access-token:
55965654
in: header
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
type: object
2+
properties:
3+
caseGroup:
4+
$ref: '#/components/schemas/CellGroupRequest'
5+
controlGroup:
6+
$ref: '#/components/schemas/CellGroupRequest'
7+
exQuery:
8+
type: string
9+
example: 'feature=ENSG00000230368,ENSG00000188976'
10+
limit:
11+
type: integer
12+
format: int32
13+
description: This parameter determines the number of results to retrieve per page, with the default set at 2000.
14+
example: 2000
15+
offset:
16+
type: integer
17+
format: int32
18+
description: This parameter allows skipping a specified number of results, with the default set at 0.
19+
example: 0
20+
required:
21+
- caseGroup
22+
- controlGroup
23+
components:
24+
schemas:
25+
CellGroupRequest:
26+
type: object
27+
properties:
28+
studyFilter:
29+
type: string
30+
example: '"Study Source"=ArrayExpress'
31+
studyQuery:
32+
type: string
33+
example: 'RNA-Seq of human dendritic cells'
34+
sampleFilter:
35+
type: string
36+
example: '"Species or strain"="Homo sapiens"'
37+
sampleQuery:
38+
type: string
39+
example: 'Clozapine'
40+
libraryFilter:
41+
type: string
42+
example: '"Library Type"=RNA-Seq-1'
43+
libraryQuery:
44+
type: string
45+
example: 'illumina HiSeq500'
46+
preparationFilter:
47+
type: string
48+
example: 'Digestion=Trypsin'
49+
preparationQuery:
50+
type: string
51+
example: 'reversed-phase liquid chromatography'
52+
cellQuery:
53+
type: string
54+
example: 'cellType=Macrophage,Monocyte'
55+
searchSpecificTerms:
56+
type: boolean
57+
example: false
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
type: object
2+
properties:
3+
resultsPerGene:
4+
type: array
5+
items:
6+
$ref: '#/components/schemas/GeneEntry'
7+
pagination:
8+
$ref: '#/components/schemas/Pagination'
9+
required:
10+
- resultsPerGene
11+
- pagination
12+
components:
13+
schemas:
14+
GeneEntry:
15+
type: object
16+
# The descriptions below are also duplicated in the endpoint description, make sure to keep them in sync.
17+
properties:
18+
geneId:
19+
type: string
20+
description: Gene identifier.
21+
example: ENSG00000230368
22+
caseCellCount:
23+
type: integer
24+
description: Number of cells expressing the gene in the case group.
25+
example: 8450
26+
controlCellCount:
27+
type: integer
28+
description: Number of cells expressing the gene in the control group.
29+
example: 8123
30+
caseAvgExpression:
31+
type: number
32+
format: double
33+
description: Mean expression level across case cells.
34+
example: 1.24
35+
controlAvgExpression:
36+
type: number
37+
format: double
38+
description: Mean expression level across control cells.
39+
example: 0.62
40+
expressionDifference:
41+
type: number
42+
format: double
43+
description: Numerical difference between average expressions.
44+
example: 0.62
45+
foldChange:
46+
type: number
47+
format: double
48+
description: Ratio of average expressions between case and control groups.
49+
example: 2.0
50+
mannWhitneyU:
51+
type: number
52+
format: double
53+
description: Mann–Whitney U test statistic that measures the difference between Case and Control groups.
54+
example: 1.5
55+
pValue:
56+
type: number
57+
format: double
58+
description: The probability of observing results as extreme as (or more extreme than) those obtained, assuming that the null hypothesis is true.
59+
example: 0.95
60+
required:
61+
- geneId
62+
- caseCellCount
63+
- controlCellCount
64+
- caseAvgExpression
65+
- controlAvgExpression
66+
- expressionDifference
67+
- foldChange
68+
- mannWhitneyU
69+
- pValue
70+
Pagination:
71+
type: object
72+
properties:
73+
currentResultsCount:
74+
type: integer
75+
format: int32
76+
description: Number of results returned in the current response.
77+
example: 1
78+
limit:
79+
type: integer
80+
format: int32
81+
description: Results limit, used in the request.
82+
example: 2000
83+
offset:
84+
type: integer
85+
format: int32
86+
description: Results offset, used in the request.
87+
example: 0
88+
required:
89+
- currentResultsCount
90+
- limit
91+
- offset

0 commit comments

Comments
 (0)