@sjcrh/proteinpaint-types 2.86.0 → 2.87.1

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.
Files changed (233) hide show
  1. package/README.md +22 -0
  2. package/dist/brainImaging.js +11 -0
  3. package/dist/brainImagingSamples.js +11 -0
  4. package/dist/burden.js +11 -0
  5. package/dist/chunk-37ZPCVP5.js +111 -0
  6. package/dist/chunk-5GG2FNAY.js +62 -0
  7. package/dist/chunk-5JWTIWVB.js +222 -0
  8. package/dist/chunk-5RZYB4M4.js +171 -0
  9. package/dist/chunk-6EFB6ZMB.js +62 -0
  10. package/dist/chunk-6LFMFM2C.js +122 -0
  11. package/dist/chunk-7PMGKVWQ.js +62 -0
  12. package/dist/chunk-7Z3IHB43.js +152 -0
  13. package/dist/chunk-B3D26X6X.js +337 -0
  14. package/dist/chunk-BY2JABTF.js +256 -0
  15. package/dist/chunk-CETMA2FU.js +144 -0
  16. package/dist/chunk-DCN75URO.js +1740 -0
  17. package/dist/chunk-DIDZMC3G.js +96 -0
  18. package/dist/chunk-DKSPASWZ.js +4058 -0
  19. package/dist/chunk-EWRK4PKZ.js +62 -0
  20. package/dist/chunk-FDTUTGQG.js +288 -0
  21. package/dist/chunk-FZ6QOTGM.js +205 -0
  22. package/dist/chunk-GU7LIGHN.js +174 -0
  23. package/dist/chunk-IL33L6MY.js +126 -0
  24. package/dist/chunk-INDBFC54.js +1538 -0
  25. package/dist/chunk-IT7IGDC4.js +1697 -0
  26. package/dist/chunk-IWG5IPXG.js +3409 -0
  27. package/dist/chunk-JEQ3TBVQ.js +1472 -0
  28. package/dist/chunk-JPW6LFDQ.js +1507 -0
  29. package/dist/chunk-K2KQTFQI.js +113 -0
  30. package/dist/chunk-M33KP65Z.js +3347 -0
  31. package/dist/chunk-MUJUKENL.js +62 -0
  32. package/dist/chunk-N45Z3JCY.js +62 -0
  33. package/dist/chunk-OMHEDUNA.js +62 -0
  34. package/dist/chunk-OY3EKV7F.js +130 -0
  35. package/dist/chunk-Q56YNQFK.js +3417 -0
  36. package/dist/chunk-QDIIM52V.js +165 -0
  37. package/dist/chunk-QX7QLUKY.js +228 -0
  38. package/dist/chunk-RLFGMVJZ.js +234 -0
  39. package/dist/chunk-SDOWCOGK.js +96 -0
  40. package/dist/chunk-UCG25D2C.js +109 -0
  41. package/dist/chunk-UIU3IQH4.js +62 -0
  42. package/dist/chunk-W3F2RMPU.js +3494 -0
  43. package/dist/chunk-W3QYIXXF.js +273 -0
  44. package/dist/chunk-XGAOGA3F.js +159 -0
  45. package/dist/chunk-XJCQEOPB.js +61 -0
  46. package/dist/chunk-XLBSZOMF.js +117 -0
  47. package/dist/chunk-XQQ5G6N6.js +109 -0
  48. package/dist/chunk-Z6B6IQIY.js +1785 -0
  49. package/dist/dataset.js +11 -0
  50. package/dist/dsdata.js +11 -0
  51. package/dist/dzimages.js +11 -0
  52. package/dist/gdc.maf.js +11 -0
  53. package/dist/gdc.mafBuild.js +11 -0
  54. package/dist/gdc.topMutatedGenes.js +11 -0
  55. package/dist/genelookup.js +11 -0
  56. package/dist/genesetEnrichment.js +11 -0
  57. package/dist/genesetOverrepresentation.js +11 -0
  58. package/dist/healthcheck.js +11 -0
  59. package/dist/hicdata.js +11 -0
  60. package/dist/hicgenome.js +11 -0
  61. package/dist/hicstat.js +11 -0
  62. package/dist/index.js +347 -0
  63. package/dist/isoformlst.js +11 -0
  64. package/dist/ntseq.js +11 -0
  65. package/dist/pdomain.js +11 -0
  66. package/dist/samplewsimages.js +11 -0
  67. package/dist/snp.js +11 -0
  68. package/dist/termdb.DE.js +11 -0
  69. package/dist/termdb.boxplot.js +11 -0
  70. package/dist/termdb.categories.js +11 -0
  71. package/dist/termdb.cluster.js +11 -0
  72. package/dist/termdb.cohort.summary.js +11 -0
  73. package/dist/termdb.cohorts.js +11 -0
  74. package/dist/termdb.descrstats.js +11 -0
  75. package/dist/termdb.numericcategories.js +11 -0
  76. package/dist/termdb.percentile.js +11 -0
  77. package/dist/termdb.rootterm.js +11 -0
  78. package/dist/termdb.sampleImages.js +11 -0
  79. package/dist/termdb.singleSampleMutation.js +11 -0
  80. package/dist/termdb.singlecellDEgenes.js +11 -0
  81. package/dist/termdb.singlecellData.js +11 -0
  82. package/dist/termdb.singlecellSamples.js +11 -0
  83. package/dist/termdb.termchildren.js +11 -0
  84. package/dist/termdb.termsbyids.js +11 -0
  85. package/dist/termdb.topTermsByType.js +11 -0
  86. package/dist/termdb.topVariablyExpressedGenes.js +11 -0
  87. package/dist/termdb.violin.js +11 -0
  88. package/dist/tileserver.js +11 -0
  89. package/dist/wsimages.js +11 -0
  90. package/package.json +17 -15
  91. package/src/Mclass.ts +8 -0
  92. package/src/dataset.ts +1588 -0
  93. package/src/docs.json +16417 -0
  94. package/src/fileOrUrl.ts +15 -0
  95. package/src/filter.ts +125 -0
  96. package/src/genome.ts +123 -0
  97. package/src/index.ts +67 -0
  98. package/src/routes/brainImaging.ts +47 -0
  99. package/src/routes/brainImagingSamples.ts +25 -0
  100. package/src/routes/burden.ts +111 -0
  101. package/src/routes/dataset.ts +14 -0
  102. package/src/routes/dsdata.ts +14 -0
  103. package/src/routes/dzimages.ts +25 -0
  104. package/src/routes/errorResponse.ts +6 -0
  105. package/src/routes/filter.gdc.ts +15 -0
  106. package/src/routes/gdc.maf.ts +52 -0
  107. package/src/routes/gdc.mafBuild.ts +20 -0
  108. package/src/routes/gdc.topMutatedGenes.ts +37 -0
  109. package/src/routes/genelookup.ts +22 -0
  110. package/src/routes/genesetEnrichment.ts +60 -0
  111. package/src/routes/genesetOverrepresentation.ts +48 -0
  112. package/src/routes/healthcheck.ts +79 -0
  113. package/src/routes/hicdata.ts +48 -0
  114. package/src/routes/hicgenome.ts +50 -0
  115. package/src/routes/hicstat.ts +57 -0
  116. package/src/routes/isoformlst.ts +14 -0
  117. package/src/routes/ntseq.ts +14 -0
  118. package/src/routes/pdomain.ts +14 -0
  119. package/src/routes/routeApi.ts +41 -0
  120. package/src/routes/samplewsimages.ts +27 -0
  121. package/src/routes/snp.ts +13 -0
  122. package/src/routes/termdb.DE.ts +57 -0
  123. package/src/routes/termdb.boxplot.ts +78 -0
  124. package/src/routes/termdb.categories.ts +73 -0
  125. package/src/routes/termdb.cluster.ts +103 -0
  126. package/src/routes/termdb.cohort.summary.ts +14 -0
  127. package/src/routes/termdb.cohorts.ts +14 -0
  128. package/src/routes/termdb.descrstats.ts +78 -0
  129. package/src/routes/termdb.numericcategories.ts +32 -0
  130. package/src/routes/termdb.percentile.ts +65 -0
  131. package/src/routes/termdb.rootterm.ts +49 -0
  132. package/src/routes/termdb.sampleImages.ts +26 -0
  133. package/src/routes/termdb.singleSampleMutation.ts +29 -0
  134. package/src/routes/termdb.singlecellDEgenes.ts +41 -0
  135. package/src/routes/termdb.singlecellData.ts +69 -0
  136. package/src/routes/termdb.singlecellSamples.ts +46 -0
  137. package/src/routes/termdb.termchildren.ts +49 -0
  138. package/src/routes/termdb.termsbyids.ts +26 -0
  139. package/src/routes/termdb.topTermsByType.ts +32 -0
  140. package/src/routes/termdb.topVariablyExpressedGenes.ts +56 -0
  141. package/src/routes/termdb.violin.ts +122 -0
  142. package/src/routes/tileserver.ts +14 -0
  143. package/src/routes/wsimages.ts +24 -0
  144. package/src/terms/categorical.ts +106 -0
  145. package/src/terms/condition.ts +55 -0
  146. package/src/terms/geneExpression.ts +32 -0
  147. package/src/terms/geneVariant.ts +51 -0
  148. package/src/terms/metaboliteIntensity.ts +31 -0
  149. package/src/terms/numeric.ts +253 -0
  150. package/src/terms/q.ts +38 -0
  151. package/src/terms/samplelst.ts +41 -0
  152. package/src/terms/singleCellCellType.ts +22 -0
  153. package/src/terms/singleCellGeneExpression.ts +28 -0
  154. package/src/terms/snp.ts +28 -0
  155. package/src/terms/snps.ts +110 -0
  156. package/src/terms/term.ts +184 -0
  157. package/src/terms/tw.ts +38 -0
  158. package/src/terms/updated-types.ts +9 -0
  159. package/src/termsetting.ts +197 -0
  160. package/src/test/numeric.type.spec.ts +275 -0
  161. package/src/vocab.ts +37 -0
  162. package/dist/routes.ts +0 -28911
  163. package/src/Mclass.js +0 -0
  164. package/src/checkers/routes.js +0 -167
  165. package/src/dataset.js +0 -0
  166. package/src/fileOrUrl.js +0 -0
  167. package/src/filter.js +0 -0
  168. package/src/genome.js +0 -0
  169. package/src/index.js +0 -66
  170. package/src/routes/brainImaging.js +0 -11
  171. package/src/routes/brainImagingSamples.js +0 -11
  172. package/src/routes/burden.js +0 -44
  173. package/src/routes/dataset.js +0 -12
  174. package/src/routes/dsdata.js +0 -12
  175. package/src/routes/dzimages.js +0 -12
  176. package/src/routes/errorResponse.js +0 -0
  177. package/src/routes/filter.gdc.js +0 -0
  178. package/src/routes/gdc.maf.js +0 -17
  179. package/src/routes/gdc.mafBuild.js +0 -12
  180. package/src/routes/gdc.topMutatedGenes.js +0 -12
  181. package/src/routes/genelookup.js +0 -12
  182. package/src/routes/genesetEnrichment.js +0 -12
  183. package/src/routes/genesetOverrepresentation.js +0 -12
  184. package/src/routes/healthcheck.js +0 -23
  185. package/src/routes/hicdata.js +0 -12
  186. package/src/routes/hicgenome.js +0 -29
  187. package/src/routes/hicstat.js +0 -12
  188. package/src/routes/isoformlst.js +0 -12
  189. package/src/routes/ntseq.js +0 -12
  190. package/src/routes/pdomain.js +0 -12
  191. package/src/routes/routeApi.js +0 -0
  192. package/src/routes/samplewsimages.js +0 -12
  193. package/src/routes/snp.js +0 -11
  194. package/src/routes/termdb.DE.js +0 -13
  195. package/src/routes/termdb.boxplot.js +0 -12
  196. package/src/routes/termdb.categories.js +0 -48
  197. package/src/routes/termdb.cluster.js +0 -12
  198. package/src/routes/termdb.cohort.summary.js +0 -12
  199. package/src/routes/termdb.cohorts.js +0 -12
  200. package/src/routes/termdb.descrstats.js +0 -48
  201. package/src/routes/termdb.numericcategories.js +0 -12
  202. package/src/routes/termdb.percentile.js +0 -49
  203. package/src/routes/termdb.rootterm.js +0 -27
  204. package/src/routes/termdb.sampleImages.js +0 -12
  205. package/src/routes/termdb.singleSampleMutation.js +0 -12
  206. package/src/routes/termdb.singlecellDEgenes.js +0 -12
  207. package/src/routes/termdb.singlecellData.js +0 -12
  208. package/src/routes/termdb.singlecellSamples.js +0 -12
  209. package/src/routes/termdb.termchildren.js +0 -28
  210. package/src/routes/termdb.termsbyids.js +0 -12
  211. package/src/routes/termdb.topTermsByType.js +0 -12
  212. package/src/routes/termdb.topVariablyExpressedGenes.js +0 -12
  213. package/src/routes/termdb.violin.js +0 -49
  214. package/src/routes/tileserver.js +0 -12
  215. package/src/routes/wsimages.js +0 -12
  216. package/src/terms/categorical.js +0 -0
  217. package/src/terms/condition.js +0 -0
  218. package/src/terms/geneExpression.js +0 -0
  219. package/src/terms/geneVariant.js +0 -0
  220. package/src/terms/metaboliteIntensity.js +0 -0
  221. package/src/terms/numeric.js +0 -0
  222. package/src/terms/q.js +0 -0
  223. package/src/terms/samplelst.js +0 -0
  224. package/src/terms/singleCellCellType.js +0 -0
  225. package/src/terms/singleCellGeneExpression.js +0 -0
  226. package/src/terms/snp.js +0 -0
  227. package/src/terms/snps.js +0 -0
  228. package/src/terms/term.js +0 -0
  229. package/src/terms/tw.js +0 -0
  230. package/src/terms/updated-types.js +0 -0
  231. package/src/termsetting.js +0 -0
  232. package/src/test/numeric.type.spec.js +0 -117
  233. package/src/vocab.js +0 -0
