@sjcrh/proteinpaint-types 2.184.0 → 2.185.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-CWJZUUEF.js +341 -0
- package/dist/{chunk-U4A647KI.js → chunk-DII56MJ7.js} +128 -18
- package/dist/{chunk-M7WMC7GC.js → chunk-JMVDRHBL.js} +187 -61
- package/dist/chunk-NLANDPY7.js +330 -0
- package/dist/chunk-UGGNWTJZ.js +385 -0
- package/dist/{chunk-XIRCL7KT.js → chunk-VCEWZVLZ.js} +24 -30
- package/dist/{chunk-NIEACU6R.js → chunk-Z3IYM5OK.js} +5 -1
- package/dist/genesetEnrichment.js +1 -1
- package/dist/index.js +7 -7
- package/dist/termdb.DE.js +1 -1
- package/dist/termdb.cluster.js +1 -1
- package/dist/termdb.diffMeth.js +1 -1
- package/dist/termdb.singlecellDEgenes.js +1 -1
- package/dist/termdb.singlecellData.js +1 -1
- package/dist/termdb.singlecellSamples.js +1 -1
- package/package.json +1 -1
- package/src/dataset.ts +49 -0
- package/src/routes/genesetEnrichment.ts +27 -10
- package/src/routes/termdb.DE.ts +111 -4
- package/src/routes/termdb.chat2.ts +5 -2
- package/src/routes/termdb.cluster.ts +11 -0
- package/src/routes/termdb.diffMeth.ts +18 -10
- package/src/routes/termdb.singlecellDEgenes.ts +20 -16
- package/src/routes/termdb.singlecellData.ts +2 -0
- package/src/routes/termdb.singlecellSamples.ts +4 -3
- package/dist/chunk-3EVYVWI2.js +0 -163
- package/dist/chunk-G6ZTAMGK.js +0 -155
- package/dist/chunk-LJFPSUAL.js +0 -199
package/src/dataset.ts
CHANGED
|
@@ -714,6 +714,7 @@ type ProteomeFilter = {
|
|
|
714
714
|
}
|
|
715
715
|
|
|
716
716
|
type ProteomeCohortConfig = {
|
|
717
|
+
prior: { d0: number; s0sq: number }
|
|
717
718
|
controlFilter: ProteomeFilter[]
|
|
718
719
|
caseFilter: ProteomeFilter[]
|
|
719
720
|
}
|
|
@@ -919,6 +920,7 @@ export type SingleCellQuery = {
|
|
|
919
920
|
/** defines tsne/umap type of clustering maps for each sample
|
|
920
921
|
*/
|
|
921
922
|
data: SingleCellDataGdc | SingleCellDataNative
|
|
923
|
+
metaResults?: SingleCellMetaResult[]
|
|
922
924
|
/** defines available gene-level expression values for each cell of each sample */
|
|
923
925
|
geneExpression?: SingleCellGeneExpressionGdc | SingleCellGeneExpressionNative
|
|
924
926
|
/** Precomputed top differentialy expressed genes for a cell cluster, against rest of cells */
|
|
@@ -929,6 +931,23 @@ export type SingleCellQuery = {
|
|
|
929
931
|
terms?: object[]
|
|
930
932
|
}
|
|
931
933
|
|
|
934
|
+
export type SingleCellMetaResult = {
|
|
935
|
+
/** identifier */
|
|
936
|
+
name: string
|
|
937
|
+
/** tsv file
|
|
938
|
+
- 1st column is cell barcode
|
|
939
|
+
- x/y coordinate column number is defined in coordsColumns{x,y} below
|
|
940
|
+
- additional columns for cell annotations, corresponds to colorColumns
|
|
941
|
+
- must have a column for sample name, to identify which sample the cell is from
|
|
942
|
+
*/
|
|
943
|
+
file: string
|
|
944
|
+
/** gene exp h5 file */
|
|
945
|
+
geneExpFile?: string
|
|
946
|
+
/** 0-based column number for x/y coordinate for this plot */
|
|
947
|
+
coordsColumns: { x: number; y: number }
|
|
948
|
+
colorColumns: ColorColumn[]
|
|
949
|
+
}
|
|
950
|
+
|
|
932
951
|
type SCImages = {
|
|
933
952
|
/** folder where the per-sample image files are stored, as "SCImages/<folder>/<sample>/<fileName>" */
|
|
934
953
|
folder: string
|
|
@@ -1360,6 +1379,13 @@ type MatrixSettings = {
|
|
|
1360
1379
|
oncoPrintSNVindelCellBorder?: boolean
|
|
1361
1380
|
}
|
|
1362
1381
|
|
|
1382
|
+
type NumericDictTermClusterSettings = {
|
|
1383
|
+
/** default hiercluster group name */
|
|
1384
|
+
termGroupName?: string
|
|
1385
|
+
zScoreTransformation?: boolean
|
|
1386
|
+
colorScale?: string
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1363
1389
|
type Matrix = {
|
|
1364
1390
|
/** alternative name, e.g. the plot is called "oncomatrix" in gdc; by default it's called "matrix" */
|
|
1365
1391
|
appName?: string
|
|
@@ -1377,6 +1403,28 @@ type Matrix = {
|
|
|
1377
1403
|
cnvCutoffs?: any
|
|
1378
1404
|
}
|
|
1379
1405
|
|
|
1406
|
+
// specific hierCluster type settings, should be named as "dataType + Cluster"
|
|
1407
|
+
type NumericDictTermCluster = {
|
|
1408
|
+
/** alternative name, e.g. the plot is called "drug sensitivity" in ALL-pharmacotyping; by default it's called "Numeric Dictionary Term cluster" */
|
|
1409
|
+
appName?: string
|
|
1410
|
+
/** default settings for numericDictTermCluster plot */
|
|
1411
|
+
settings?: NumericDictTermClusterSettings
|
|
1412
|
+
/** list of numeric term ids that will be excluded from the numeric dictionary term cluster, add to usecase.detail to exclude terms*/
|
|
1413
|
+
exclude?: string[]
|
|
1414
|
+
/** list of pre-built numericDictTermcluster plots */
|
|
1415
|
+
plots?: NumericDictTermClusterPlotsEntry[]
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
type NumericDictTermClusterPlotsEntry = {
|
|
1419
|
+
name: string
|
|
1420
|
+
file: string
|
|
1421
|
+
settings?: {
|
|
1422
|
+
[key: string]: any
|
|
1423
|
+
}
|
|
1424
|
+
/** helper function to get plot config from saved session file */
|
|
1425
|
+
getConfig?: (f: any) => void
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1380
1428
|
type Survival = {
|
|
1381
1429
|
/** default settings for survival plot */
|
|
1382
1430
|
settings?: SurvivalSettings
|
|
@@ -1523,6 +1571,7 @@ keep this setting here for reason of:
|
|
|
1523
1571
|
*/
|
|
1524
1572
|
useLower?: boolean
|
|
1525
1573
|
matrix?: Matrix
|
|
1574
|
+
numericDictTermCluster?: NumericDictTermCluster
|
|
1526
1575
|
survival?: Survival
|
|
1527
1576
|
regression?: Regression
|
|
1528
1577
|
logscaleBase2?: boolean
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import type { RoutePayload } from './routeApi.js'
|
|
2
|
+
import type { DERequest } from './termdb.DE.js'
|
|
2
3
|
|
|
3
4
|
export type GenesetEnrichmentRequest = {
|
|
4
|
-
/** Sample genes to be queried
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
/** Sample genes to be queried. Optional when `cacheId` is given — the
|
|
6
|
+
* server loads genes from the DE cache file in that case. */
|
|
7
|
+
genes?: string[]
|
|
8
|
+
/** Fold changes aligned to `genes`. Optional when `cacheId` is given. */
|
|
9
|
+
fold_change?: number[]
|
|
10
|
+
/** DE cache ID (returned by the volcano/DE route). Deterministic hash
|
|
11
|
+
* of the DE inputs. If set, the server reads genes + fold_change from
|
|
12
|
+
* the cache file and ignores any `genes`/`fold_change` fields sent in
|
|
13
|
+
* this request. */
|
|
14
|
+
cacheId?: string
|
|
15
|
+
/** Snapshot of the original DE request that produced `cacheId`. When
|
|
16
|
+
* the cache file is missing (TTL eviction or farm node that has never
|
|
17
|
+
* seen this request), the server uses this to recompute and rewrite
|
|
18
|
+
* the cache. Without this field, a cache miss is unrecoverable. */
|
|
19
|
+
/** Dataset label forwarded for auth middleware / dataset scoping. */
|
|
20
|
+
dslabel?: string
|
|
21
|
+
/** Snapshot of the original DE request that produced `cacheId`. When
|
|
22
|
+
* the cache file is missing (TTL eviction or farm node that has never
|
|
23
|
+
* seen this request), the server uses this to recompute and rewrite
|
|
24
|
+
* the cache. Without this field, a cache miss is unrecoverable.
|
|
25
|
+
* This mirrors the partial DE payload shape sent by clients. */
|
|
26
|
+
daRequest?: Partial<DERequest>
|
|
27
|
+
fetchDE?: boolean
|
|
8
28
|
/** Filter non-coding genes */
|
|
9
29
|
filter_non_coding_genes: boolean
|
|
10
30
|
/** Genome build */
|
|
@@ -13,10 +33,9 @@ export type GenesetEnrichmentRequest = {
|
|
|
13
33
|
geneSetGroup: string
|
|
14
34
|
/** Gene set name whose enrichment score is to be profiled */
|
|
15
35
|
geneset_name?: string
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
num_permutations: number
|
|
36
|
+
/** Number of permutations to be carried out for GSEA analysis.
|
|
37
|
+
* Only read by the blitzgsea path; cerno and fetchDE requests omit it. */
|
|
38
|
+
num_permutations?: number
|
|
20
39
|
/** Method used for GSEA blitzgsea/cerno */
|
|
21
40
|
method: 'blitzgsea' | 'cerno'
|
|
22
41
|
}
|
|
@@ -61,8 +80,6 @@ type cerno_geneset_attributes = {
|
|
|
61
80
|
type blitzgsea_json = {
|
|
62
81
|
/** array of pathway_attributes */
|
|
63
82
|
data: blitzgsea_map[]
|
|
64
|
-
/** file name of pickle file containing the stored gsea result in cache directory */
|
|
65
|
-
pickle_file: string
|
|
66
83
|
}
|
|
67
84
|
|
|
68
85
|
// Key value pair of geneset name and cerno geneset attributes
|
package/src/routes/termdb.DE.ts
CHANGED
|
@@ -23,6 +23,96 @@ export type DERequest = {
|
|
|
23
23
|
tw2?: any
|
|
24
24
|
/** Option to return early with actual number of samples with expression values */
|
|
25
25
|
preAnalysis?: boolean
|
|
26
|
+
/** Parameters for the server-side `da` Rust renderer: significance thresholds,
|
|
27
|
+
* PNG dimensions, and dot styling. The server always renders the volcano PNG
|
|
28
|
+
* and returns it plus the threshold-passing rows as the interactive `data`. */
|
|
29
|
+
volcanoRender: VolcanoRenderRequest
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Thresholds used to classify a data point as "significant" on the volcano plot.
|
|
33
|
+
* Shared across DE, diffMeth, and singlecellDEgenes routes. */
|
|
34
|
+
export type SignificanceThresholds = {
|
|
35
|
+
/** Cutoff on the -log10 scale; rows with -log10(p) > pValueCutoff pass. */
|
|
36
|
+
pValueCutoff: number
|
|
37
|
+
/** Which p-value column to threshold against. */
|
|
38
|
+
pValueType: 'adjusted' | 'original'
|
|
39
|
+
/** Log2 fold-change magnitude; rows with |fold_change| > foldChangeCutoff pass. */
|
|
40
|
+
foldChangeCutoff: number
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Options the client sends when it wants the server to render the volcano PNG. */
|
|
44
|
+
export type VolcanoRenderRequest = {
|
|
45
|
+
significanceThresholds: SignificanceThresholds
|
|
46
|
+
/** Target PNG width in pixels. */
|
|
47
|
+
pixelWidth: number
|
|
48
|
+
/** Target PNG height in pixels. */
|
|
49
|
+
pixelHeight: number
|
|
50
|
+
/** Default color for significant dots when no group colors are supplied. */
|
|
51
|
+
colorSignificant?: string
|
|
52
|
+
/** Color for significant dots with positive fold change (case group). */
|
|
53
|
+
colorSignificantUp?: string
|
|
54
|
+
/** Color for significant dots with negative fold change (control group). */
|
|
55
|
+
colorSignificantDown?: string
|
|
56
|
+
/** Color for non-significant dots. */
|
|
57
|
+
colorNonsignificant?: string
|
|
58
|
+
/** Ring radius in PNG pixels. Should match the client overlay's circle
|
|
59
|
+
* radius so PNG rings align with interactive overlay rings. */
|
|
60
|
+
dotRadius?: number
|
|
61
|
+
/** Maximum number of interactive rows to return in `data` (the overlay).
|
|
62
|
+
* The server still renders every row into `volcanoPng`; this only caps the
|
|
63
|
+
* interactive list. Capped to the most-significant rows (smallest p-value). */
|
|
64
|
+
maxInteractiveDots?: number
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Everything the client needs to draw one volcano: the pre-rendered PNG of
|
|
68
|
+
* the full scatter, the coordinate extents that produced it, the subset of
|
|
69
|
+
* rows to overlay as interactive dots, and the total row count (for stats).
|
|
70
|
+
* Routes nest this under `data` on their response, keeping route-specific
|
|
71
|
+
* metadata (sample sizes, method, etc.) next to it. */
|
|
72
|
+
export type VolcanoData<T extends DataEntry> = {
|
|
73
|
+
/** Interactive dots for the overlay: rows that passed the client's
|
|
74
|
+
* significance thresholds, sorted ascending by the chosen p-value column,
|
|
75
|
+
* capped at `maxInteractiveDots`. Each entry is one dot, not one volcano. */
|
|
76
|
+
dots: T[]
|
|
77
|
+
/** Base64-encoded PNG of the full scatter (every row). */
|
|
78
|
+
volcanoPng: string
|
|
79
|
+
/** Coordinate extents of the PNG; client overlay circles are positioned
|
|
80
|
+
* against these so they land on their counterparts in the rendered image. */
|
|
81
|
+
plotExtent: PlotExtent
|
|
82
|
+
/** Total rows rendered into the PNG. Used client-side for "% significant"
|
|
83
|
+
* stats since the full row list is not transmitted. */
|
|
84
|
+
totalRows: number
|
|
85
|
+
/** Rows that passed significance thresholds, before any maxInteractiveDots
|
|
86
|
+
* truncation. Use this (not dots.length) for "% significant" stats. */
|
|
87
|
+
totalSignificantRows: number
|
|
88
|
+
/** Server-side cache ID for the full DE result (all rows, not just dots).
|
|
89
|
+
* Downstream tools (e.g. GSEA) pass this back to the server instead of
|
|
90
|
+
* re-transmitting the gene + fold_change arrays. */
|
|
91
|
+
cacheId?: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Coordinate metadata returned by the `volcano` renderer, used by the client to overlay
|
|
95
|
+
* interactive top-significant circles on top of the server-drawn PNG. */
|
|
96
|
+
export type PlotExtent = {
|
|
97
|
+
/** Data-space x domain used during rendering. */
|
|
98
|
+
xMin: number
|
|
99
|
+
xMax: number
|
|
100
|
+
/** Data-space y domain used during rendering (on -log10 p-value scale). */
|
|
101
|
+
yMin: number
|
|
102
|
+
yMax: number
|
|
103
|
+
/** PNG canvas dimensions. */
|
|
104
|
+
pixelWidth: number
|
|
105
|
+
pixelHeight: number
|
|
106
|
+
/** Inner drawing rect inside the PNG (after axis margins). Client overlay circles
|
|
107
|
+
* must position against this rect, not the full canvas. */
|
|
108
|
+
plotLeft: number
|
|
109
|
+
plotTop: number
|
|
110
|
+
plotRight: number
|
|
111
|
+
plotBottom: number
|
|
112
|
+
/** The smallest non-zero p-value observed in the input rows. Rows with p == 0
|
|
113
|
+
* were drawn at y = -log10(minNonZeroPValue) in the PNG; the client must reuse
|
|
114
|
+
* this cap when positioning overlay circles so they align with the PNG. */
|
|
115
|
+
minNonZeroPValue: number
|
|
26
116
|
}
|
|
27
117
|
|
|
28
118
|
export type ExpressionInput = {
|
|
@@ -56,9 +146,18 @@ export type ExpressionInput = {
|
|
|
56
146
|
mds_cutoff: number
|
|
57
147
|
}
|
|
58
148
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
149
|
+
/** Response when DERequest.preAnalysis === true. Returns per-group sample
|
|
150
|
+
* counts (keyed by group name) plus an optional validation alert. No volcano
|
|
151
|
+
* is rendered; the client uses this to show counts before the user submits. */
|
|
152
|
+
export type DEPreAnalysisResponse = {
|
|
153
|
+
data: Record<string, number | string>
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** Response for a full DE run (DERequest.preAnalysis absent/false). */
|
|
157
|
+
export type DEFullResponse = {
|
|
158
|
+
/** The volcano payload — per-gene interactive dots + PNG + extents + totals.
|
|
159
|
+
* See VolcanoData for details. */
|
|
160
|
+
data: VolcanoData<GeneDEEntry>
|
|
62
161
|
/** Effective sample size for group 1 */
|
|
63
162
|
sample_size1: number
|
|
64
163
|
/** Effective sample size for group 2 */
|
|
@@ -72,10 +171,18 @@ export type DEResponse = {
|
|
|
72
171
|
bcv?: number
|
|
73
172
|
}
|
|
74
173
|
|
|
174
|
+
export type DEResponse = DEPreAnalysisResponse | DEFullResponse
|
|
175
|
+
|
|
176
|
+
/** Shared base shape for a single row of differential analysis results — i.e.
|
|
177
|
+
* one dot in a volcano. Used by DE (gene expression), diff methylation, and
|
|
178
|
+
* singlecell DE genes, each of which extends this with route-specific fields. */
|
|
75
179
|
export type DataEntry = {
|
|
76
|
-
adjusted_p_value: number
|
|
77
180
|
original_p_value: number
|
|
181
|
+
adjusted_p_value: number
|
|
78
182
|
fold_change: number
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export type GeneDEEntry = DataEntry & {
|
|
79
186
|
gene_id: string
|
|
80
187
|
gene_name: string
|
|
81
188
|
}
|
|
@@ -28,11 +28,14 @@ export type PlotResponse = {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export type LlmConfig = {
|
|
31
|
-
provider: 'SJ' | 'ollama'
|
|
31
|
+
provider: 'SJ' | 'ollama' | 'huggingface'
|
|
32
|
+
EmbeddingProvider: 'SJ' | 'ollama' | 'huggingface'
|
|
33
|
+
EmbeddingProviderApi: string
|
|
32
34
|
api: string
|
|
35
|
+
EmbeddingProviderApiToken?: string
|
|
33
36
|
modelName: string
|
|
34
37
|
embeddingModelName: string
|
|
35
|
-
/** Whether to load the embedding model locally (via transformers.js) or call a remote API. Defaults to '
|
|
38
|
+
/** Whether to load the embedding model locally (via transformers.js) or call a remote API. Defaults to 'api'. */
|
|
36
39
|
embeddingModelAccess?: 'local' | 'api'
|
|
37
40
|
/** Smaller model to use for LLM classification fallback. Defaults to modelName if not set. */
|
|
38
41
|
classifierModelName?: string
|
|
@@ -6,6 +6,7 @@ import type { GeneExpressionTW } from '../terms/geneExpression.ts'
|
|
|
6
6
|
import type { IsoformExpressionTW } from '../terms/isoformExpression.ts'
|
|
7
7
|
import type { MetaboliteIntensityTW } from '../terms/metaboliteIntensity.ts'
|
|
8
8
|
import type { ProteomeAbundanceTW, ProteomeDetails } from '../terms/proteomeAbundance.ts'
|
|
9
|
+
import type { NumericTW } from '../terms/numeric.ts'
|
|
9
10
|
|
|
10
11
|
export type Gene = {
|
|
11
12
|
/** gene symbol, required */
|
|
@@ -69,10 +70,20 @@ export type TermdbClusterRequestProteomeAbundance = TermdbClusterRequestBase & {
|
|
|
69
70
|
proteomeDetails: ProteomeDetails
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
export type TermdbClusterRequestNumericDictTerm = TermdbClusterRequestBase & {
|
|
74
|
+
/** Data type */
|
|
75
|
+
dataType: 'numericDictTerm'
|
|
76
|
+
/** List of terms */
|
|
77
|
+
terms: NumericTW[]
|
|
78
|
+
/** perform z-score transformation on values */
|
|
79
|
+
zScoreTransformation?: string
|
|
80
|
+
}
|
|
81
|
+
|
|
72
82
|
export type TermdbClusterRequest =
|
|
73
83
|
| TermdbClusterRequestGeneExpression
|
|
74
84
|
| TermdbClusterRequestIsoformExpression
|
|
75
85
|
| TermdbClusterRequestMetabolite
|
|
86
|
+
| TermdbClusterRequestNumericDictTerm
|
|
76
87
|
| TermdbClusterRequestProteomeAbundance
|
|
77
88
|
|
|
78
89
|
export type Hclust = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RoutePayload } from './routeApi.js'
|
|
2
|
+
import type { DataEntry, VolcanoData, VolcanoRenderRequest } from './termdb.DE.js'
|
|
2
3
|
|
|
3
4
|
export type DiffMethRequest = {
|
|
4
5
|
/** Genome build name */
|
|
@@ -15,18 +16,31 @@ export type DiffMethRequest = {
|
|
|
15
16
|
tw2?: any
|
|
16
17
|
/** Option to return early with actual number of samples with methylation values */
|
|
17
18
|
preAnalysis?: boolean
|
|
19
|
+
/** Parameters for the server-side `da` Rust renderer. Always required — the
|
|
20
|
+
* server always returns a rendered PNG plus the threshold-passing rows. */
|
|
21
|
+
volcanoRender: VolcanoRenderRequest
|
|
18
22
|
}
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
/** Response when DiffMethRequest.preAnalysis === true. Returns per-group
|
|
25
|
+
* sample counts (keyed by group name) plus an optional validation alert. */
|
|
26
|
+
export type DiffMethPreAnalysisResponse = {
|
|
27
|
+
data: Record<string, number | string>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Response for a full differential methylation run (preAnalysis absent/false). */
|
|
31
|
+
export type DiffMethFullResponse = {
|
|
32
|
+
/** The volcano payload — per-promoter interactive dots + PNG + extents +
|
|
33
|
+
* totals. See VolcanoData for details. */
|
|
34
|
+
data: VolcanoData<DiffMethEntry>
|
|
23
35
|
/** Effective sample size for group 1 */
|
|
24
36
|
sample_size1: number
|
|
25
37
|
/** Effective sample size for group 2 */
|
|
26
38
|
sample_size2: number
|
|
27
39
|
}
|
|
28
40
|
|
|
29
|
-
export type
|
|
41
|
+
export type DiffMethResponse = DiffMethPreAnalysisResponse | DiffMethFullResponse
|
|
42
|
+
|
|
43
|
+
export type DiffMethEntry = DataEntry & {
|
|
30
44
|
/** ENCODE CRE promoter ID (e.g. EH38E3756858) */
|
|
31
45
|
promoter_id: string
|
|
32
46
|
/** Gene symbol(s) associated with the promoter (comma-separated if multiple) */
|
|
@@ -37,12 +51,6 @@ export type DiffMethDataEntry = {
|
|
|
37
51
|
start: number
|
|
38
52
|
/** Promoter end coordinate (exclusive) */
|
|
39
53
|
stop: number
|
|
40
|
-
/** M-value difference (positive = hypermethylated in cases) */
|
|
41
|
-
fold_change: number
|
|
42
|
-
/** Raw p-value from moderated t-test */
|
|
43
|
-
original_p_value: number
|
|
44
|
-
/** FDR-adjusted p-value (Benjamini-Hochberg) */
|
|
45
|
-
adjusted_p_value: number
|
|
46
54
|
}
|
|
47
55
|
|
|
48
56
|
export const diffMethPayload: RoutePayload = {
|
|
@@ -1,36 +1,40 @@
|
|
|
1
1
|
import type { RoutePayload } from './routeApi.js'
|
|
2
2
|
import type { ErrorResponse } from './errorResponse.ts'
|
|
3
|
+
import type { DataEntry, VolcanoData, VolcanoRenderRequest } from './termdb.DE.js'
|
|
3
4
|
|
|
4
5
|
export type TermdbSingleCellDEgenesRequest = {
|
|
5
6
|
/** Genome id */
|
|
6
7
|
genome: string
|
|
7
8
|
/** Dataset label */
|
|
8
9
|
dslabel: string
|
|
9
|
-
/** Sample
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/** Sample identifier
|
|
11
|
+
* for GDC the value is "seurat.analysis.tsv" file UUID
|
|
12
|
+
* rather than sample name, derived from the eID. The file
|
|
13
|
+
* contains the analysis results for an experiment.
|
|
14
|
+
*
|
|
15
|
+
* Eventually, all requests will use the object and
|
|
16
|
+
* **not** the string format.*/
|
|
17
|
+
sample: string | { sID: string; eID: string }
|
|
14
18
|
/** column name to provide cell groups/clustering,
|
|
15
19
|
* for which DE genes are precomputed. */
|
|
16
20
|
termId: string
|
|
17
21
|
/** User selected cell group/cluster, corresponds to termId,
|
|
18
22
|
* for which DE genes will be returned to client */
|
|
19
23
|
categoryName: string
|
|
24
|
+
/** Parameters for the server-side `volcano` Rust renderer. Always required — the
|
|
25
|
+
* server always returns a rendered PNG plus the threshold-passing rows. */
|
|
26
|
+
volcanoRender: VolcanoRenderRequest
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type SingleCellDEEntry = DataEntry & {
|
|
30
|
+
/** gene name */
|
|
31
|
+
gene_name: string
|
|
20
32
|
}
|
|
21
33
|
|
|
22
34
|
export type HasDataResponse = {
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
gene_name: string
|
|
27
|
-
/** adjusted p-value */
|
|
28
|
-
adjusted_p_value: number
|
|
29
|
-
/** original p-value */
|
|
30
|
-
original_p_value: number
|
|
31
|
-
/** log2 fold change */
|
|
32
|
-
fold_change: number
|
|
33
|
-
}[] // TODO: May replace with DataEntry from termdb.DE.ts in the future
|
|
35
|
+
/** The volcano payload — per-gene interactive dots + PNG + extents + totals.
|
|
36
|
+
* See VolcanoData for details. */
|
|
37
|
+
data: VolcanoData<SingleCellDEEntry>
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
export type TermdbSingleCellDEgenesResponse = ErrorResponse | HasDataResponse
|
|
@@ -38,6 +38,8 @@ export type TermdbSingleCellDataRequest = {
|
|
|
38
38
|
sample: { eID?: string; sID: string }
|
|
39
39
|
/** List of plot names from this sample to request data for */
|
|
40
40
|
plots: string[]
|
|
41
|
+
/** check plot availability for this sample, will not return actual plot data and speed up */
|
|
42
|
+
checkPlotAvailability?: boolean
|
|
41
43
|
/** Gene name to retrieve expression data for all cells of the given sample, and to overlay on maps */
|
|
42
44
|
gene?: string
|
|
43
45
|
/** in each plot, what Column name to color by
|
|
@@ -31,9 +31,10 @@ export type TermdbSingleCellSamplesRequest = {
|
|
|
31
31
|
type ValidResponse = {
|
|
32
32
|
/** List of sample names with singlecell data */
|
|
33
33
|
samples: SingleCellSample[]
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
metaResults?: {
|
|
35
|
+
/** identifier of one result */
|
|
36
|
+
name: string
|
|
37
|
+
}[]
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
export type TermdbSingleCellSamplesResponse = ErrorResponse | ValidResponse
|
package/dist/chunk-3EVYVWI2.js
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__toESM,
|
|
3
|
-
require_lib
|
|
4
|
-
} from "./chunk-YNHC5SXO.js";
|
|
5
|
-
|
|
6
|
-
// dist/termdb.singlecellDEgenes.ts
|
|
7
|
-
var import_typia = __toESM(require_lib(), 1);
|
|
8
|
-
|
|
9
|
-
// src/routes/termdb.singlecellDEgenes.ts
|
|
10
|
-
var termdbSingleCellDEgenesPayload = {
|
|
11
|
-
request: {
|
|
12
|
-
typeId: "TermdbSingleCellDEgenesRequest"
|
|
13
|
-
},
|
|
14
|
-
response: {
|
|
15
|
-
typeId: "TermdbSingleCellDEgenesResponse"
|
|
16
|
-
}
|
|
17
|
-
// examples: []
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// dist/termdb.singlecellDEgenes.ts
|
|
21
|
-
var validTermdbSingleCellDEgenesRequest = (input) => {
|
|
22
|
-
const errors = [];
|
|
23
|
-
const __is = (input2) => {
|
|
24
|
-
return "object" === typeof input2 && null !== input2 && ("string" === typeof input2.genome && "string" === typeof input2.dslabel && "string" === typeof input2.sample && "string" === typeof input2.termId && "string" === typeof input2.categoryName);
|
|
25
|
-
};
|
|
26
|
-
if (false === __is(input)) {
|
|
27
|
-
const $report = import_typia.createValidate.report(errors);
|
|
28
|
-
((input2, _path, _exceptionable = true) => {
|
|
29
|
-
const $vo0 = (input3, _path2, _exceptionable2 = true) => ["string" === typeof input3.genome || $report(_exceptionable2, {
|
|
30
|
-
path: _path2 + ".genome",
|
|
31
|
-
expected: "string",
|
|
32
|
-
value: input3.genome
|
|
33
|
-
}), "string" === typeof input3.dslabel || $report(_exceptionable2, {
|
|
34
|
-
path: _path2 + ".dslabel",
|
|
35
|
-
expected: "string",
|
|
36
|
-
value: input3.dslabel
|
|
37
|
-
}), "string" === typeof input3.sample || $report(_exceptionable2, {
|
|
38
|
-
path: _path2 + ".sample",
|
|
39
|
-
expected: "string",
|
|
40
|
-
value: input3.sample
|
|
41
|
-
}), "string" === typeof input3.termId || $report(_exceptionable2, {
|
|
42
|
-
path: _path2 + ".termId",
|
|
43
|
-
expected: "string",
|
|
44
|
-
value: input3.termId
|
|
45
|
-
}), "string" === typeof input3.categoryName || $report(_exceptionable2, {
|
|
46
|
-
path: _path2 + ".categoryName",
|
|
47
|
-
expected: "string",
|
|
48
|
-
value: input3.categoryName
|
|
49
|
-
})].every((flag) => flag);
|
|
50
|
-
return ("object" === typeof input2 && null !== input2 || $report(true, {
|
|
51
|
-
path: _path + "",
|
|
52
|
-
expected: "TermdbSingleCellDEgenesRequest",
|
|
53
|
-
value: input2
|
|
54
|
-
})) && $vo0(input2, _path + "", true) || $report(true, {
|
|
55
|
-
path: _path + "",
|
|
56
|
-
expected: "TermdbSingleCellDEgenesRequest",
|
|
57
|
-
value: input2
|
|
58
|
-
});
|
|
59
|
-
})(input, "$input", true);
|
|
60
|
-
}
|
|
61
|
-
const success = 0 === errors.length;
|
|
62
|
-
return {
|
|
63
|
-
success,
|
|
64
|
-
errors,
|
|
65
|
-
data: success ? input : void 0
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
var validTermdbSingleCellDEgenesResponse = (input) => {
|
|
69
|
-
const errors = [];
|
|
70
|
-
const __is = (input2) => {
|
|
71
|
-
const $io0 = (input3) => "number" === typeof input3.status && "string" === typeof input3.error;
|
|
72
|
-
const $io1 = (input3) => Array.isArray(input3.data) && input3.data.every((elem) => "object" === typeof elem && null !== elem && $io2(elem));
|
|
73
|
-
const $io2 = (input3) => "string" === typeof input3.gene_name && "number" === typeof input3.adjusted_p_value && "number" === typeof input3.original_p_value && "number" === typeof input3.fold_change;
|
|
74
|
-
const $iu0 = (input3) => (() => {
|
|
75
|
-
if (void 0 !== input3.status)
|
|
76
|
-
return $io0(input3);
|
|
77
|
-
if (void 0 !== input3.data)
|
|
78
|
-
return $io1(input3);
|
|
79
|
-
return false;
|
|
80
|
-
})();
|
|
81
|
-
return "object" === typeof input2 && null !== input2 && $iu0(input2);
|
|
82
|
-
};
|
|
83
|
-
if (false === __is(input)) {
|
|
84
|
-
const $report = import_typia.createValidate.report(errors);
|
|
85
|
-
((input2, _path, _exceptionable = true) => {
|
|
86
|
-
const $vo0 = (input3, _path2, _exceptionable2 = true) => ["number" === typeof input3.status || $report(_exceptionable2, {
|
|
87
|
-
path: _path2 + ".status",
|
|
88
|
-
expected: "number",
|
|
89
|
-
value: input3.status
|
|
90
|
-
}), "string" === typeof input3.error || $report(_exceptionable2, {
|
|
91
|
-
path: _path2 + ".error",
|
|
92
|
-
expected: "string",
|
|
93
|
-
value: input3.error
|
|
94
|
-
})].every((flag) => flag);
|
|
95
|
-
const $vo1 = (input3, _path2, _exceptionable2 = true) => [(Array.isArray(input3.data) || $report(_exceptionable2, {
|
|
96
|
-
path: _path2 + ".data",
|
|
97
|
-
expected: "Array<__type>",
|
|
98
|
-
value: input3.data
|
|
99
|
-
})) && input3.data.map((elem, _index1) => ("object" === typeof elem && null !== elem || $report(_exceptionable2, {
|
|
100
|
-
path: _path2 + ".data[" + _index1 + "]",
|
|
101
|
-
expected: "__type",
|
|
102
|
-
value: elem
|
|
103
|
-
})) && $vo2(elem, _path2 + ".data[" + _index1 + "]", _exceptionable2) || $report(_exceptionable2, {
|
|
104
|
-
path: _path2 + ".data[" + _index1 + "]",
|
|
105
|
-
expected: "__type",
|
|
106
|
-
value: elem
|
|
107
|
-
})).every((flag) => flag) || $report(_exceptionable2, {
|
|
108
|
-
path: _path2 + ".data",
|
|
109
|
-
expected: "Array<__type>",
|
|
110
|
-
value: input3.data
|
|
111
|
-
})].every((flag) => flag);
|
|
112
|
-
const $vo2 = (input3, _path2, _exceptionable2 = true) => ["string" === typeof input3.gene_name || $report(_exceptionable2, {
|
|
113
|
-
path: _path2 + ".gene_name",
|
|
114
|
-
expected: "string",
|
|
115
|
-
value: input3.gene_name
|
|
116
|
-
}), "number" === typeof input3.adjusted_p_value || $report(_exceptionable2, {
|
|
117
|
-
path: _path2 + ".adjusted_p_value",
|
|
118
|
-
expected: "number",
|
|
119
|
-
value: input3.adjusted_p_value
|
|
120
|
-
}), "number" === typeof input3.original_p_value || $report(_exceptionable2, {
|
|
121
|
-
path: _path2 + ".original_p_value",
|
|
122
|
-
expected: "number",
|
|
123
|
-
value: input3.original_p_value
|
|
124
|
-
}), "number" === typeof input3.fold_change || $report(_exceptionable2, {
|
|
125
|
-
path: _path2 + ".fold_change",
|
|
126
|
-
expected: "number",
|
|
127
|
-
value: input3.fold_change
|
|
128
|
-
})].every((flag) => flag);
|
|
129
|
-
const $vu0 = (input3, _path2, _exceptionable2 = true) => (() => {
|
|
130
|
-
if (void 0 !== input3.status)
|
|
131
|
-
return $vo0(input3, _path2, _exceptionable2);
|
|
132
|
-
if (void 0 !== input3.data)
|
|
133
|
-
return $vo1(input3, _path2, _exceptionable2);
|
|
134
|
-
return $report(_exceptionable2, {
|
|
135
|
-
path: _path2,
|
|
136
|
-
expected: "(ErrorResponse | HasDataResponse)",
|
|
137
|
-
value: input3
|
|
138
|
-
});
|
|
139
|
-
})();
|
|
140
|
-
return ("object" === typeof input2 && null !== input2 || $report(true, {
|
|
141
|
-
path: _path + "",
|
|
142
|
-
expected: "(ErrorResponse | HasDataResponse)",
|
|
143
|
-
value: input2
|
|
144
|
-
})) && $vu0(input2, _path + "", true) || $report(true, {
|
|
145
|
-
path: _path + "",
|
|
146
|
-
expected: "(ErrorResponse | HasDataResponse)",
|
|
147
|
-
value: input2
|
|
148
|
-
});
|
|
149
|
-
})(input, "$input", true);
|
|
150
|
-
}
|
|
151
|
-
const success = 0 === errors.length;
|
|
152
|
-
return {
|
|
153
|
-
success,
|
|
154
|
-
errors,
|
|
155
|
-
data: success ? input : void 0
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export {
|
|
160
|
-
termdbSingleCellDEgenesPayload,
|
|
161
|
-
validTermdbSingleCellDEgenesRequest,
|
|
162
|
-
validTermdbSingleCellDEgenesResponse
|
|
163
|
-
};
|