@@ -0,0 +1,73 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import type { Filter } from '../filter.ts'
3
+ import type { TermWrapper } from '../terms/tw.ts'
4
+
5
+ export type CategoriesRequest = {
6
+ genome: string
7
+ dslabel: string
8
+ embedder: string
9
+ /** termwrapper object */
10
+ tw: TermWrapper
11
+ filter?: Filter
12
+ /** quick fix only for gdc */
13
+ currentGeneNames?: string[]
14
+ /** optional property added by mds3 tk, to limit to cases mutated in this region */
15
+ rglst?: any
16
+ }
17
+
18
+ interface Entries {
19
+ samplecount: number
20
+ key: string
21
+ label: string
22
+ }
23
+
24
+ export type CategoriesResponse = {
25
+ lst: Entries[]
26
+ orderedLabels?: []
27
+ }
28
+
29
+ export const termdbCategoriesPayload: RoutePayload = {
30
+ request: {
31
+ typeId: 'CategoriesRequest'
32
+ },
33
+ response: {
34
+ typeId: 'CategoriesResponse'
35
+ },
36
+ examples: [
37
+ {
38
+ request: {
39
+ body: {
40
+ genome: 'hg38-test',
41
+ dslabel: 'TermdbTest',
42
+ embedder: 'localhost',
43
+ term: { id: 'diaggrp' },
44
+ filter: {
45
+ type: 'tvslst',
46
+ in: true,
47
+ join: '',
48
+ lst: [
49
+ {
50
+ tag: 'cohortFilter',
51
+ type: 'tvs',
52
+ tvs: {
53
+ term: {
54
+ name: 'Cohort',
55
+ type: 'categorical',
56
+ values: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },
57
+ id: 'subcohort',
58
+ isleaf: false,
59
+ groupsetting: { disabled: true }
60
+ },
61
+ values: [{ key: 'ABC', label: 'ABC' }]
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ },
68
+ response: {
69
+ header: { status: 200 }
70
+ }
71
+ }
72
+ ]
73
+ }
@@ -0,0 +1,103 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import { ErrorResponse } from './errorResponse.ts'
3
+ import { Filter } from '../filter.ts'
4
+ import { Term } from '../terms/term.ts'
5
+ import { GeneExpressionTerm } from '../terms/geneExpression.ts'
6
+ import { MetaboliteIntensityTerm } from '../terms/metaboliteIntensity.ts'
7
+ import { NumericDictTerm } from '../terms/numeric.ts'
8
+
9
+ export type Gene = {
10
+ /** gene symbol, required */
11
+ gene: string
12
+ /** optionally, client may supply chr/start/stop; if missing, backend code may add them when processing native dataset */
13
+ chr?: string
14
+ start?: number
15
+ stop?: number
16
+ }
17
+
18
+ type TermdbClusterRequestBase = {
19
+ /** Genome id */
20
+ genome: string
21
+ /** Dataset label */
22
+ dslabel: string
23
+ /** cluster method */
24
+ clusterMethod: string
25
+ /** distance method */
26
+ distanceMethod: string
27
+ /** pp filter */
28
+ filter?: Filter
29
+ /** todo gdc filter */
30
+ filter0?: any
31
+ }
32
+
33
+ export type TermdbClusterRequestGeneExpression = TermdbClusterRequestBase & {
34
+ /** Data type */
35
+ dataType: 'geneExpression'
36
+ /** List of terms */
37
+ terms: GeneExpressionTerm[]
38
+ /** perform z-score transformation on values */
39
+ zScoreTransformation?: string
40
+ }
41
+
42
+ export type TermdbClusterRequestMetabolite = TermdbClusterRequestBase & {
43
+ /** Data type */
44
+ dataType: 'metaboliteIntensity'
45
+ /** List of terms */
46
+ terms: MetaboliteIntensityTerm[]
47
+ /** perform z-score transformation on values */
48
+ zScoreTransformation?: string
49
+ }
50
+
51
+ export type TermdbClusterRequestNumericDictTerm = TermdbClusterRequestBase & {
52
+ /** Data type */
53
+ dataType: 'numericDictTerm'
54
+ /** List of terms */
55
+ terms: NumericDictTerm[]
56
+ /** perform z-score transformation on values */
57
+ zScoreTransformation?: string
58
+ }
59
+
60
+ export type TermdbClusterRequest =
61
+ | TermdbClusterRequestGeneExpression
62
+ | TermdbClusterRequestMetabolite
63
+ | TermdbClusterRequestNumericDictTerm
64
+
65
+ export type Hclust = {
66
+ merge: { n1: number; n2: number }[]
67
+ height: { height: number }[]
68
+ order: { name: string }[]
69
+ inputOrder: string[]
70
+ }
71
+ export type Clustering = {
72
+ row: Hclust
73
+ col: Hclust
74
+ matrix: number[][]
75
+ }
76
+
77
+ // response with clustering result of multiple gene/rows
78
+ export type ValidResponse = {
79
+ /** */
80
+ clustering: Clustering
81
+ /** */
82
+ byTermId: { [index: string]: any }
83
+ /** */
84
+ bySampleId: { [index: string]: any }
85
+ }
86
+
87
+ //response of just 1 gene, thus unable to do clustering
88
+ export type SingletermResponse = {
89
+ term: Term
90
+ data: any
91
+ }
92
+
93
+ export type TermdbClusterResponse = ErrorResponse | ValidResponse | SingletermResponse
94
+
95
+ export const termdbClusterPayload: RoutePayload = {
96
+ request: {
97
+ typeId: 'TermdbClusterRequest'
98
+ },
99
+ response: {
100
+ typeId: 'TermdbClusterResponse'
101
+ }
102
+ //examples: []
103
+ }
@@ -0,0 +1,14 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+
3
+ export type TermdbCohortSummaryRequest = any
4
+ export type TermdbCohortSummaryResponse = any
5
+
6
+ export const termdbCohortSummaryPayload: RoutePayload = {
7
+ request: {
8
+ typeId: 'TermdbCohortSummaryRequest'
9
+ },
10
+ response: {
11
+ typeId: 'TermdbCohortSummaryResponse'
12
+ }
13
+ // examples: []
14
+ }
@@ -0,0 +1,14 @@
1
+ import { RoutePayload } from './routeApi.js'
2
+
3
+ export type TermdbCohortsRequest = any
4
+ export type TermdbCohortsResponse = any
5
+
6
+ export const termdbCohortsPayload: RoutePayload = {
7
+ request: {
8
+ typeId: 'TermdbCohortsRequest'
9
+ },
10
+ response: {
11
+ typeId: 'TermdbCohortsResponse'
12
+ }
13
+ //examples: []
14
+ }
@@ -0,0 +1,78 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import type { Filter } from '../filter.ts'
3
+ import type { TermWrapper } from '../terms/tw.ts'
4
+ import type { ErrorResponse } from './errorResponse.ts'
5
+
6
+ export type DescrStatsRequest = {
7
+ /** genome label in the serverconfig.json */
8
+ genome: string
9
+ /** dataset label for the given genome */
10
+ dslabel: string
11
+ embedder: string
12
+ /** wrapper of a numeric term, q.mode can be any as getData() will always pull sample-level values for summarizing */
13
+ tw: TermWrapper
14
+ /** if true, the (violin) plot is in log scale and must exclude 0-values from the stat */
15
+ logScale?: boolean
16
+ /** optional pp filter */
17
+ filter?: Filter
18
+ /** optional gdc filter */
19
+ filter0?: any
20
+ }
21
+
22
+ interface entries {
23
+ id: string
24
+ label: string
25
+ value: number
26
+ }
27
+
28
+ type ValidResponse = {
29
+ values: entries[]
30
+ }
31
+
32
+ export type DescrStatsResponse = ValidResponse | ErrorResponse
33
+
34
+ export const descrStatsPayload: RoutePayload = {
35
+ request: {
36
+ typeId: 'DescrStatsRequest'
37
+ },
38
+ response: {
39
+ typeId: 'DescrStatsResponse'
40
+ },
41
+ examples: [
42
+ {
43
+ request: {
44
+ body: {
45
+ genome: 'hg38-test',
46
+ dslabel: 'TermdbTest',
47
+ embedder: 'localhost',
48
+ tw: { term: { id: 'hrtavg' }, q: { mode: 'continuous' } },
49
+ filter: {
50
+ type: 'tvslst',
51
+ in: true,
52
+ join: '',
53
+ lst: [
54
+ {
55
+ tag: 'cohortFilter',
56
+ type: 'tvs',
57
+ tvs: {
58
+ term: {
59
+ name: 'Cohort',
60
+ type: 'categorical',
61
+ values: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },
62
+ id: 'subcohort',
63
+ isleaf: false,
64
+ groupsetting: { disabled: true }
65
+ },
66
+ values: [{ key: 'ABC', label: 'ABC' }]
67
+ }
68
+ }
69
+ ]
70
+ }
71
+ }
72
+ },
73
+ response: {
74
+ header: { status: 200 }
75
+ }
76
+ }
77
+ ]
78
+ }
@@ -0,0 +1,32 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import type { Filter } from '../filter.ts'
3
+
4
+ export type NumericCategoriesRequest = {
5
+ /** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */
6
+ genome: string
7
+ /** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */
8
+ dslabel: string
9
+ embedder: string
10
+ /** term id string */
11
+ tid: string
12
+ filter?: Filter
13
+ }
14
+
15
+ interface entries {
16
+ value: number
17
+ samplecount: number
18
+ }
19
+
20
+ export type NumericCategoriesResponse = {
21
+ lst: entries[]
22
+ }
23
+
24
+ export const numericCategoriesPayload: RoutePayload = {
25
+ request: {
26
+ typeId: 'NumericCategoriesRequest'
27
+ },
28
+ response: {
29
+ typeId: 'NumericCategoriesResponse'
30
+ },
31
+ // examples: []
32
+ }
@@ -0,0 +1,65 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import type { Filter } from '../filter.ts'
3
+
4
+ export type PercentileRequest = {
5
+ /** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */
6
+ genome: string
7
+ /** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */
8
+ dslabel: string
9
+ embedder: string
10
+ getpercentile: number[]
11
+ /** term id string */
12
+ tid: string
13
+ filter: Filter
14
+ }
15
+
16
+ export type PercentileResponse = {
17
+ values: number[]
18
+ }
19
+
20
+ export const percentilePayload: RoutePayload = {
21
+ request: {
22
+ typeId: 'PercentileRequest'
23
+ },
24
+ response: {
25
+ typeId: 'PercentileResponse'
26
+ },
27
+ examples: [
28
+ {
29
+ request: {
30
+ body: {
31
+ genome: 'hg38-test',
32
+ dslabel: 'TermdbTest',
33
+ embedder: 'localhost',
34
+ getpercentile: [50],
35
+ tid: 'agedx',
36
+ filter: {
37
+ type: 'tvslst',
38
+ in: true,
39
+ join: '',
40
+ lst: [
41
+ {
42
+ tag: 'cohortFilter',
43
+ type: 'tvs',
44
+ tvs: {
45
+ term: {
46
+ name: 'Cohort',
47
+ type: 'categorical',
48
+ values: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },
49
+ id: 'subcohort',
50
+ isleaf: false,
51
+ groupsetting: { disabled: true }
52
+ },
53
+ values: [{ key: 'ABC', label: 'ABC' }]
54
+ }
55
+ }
56
+ ]
57
+ }
58
+ }
59
+ },
60
+ response: {
61
+ header: { status: 200 }
62
+ }
63
+ }
64
+ ]
65
+ }
@@ -0,0 +1,49 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+
3
+ export type RootTermRequest = {
4
+ /** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */
5
+ genome: string
6
+ /** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */
7
+ dslabel: string
8
+ embedder: string
9
+ default_rootterm: number
10
+ cohortValues: string
11
+ treeFilter: string
12
+ }
13
+
14
+ interface Entries {
15
+ name: string
16
+ id: string
17
+ isleaf: boolean
18
+ included_types: string[]
19
+ child_types: string[]
20
+ }
21
+
22
+ export type RootTermResponse = {
23
+ lst: Entries[]
24
+ }
25
+
26
+ export const rootTermPayload: RoutePayload = {
27
+ request: {
28
+ typeId: 'RootTermRequest'
29
+ },
30
+ response: {
31
+ typeId: 'RootTermResponse'
32
+ },
33
+ examples: [
34
+ {
35
+ request: {
36
+ body: {
37
+ genome: 'hg38-test',
38
+ dslabel: 'TermdbTest',
39
+ embedder: 'localhost',
40
+ default_rootterm: 1,
41
+ cohortValues: 'ABC'
42
+ }
43
+ },
44
+ response: {
45
+ header: { status: 200 }
46
+ }
47
+ }
48
+ ]
49
+ }
@@ -0,0 +1,26 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+
3
+ export type TermdbSampleImagesRequest = {
4
+ genome: string
5
+ /** Ds label */
6
+ dslabel: string
7
+ sampleId: number
8
+ }
9
+
10
+ export type Image = {
11
+ src: any
12
+ }
13
+
14
+ export type TermdbSampleImagesResponse = {
15
+ images: Image[]
16
+ }
17
+
18
+ export const termdbSampleImagesPayload: RoutePayload = {
19
+ request: {
20
+ typeId: 'TermdbSampleImagesRequest'
21
+ },
22
+ response: {
23
+ typeId: 'TermdbSampleImagesResponse'
24
+ }
25
+ //examples: []
26
+ }
@@ -0,0 +1,29 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import type { ErrorResponse } from './errorResponse.ts'
3
+
4
+ export type TermdbSingleSampleMutationRequest = {
5
+ /** Genome id */
6
+ genome: string
7
+ /** Dataset label */
8
+ dslabel: string
9
+ /** sample id */
10
+ sample: string
11
+ }
12
+ type ValidResponse = {
13
+ /** List of mutation data points from this sample TODO change to type of M elements */
14
+ mlst: object[]
15
+ /** */
16
+ dt2total?: { dt: number; total: number }[]
17
+ }
18
+
19
+ export type TermdbSingleSampleMutationResponse = ErrorResponse | ValidResponse
20
+
21
+ export const termdbSingleSampleMutationPayload: RoutePayload = {
22
+ request: {
23
+ typeId: 'TermdbSingleSampleMutationRequest'
24
+ },
25
+ response: {
26
+ typeId: 'TermdbSingleSampleMutationResponse'
27
+ }
28
+ // examples: []
29
+ }
@@ -0,0 +1,41 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import type { ErrorResponse } from './errorResponse.ts'
3
+
4
+ export type TermdbSingleCellDEgenesRequest = {
5
+ /** Genome id */
6
+ genome: string
7
+ /** Dataset label */
8
+ dslabel: string
9
+ /** Sample name
10
+ for GDC the value is "seurat.analysis.tsv" file UUID rather than sample name. the file contains the analysis results for an experiment
11
+ */
12
+ sample: string
13
+ /** column name to provide cell groups/clustering, for which DE genes are precomputed. */
14
+ columnName: string
15
+ /** User selected cell group/cluster, corresponds to columnName, for which DE genes will be returned to client */
16
+ categoryName: string
17
+ }
18
+
19
+ export type HasDataResponse = {
20
+ /** list of significant DE genes for the given category in the sample */
21
+ genes: {
22
+ /** gene name */
23
+ name: string
24
+ /** adjusted p-value */
25
+ p_val_adj: number
26
+ /** log foldchange */
27
+ avg_log2FC: number
28
+ }[]
29
+ }
30
+
31
+ export type TermdbSingleCellDEgenesResponse = ErrorResponse | HasDataResponse
32
+
33
+ export const termdbSingleCellDEgenesPayload: RoutePayload = {
34
+ request: {
35
+ typeId: 'TermdbSingleCellDEgenesRequest'
36
+ },
37
+ response: {
38
+ typeId: 'TermdbSingleCellDEgenesResponse'
39
+ }
40
+ // examples: []
41
+ }
@@ -0,0 +1,69 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import { ErrorResponse } from './errorResponse.ts'
3
+
4
+ export type Cell = {
5
+ /** Cell id or barcode */
6
+ cellId: string
7
+ /** X coord of the cell */
8
+ x: number
9
+ /** Y coord of the cell */
10
+ y: number
11
+ /** Z coord of the cell, should be present for all cells and trigger 3d plot */
12
+ z?: number
13
+ /** The cell may have different classifications, e.g. by cell type, CNV, FUSION, etc. */
14
+ category: string
15
+ /** Gene expression data for this cell */
16
+ geneExp?: number
17
+ }
18
+
19
+ export type Plot = {
20
+ /** name of the plot */
21
+ name: string
22
+ /** List of cells with gene expression */
23
+ expCells?: Cell[]
24
+ /** List of cells with no gene expression, if no gene provided all cells will be here */
25
+ noExpCells?: Cell[]
26
+ /** Column name to color by, e.g Cell type, CNV, Fusion */
27
+ colorBy: string
28
+ colorColumns: string[]
29
+ colorMap?: { [key: string]: string }
30
+ }
31
+
32
+ export type TermdbSingleCellDataRequest = {
33
+ /** Genome id */
34
+ genome: string
35
+ /** Dataset label */
36
+ dslabel: string
37
+ /** Sample name for which the sc results will be shown.
38
+ for GDC the value is "seurat.analysis.tsv" file UUID rather than any sample name. the file contains the analysis results for an experiment */
39
+ sample: { eID?: string; sID: string }
40
+ /** List of plot names from this sample to request data for */
41
+ plots: string[]
42
+ /** Gene name to retrieve expression data for all cells of the given sample, and to overlay on maps */
43
+ gene?: string
44
+ }
45
+
46
+ export type HasdataResponse = {
47
+ /** List of plots from singlecell experiment of this sample */
48
+ plots: Plot[]
49
+
50
+ /** Terms used to annotate cells */
51
+ //terms: Term[]
52
+ }
53
+
54
+ export type NodataResponse = {
55
+ /** Flag to indicate no sc data for this sample */
56
+ nodata: boolean
57
+ }
58
+
59
+ export type TermdbSingleCellDataResponse = NodataResponse | ErrorResponse | HasdataResponse
60
+
61
+ export const termdbSingleCellDataPayload: RoutePayload = {
62
+ request: {
63
+ typeId: 'TermdbSingleCellDataRequest'
64
+ },
65
+ response: {
66
+ typeId: 'TermdbSingleCellDataResponse'
67
+ }
68
+ // examples: []
69
+ }
@@ -0,0 +1,46 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+ import type { ErrorResponse } from './errorResponse.ts'
3
+
4
+ export type Sample = {
5
+ /** Sample name, required */
6
+ sample: string
7
+ /** optional list of sc data files available for this sample, gdc-specific
8
+ if available:
9
+ each row of sample table will infact be one experiment.
10
+ selecting one will use its experimentID as "sample" value in request parameter
11
+ each experiment may have additional fields that may be displayed in table. see singleCell.samples.experimentColumns[]
12
+
13
+ if no exp, then each sample will just have one experiment identifiable by its sample name, and this name is used in request
14
+ */
15
+ [key: string]: any //sample column/term value
16
+ experiments?: { experimentID: string }[]
17
+
18
+ // a sample may have additional fields that will be displayed in table, see singleCell.samples.sampleColumns[]
19
+ }
20
+
21
+ export type TermdbSingleCellSamplesRequest = {
22
+ /** Genome id */
23
+ genome: string
24
+ /** Dataset label */
25
+ dslabel: string
26
+ //filter0?: Filter0 // for gdc
27
+ }
28
+ type ValidResponse = {
29
+ /** List of sample names with singlecell data */
30
+ samples: Sample[]
31
+ fields: string[]
32
+ columnNames: string[]
33
+ sameLegend?: boolean
34
+ }
35
+
36
+ export type TermdbSingleCellSamplesResponse = ErrorResponse | ValidResponse
37
+
38
+ export const termdbSingleCellSamplesPayload: RoutePayload = {
39
+ request: {
40
+ typeId: 'TermdbSingleCellSamplesRequest'
41
+ },
42
+ response: {
43
+ typeId: 'TermdbSingleCellSamplesResponse'
44
+ }
45
+ // examples: []
46
+ }
@@ -0,0 +1,49 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+
3
+ export type TermChildrenRequest = {
4
+ /** a user-defined genome label in the serverconfig.json, hg38, hg19, mm10, etc */
5
+ genome: string
6
+ /** a user-defined dataset label in the serverconfig.json, such as ClinVar, SJLife, GDC, etc */
7
+ dslabel: string
8
+ embedder: string
9
+ get_children: number
10
+ tid: string
11
+ }
12
+
13
+ interface Entries {
14
+ name: string
15
+ id: string
16
+ isleaf: boolean
17
+ included_types: string[]
18
+ child_types: string[]
19
+ }
20
+
21
+ export type TermChildrenResponse = {
22
+ lst: Entries[]
23
+ }
24
+
25
+ export const termChildrenPayload: RoutePayload = {
26
+ request: {
27
+ typeId: 'TermChildrenRequest'
28
+ },
29
+ response: {
30
+ typeId: 'TermChildrenResponse'
31
+ },
32
+ examples: [
33
+ {
34
+ request: {
35
+ body: {
36
+ genome: 'hg38-test',
37
+ dslabel: 'TermdbTest',
38
+ embedder: 'localhost',
39
+ get_children: 1,
40
+ cohortValues: 'ABC',
41
+ tid: 'GO:0000001'
42
+ }
43
+ },
44
+ response: {
45
+ header: { status: 200 }
46
+ }
47
+ }
48
+ ]
49
+ }