@sjcrh/proteinpaint-types 2.84.0 → 2.85.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.
Files changed (135) hide show
  1. package/dist/routes.ts +28847 -0
  2. package/package.json +17 -13
  3. package/src/Mclass.js +0 -0
  4. package/src/checkers/routes.js +167 -0
  5. package/src/dataset.js +0 -0
  6. package/src/fileOrUrl.js +0 -0
  7. package/src/filter.js +0 -0
  8. package/src/genome.js +0 -0
  9. package/src/index.js +66 -0
  10. package/src/routes/brainImaging.js +11 -0
  11. package/src/routes/brainImagingSamples.js +11 -0
  12. package/src/routes/burden.js +44 -0
  13. package/src/routes/dataset.js +12 -0
  14. package/src/routes/dsdata.js +12 -0
  15. package/src/routes/dzimages.js +12 -0
  16. package/src/routes/errorResponse.js +0 -0
  17. package/src/routes/filter.gdc.js +0 -0
  18. package/src/routes/gdc.maf.js +17 -0
  19. package/src/routes/gdc.mafBuild.js +12 -0
  20. package/src/routes/gdc.topMutatedGenes.js +12 -0
  21. package/src/routes/genelookup.js +12 -0
  22. package/src/routes/genesetEnrichment.js +12 -0
  23. package/src/routes/genesetOverrepresentation.js +12 -0
  24. package/src/routes/healthcheck.js +23 -0
  25. package/src/routes/hicdata.js +12 -0
  26. package/src/routes/hicgenome.js +29 -0
  27. package/src/routes/hicstat.js +12 -0
  28. package/src/routes/isoformlst.js +12 -0
  29. package/src/routes/ntseq.js +12 -0
  30. package/src/routes/pdomain.js +12 -0
  31. package/src/routes/routeApi.js +0 -0
  32. package/src/routes/samplewsimages.js +12 -0
  33. package/src/routes/snp.js +11 -0
  34. package/src/routes/termdb.DE.js +13 -0
  35. package/src/routes/termdb.boxplot.js +12 -0
  36. package/src/routes/termdb.categories.js +48 -0
  37. package/src/routes/termdb.cluster.js +12 -0
  38. package/src/routes/termdb.cohort.summary.js +12 -0
  39. package/src/routes/termdb.cohorts.js +12 -0
  40. package/src/routes/termdb.descrstats.js +48 -0
  41. package/src/routes/termdb.numericcategories.js +12 -0
  42. package/src/routes/termdb.percentile.js +49 -0
  43. package/src/routes/termdb.rootterm.js +27 -0
  44. package/src/routes/termdb.sampleImages.js +12 -0
  45. package/src/routes/termdb.singleSampleMutation.js +12 -0
  46. package/src/routes/termdb.singlecellDEgenes.js +12 -0
  47. package/src/routes/termdb.singlecellData.js +12 -0
  48. package/src/routes/termdb.singlecellSamples.js +12 -0
  49. package/src/routes/termdb.termchildren.js +28 -0
  50. package/src/routes/termdb.termsbyids.js +12 -0
  51. package/src/routes/termdb.topTermsByType.js +12 -0
  52. package/src/routes/termdb.topVariablyExpressedGenes.js +12 -0
  53. package/src/routes/termdb.violin.js +49 -0
  54. package/src/routes/tileserver.js +12 -0
  55. package/src/routes/wsimages.js +12 -0
  56. package/src/terms/categorical.js +0 -0
  57. package/src/terms/condition.js +0 -0
  58. package/src/terms/geneExpression.js +0 -0
  59. package/src/terms/geneVariant.js +0 -0
  60. package/src/terms/metaboliteIntensity.js +0 -0
  61. package/src/terms/numeric.js +0 -0
  62. package/src/terms/q.js +0 -0
  63. package/src/terms/samplelst.js +0 -0
  64. package/src/terms/singleCellCellType.js +0 -0
  65. package/src/terms/singleCellGeneExpression.js +0 -0
  66. package/src/terms/snp.js +0 -0
  67. package/src/terms/snps.js +0 -0
  68. package/src/terms/term.js +0 -0
  69. package/src/terms/tw.js +0 -0
  70. package/src/terms/updated-types.js +0 -0
  71. package/src/termsetting.js +0 -0
  72. package/src/test/numeric.type.spec.js +117 -0
  73. package/src/vocab.js +0 -0
  74. package/src/Mclass.ts +0 -8
  75. package/src/dataset.ts +0 -1575
  76. package/src/docs.json +0 -16417
  77. package/src/fileOrUrl.ts +0 -15
  78. package/src/filter.ts +0 -125
  79. package/src/genome.ts +0 -123
  80. package/src/index.ts +0 -57
  81. package/src/routes/brainImaging.ts +0 -42
  82. package/src/routes/burden.ts +0 -69
  83. package/src/routes/dzimages.ts +0 -9
  84. package/src/routes/errorResponse.ts +0 -6
  85. package/src/routes/filter.gdc.ts +0 -15
  86. package/src/routes/gdc.maf.ts +0 -41
  87. package/src/routes/gdc.mafBuild.ts +0 -13
  88. package/src/routes/gdc.topMutatedGenes.ts +0 -25
  89. package/src/routes/genelookup.ts +0 -10
  90. package/src/routes/genesetEnrichment.ts +0 -46
  91. package/src/routes/genesetOverrepresentation.ts +0 -36
  92. package/src/routes/healthcheck.ts +0 -57
  93. package/src/routes/hicdata.ts +0 -37
  94. package/src/routes/hicgenome.ts +0 -22
  95. package/src/routes/hicstat.ts +0 -45
  96. package/src/routes/sampledzimages.ts +0 -1
  97. package/src/routes/samplewsimages.ts +0 -15
  98. package/src/routes/termdb.DE.ts +0 -44
  99. package/src/routes/termdb.boxplot.ts +0 -49
  100. package/src/routes/termdb.categories.ts +0 -26
  101. package/src/routes/termdb.cluster.ts +0 -86
  102. package/src/routes/termdb.getSampleImages.ts +0 -14
  103. package/src/routes/termdb.getTopTermsByType.ts +0 -21
  104. package/src/routes/termdb.getdescrstats.ts +0 -31
  105. package/src/routes/termdb.getnumericcategories.ts +0 -21
  106. package/src/routes/termdb.getpercentile.ts +0 -17
  107. package/src/routes/termdb.getrootterm.ts +0 -22
  108. package/src/routes/termdb.gettermchildren.ts +0 -21
  109. package/src/routes/termdb.singleSampleMutation.ts +0 -18
  110. package/src/routes/termdb.singlecellDEgenes.ts +0 -30
  111. package/src/routes/termdb.singlecellData.ts +0 -58
  112. package/src/routes/termdb.singlecellSamples.ts +0 -35
  113. package/src/routes/termdb.termsbyids.ts +0 -15
  114. package/src/routes/termdb.topVariablyExpressedGenes.ts +0 -45
  115. package/src/routes/termdb.violin.ts +0 -74
  116. package/src/routes/wsimages.ts +0 -12
  117. package/src/terms/categorical.ts +0 -106
  118. package/src/terms/condition.ts +0 -55
  119. package/src/terms/geneExpression.ts +0 -32
  120. package/src/terms/geneVariant.ts +0 -51
  121. package/src/terms/metaboliteIntensity.ts +0 -31
  122. package/src/terms/numeric.ts +0 -253
  123. package/src/terms/q.ts +0 -38
  124. package/src/terms/samplelst.ts +0 -41
  125. package/src/terms/singleCellCellType.ts +0 -22
  126. package/src/terms/singleCellGeneExpression.ts +0 -28
  127. package/src/terms/snp.ts +0 -28
  128. package/src/terms/snps.ts +0 -110
  129. package/src/terms/term.ts +0 -184
  130. package/src/terms/tw.ts +0 -38
  131. package/src/terms/updated-types.ts +0 -9
  132. package/src/termsetting.ts +0 -197
  133. package/src/test/numeric.type.spec.ts +0 -275
  134. package/src/typedoc.js +0 -30
  135. package/src/vocab.ts +0 -37
@@ -1,35 +0,0 @@
1
- import type { ErrorResponse } from './errorResponse.ts'
2
-
3
- export type Sample = {
4
- /** Sample name, required */
5
- sample: string
6
- /** optional list of sc data files available for this sample, gdc-specific
7
- if available:
8
- each row of sample table will infact be one experiment.
9
- selecting one will use its experimentID as "sample" value in request parameter
10
- each experiment may have additional fields that may be displayed in table. see singleCell.samples.experimentColumns[]
11
-
12
- if no exp, then each sample will just have one experiment identifiable by its sample name, and this name is used in request
13
- */
14
- [key: string]: any //sample column/term value
15
- experiments?: { experimentID: string }[]
16
-
17
- // a sample may have additional fields that will be displayed in table, see singleCell.samples.sampleColumns[]
18
- }
19
-
20
- export type TermdbSinglecellsamplesRequest = {
21
- /** Genome id */
22
- genome: string
23
- /** Dataset label */
24
- dslabel: string
25
- //filter0?: Filter0 // for gdc
26
- }
27
- type ValidResponse = {
28
- /** List of sample names with singlecell data */
29
- samples: Sample[]
30
- fields: string[]
31
- columnNames: string[]
32
- sameLegend?: boolean
33
- }
34
-
35
- export type TermdbSinglecellsamplesResponse = ErrorResponse | ValidResponse
@@ -1,15 +0,0 @@
1
- import type { TermWrapper } from '../terms/tw.ts'
2
-
3
- export type gettermsbyidsRequest = {
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
- /** term id string */
10
- ids: string[]
11
- }
12
-
13
- export type gettermsbyidsResponse = {
14
- terms: { [id: string]: TermWrapper }
15
- }
@@ -1,45 +0,0 @@
1
- //import GdcFilter0 from './filter.gdc'
2
- import type { Filter } from '../filter.ts'
3
- import type { ErrorResponse } from './errorResponse.ts'
4
-
5
- export type TermdbTopVariablyExpressedGenesRequest = {
6
- /** Ref genome */
7
- genome: string
8
- /** Ds label */
9
- dslabel: string
10
- /** Number of top genes requested */
11
- maxGenes: number
12
- /** optional param defined by dataset. if to scan all or subset of genes */
13
- geneSet?: {
14
- /** Indicates the geneset to return
15
- * all - all genes
16
- * custom - user defined list of genes
17
- * msigdb - msigdb geneset
18
- */
19
- type: 'all' | 'custom' | 'msigdb'
20
- /** Sent as null for 'all' types. Otherwise a list of gene symbols */
21
- geneList: string[] | null
22
- }
23
- /** optional parameter defined in gdc dataset. not used for non-gdc ds */
24
- min_median_log2_uqfpkm?: number
25
- /** filter extreme values (in native implementation): true/false */
26
- filter_extreme_values?: number
27
- /** min_count of fpkm when filter_extreme_values (in native implementation) = true */
28
- min_count?: number
29
- /** min_total_count of fpkm when filter_extreme_values (in native implementation) = true */
30
- min_total_count?: number
31
- /** Filter type: variance/inter-quartile region (in native implementation) */
32
- rank_type?: {
33
- type: 'var' | 'iqr'
34
- }
35
- filter?: Filter
36
- /** JSON, optional GDC cohort filter to restrict cases */
37
- filter0?: any //GdcFilter0
38
- }
39
-
40
- type ValidResponse = {
41
- /** Array of gene names TODO may change element to objs */
42
- genes: string[]
43
- }
44
-
45
- export type TermdbTopVariablyExpressedGenesResponse = ErrorResponse | ValidResponse
@@ -1,74 +0,0 @@
1
- import type { Filter } from '../filter.ts'
2
- import type { ErrorResponse } from './errorResponse.ts'
3
-
4
- export type getViolinRequest = {
5
- genome: string
6
- dslabel: string
7
- embedder: string
8
- /** main tw to fetch numeric data to show in violin */
9
- tw: any
10
- /** optional tw to divide tw data into multiple violins and show under one axis */
11
- divideTw?: any
12
- /** A number representing the device's pixel ratio, which may be used for rendering quality adjustments */
13
- devicePixelRatio: number
14
- /** optional mass filter */
15
- filter?: Filter
16
- /** optional read-only invisible filter TODO GdcFilter0 */
17
- filter0?: any
18
- /** A number representing the width of the SVG (Scalable Vector Graphics) box, used for rendering the chart */
19
- svgw: number
20
- /** A string with two possible values: 'horizontal' or 'vertical', indicating the orientation of the chart, either horizontal or vertical */
21
- orientation: 'horizontal' | 'vertical'
22
- /** A string representing the type of symbol used on the plot, which can be either 'circles' or 'rugs' */
23
- datasymbol: string
24
- /** A number representing the radius of the data symbols rendered on the plot */
25
- radius: number
26
- /** A number representing the width of the stroke used to generate the data symbols (data symbols are rendered on the server side) */
27
- strokeWidth: number
28
- /** A number representing the dimension perpendicular to the violin spread (the height of the axis) */
29
- axisHeight: number
30
- /** A number representing the right margin of the chart or plot */
31
- rightMargin: number
32
- /** A string representing a unit of measurement (e.g., 'log' for log scale) */
33
- unit: string
34
- /** ?? */
35
- isKDE: boolean
36
- }
37
-
38
- interface binsEntries {
39
- x0: number
40
- x1: number
41
- density: number
42
- }
43
- interface valuesEntries {
44
- id: string
45
- label: string
46
- value: number
47
- }
48
-
49
- interface pvalueEntries {
50
- value?: string
51
- html?: string
52
- }
53
-
54
- type plot = {
55
- label: string
56
- plotValueCount: number
57
- src: string
58
- bins: binsEntries[]
59
- densityMax: number
60
- biggestBin: number
61
- summaryStats: {
62
- values: valuesEntries[]
63
- }
64
- }
65
-
66
- export type getViolinResponse = ValidResponse | ErrorResponse
67
-
68
- type ValidResponse = {
69
- min: number
70
- max: number
71
- plots: plot[]
72
- pvalues?: pvalueEntries[][]
73
- uncomputableValueObj: any
74
- }
@@ -1,12 +0,0 @@
1
- export type GetWSImagesRequest = {
2
- genome: string
3
- dslabel: string
4
- sampleId: string
5
- wsimage: string
6
- }
7
-
8
- export type GetWSImagesResponse = {
9
- sessionId: string
10
- slide_dimensions: number[]
11
- status: string
12
- }
@@ -1,106 +0,0 @@
1
- import {
2
- BaseTerm,
3
- TermValues,
4
- GroupSettingQ,
5
- ValuesQ,
6
- TermGroupSetting,
7
- BaseTW,
8
- PredefinedGroupSettingQ,
9
- CustomGroupSettingQ
10
- } from './term.ts'
11
- import { RawValuesQ, RawPredefinedGroupsetQ, RawCustomGroupsetQ, MinBaseQ } from './q.ts'
12
- import { TermSettingInstance } from '../termsetting.ts'
13
-
14
- /**
15
- * A raw categorical term q object, before filling-in
16
- *
17
- * test:CategoricalQ:
18
- *
19
- * @category TW
20
- */
21
-
22
- export type RawCatTWValues = BaseTW & {
23
- type?: 'CatTWValues'
24
- /** must already exist, for dictionary terms, TwRouter.fill() will use mayHydrateDictTwLst() */
25
- term: CategoricalTerm
26
- q: RawValuesQ
27
- }
28
-
29
- export type RawCatTWPredefinedGS = BaseTW & {
30
- type?: 'CatTWPredefinedGS'
31
- term: CategoricalTerm
32
- q: RawPredefinedGroupsetQ
33
- }
34
-
35
- export type RawCatTWCustomGS = BaseTW & {
36
- type?: 'CatTWCustomGS'
37
- term: CategoricalTerm
38
- q: RawCustomGroupsetQ
39
- }
40
-
41
- export type RawCatTW = RawCatTWValues | RawCatTWPredefinedGS | RawCatTWCustomGS
42
-
43
- export type CategoricalBaseQ = MinBaseQ & {
44
- mode?: 'discrete' | 'binary'
45
- }
46
-
47
- export type CategoricalQ = GroupSettingQ | ValuesQ
48
-
49
- export type CategoricalTerm = BaseTerm & {
50
- type: 'categorical'
51
- values: TermValues
52
- groupsetting: TermGroupSetting
53
- }
54
-
55
- /**
56
- * A categorical term wrapper object
57
- *
58
- * @group Termdb
59
- * @category TW
60
- */
61
-
62
- export type CategoricalTW = BaseTW & {
63
- //id: string
64
- type: 'CatTWValues' | 'CatTWPredefinedGS' | 'CatTWCustomGS'
65
- q: CategoricalQ
66
- term: CategoricalTerm
67
- }
68
-
69
- export type CatTWValues = BaseTW & {
70
- //id: string
71
- term: CategoricalTerm
72
- q: ValuesQ
73
- type: 'CatTWValues'
74
- // do not use this boolean flag, defined here only to help illustrate
75
- // in tw/test/fake/app.js why this is type check error prone and
76
- // less preferred than a discriminant prop that also works at runtime
77
- isCatTWValues?: true
78
- }
79
-
80
- export type CatTWPredefinedGS = BaseTW & {
81
- //id: string
82
- term: CategoricalTerm
83
- q: PredefinedGroupSettingQ
84
- type: 'CatTWPredefinedGS'
85
- // do not use this boolean flag, defined here only to help illustrate
86
- // in tw/test/fake/app.js why this is type check error prone and
87
- // less preferred than a discriminant prop that also works at runtime
88
- isCatTWPredefiendGS?: true
89
- }
90
-
91
- export type CatTWCustomGS = BaseTW & {
92
- //id: string
93
- term: CategoricalTerm
94
- q: CustomGroupSettingQ
95
- type: 'CatTWCustomGS'
96
- }
97
-
98
- export type CatTWTypes = CatTWValues | CatTWPredefinedGS | CatTWCustomGS
99
-
100
- export type CategoricalTermSettingInstance = TermSettingInstance & {
101
- q: CategoricalQ
102
- term: CategoricalTerm
103
- category2samplecount: any
104
- validateGroupsetting: () => { text: string; bgcolor?: string }
105
- error?: string
106
- }
@@ -1,55 +0,0 @@
1
- import { BaseTerm, BaseQ, TermValues } from './term.ts'
2
- import { TermWrapper } from './tw.ts'
3
-
4
- /**
5
- * @category TW
6
- */
7
-
8
- export type ConditionQ = BaseQ & {
9
- mode: 'discrete' | 'binary' | 'cuminc' | 'cox'
10
- type?: 'values'
11
- bar_by_children?: boolean // 'true' if term is not a leaf and has subconditions
12
- bar_by_grade?: boolean /* 'true' for barchart. Always 'true' for cuminc and logistic/cox outcome (children terms are not allowed for those cases)
13
- when 'true', 'value_by_*' flags are effective.*/
14
- breaks?: number[] /*
15
- Breaks grades into groups
16
- Array length=1, will break grades to 2 groups.
17
- E.g. [3] divides to [-1,0,1,2,], [3,4,5]
18
- Allowed for both conditionModes "discrete/binary"
19
- Array length=2, break to 3 groups.
20
- E.g. [1,2] divides to [-1,0], [1], [2,3,4,5]
21
- E.g. [1,3] divides to [-1,0], [1,2], [3,4,5]
22
- Only allowed for conditionMode="discrete" but not "binary"
23
- */
24
- timeScale: 'age' | 'time'
25
- value_by_max_grade?: boolean //'false' if bar_by_children is 'true'
26
- value_by_most_recent?: boolean //'false' if bar_by_children is 'true'
27
- value_by_computable_grade?: boolean //'true' if bar_by_children is 'true'
28
- groups?: any // TODO: should use a defined type
29
- }
30
-
31
- export type ConditionTerm = BaseTerm & {
32
- type: 'condition'
33
- values: TermValues
34
- }
35
-
36
- /**
37
- * @group Termdb
38
- * @category TW
39
- */
40
- export type ConditionTW = TermWrapper & {
41
- term: ConditionTerm
42
- q: ConditionQ //replace the generic Q with specific condition Q
43
- }
44
-
45
- /**
46
- * @group Termdb
47
- * @category TW
48
- */
49
- /*
50
- export type ConditionTermSettingInstance = TermSettingInstance & {
51
- q: ConditionQ
52
- category2samplecount: { key: string; label: string; count: number }[]
53
- refGrp: any
54
- }
55
- */
@@ -1,32 +0,0 @@
1
- import { TermWrapper } from './tw.ts'
2
- import { NumericTerm, NumericQ } from './numeric.ts'
3
- import { TermSettingInstance } from '../termsetting.ts'
4
-
5
- /*
6
- --------EXPORTED--------
7
- GeneExpressionQ
8
- GeneExpressionTermWrapper
9
- GeneExpressionTermSettingInstance
10
-
11
- */
12
-
13
- export type GeneExpressionQ = NumericQ & { dt?: number }
14
-
15
- export type GeneExpressionTW = TermWrapper & {
16
- q: GeneExpressionQ
17
- term: GeneExpressionTerm
18
- }
19
-
20
- export type GeneExpressionTerm = NumericTerm & {
21
- gene: string
22
- // temporarily allowing chr/start/stop to support
23
- // legacy fpkm files
24
- chr?: string
25
- start?: number
26
- stop?: number
27
- }
28
-
29
- export type GeneExpressionTermSettingInstance = TermSettingInstance & {
30
- q: GeneExpressionQ
31
- term: GeneExpressionTerm
32
- }
@@ -1,51 +0,0 @@
1
- import { MinBaseQ, BaseTerm, EnabledTermGroupSetting, BaseTW, GroupSettingQ, ValuesQ } from '../index.ts'
2
- import { TermSettingInstance } from '../termsetting.ts'
3
-
4
- export type GeneVariantBaseQ = MinBaseQ & {
5
- cnvGainCutoff?: number
6
- cnvMaxLength?: number
7
- cnvMinAbsValue?: number
8
- cnvLossCutoff?: number
9
- exclude: string[]
10
- dt?: number
11
- origin?: string
12
- }
13
-
14
- export type GeneVariantQ = GeneVariantBaseQ & (ValuesQ | GroupSettingQ)
15
-
16
- type GeneVariantBaseTerm = BaseTerm & {
17
- type: 'geneVariant'
18
- groupsetting: EnabledTermGroupSetting
19
- }
20
-
21
- export type GeneVariantGeneTerm = GeneVariantBaseTerm & {
22
- kind: 'gene'
23
- gene: string
24
- // chr,start,stop should exist together as a separate type called
25
- // 'Coord', but hard to code as atomic `& Coord` because it may
26
- // need to be filled in
27
- chr?: string
28
- start?: number
29
- stop?: number
30
- }
31
-
32
- export type GeneVariantCoordTerm = GeneVariantBaseTerm & {
33
- kind: 'coord'
34
- chr: string
35
- start: number
36
- stop: number
37
- }
38
-
39
- export type GeneVariantTerm = GeneVariantGeneTerm | GeneVariantCoordTerm
40
-
41
- export type GeneVariantTW = BaseTW & {
42
- term: GeneVariantTerm
43
- q: GeneVariantQ
44
- }
45
-
46
- export type GeneVariantTermSettingInstance = TermSettingInstance & {
47
- q: GeneVariantQ
48
- term: GeneVariantTerm
49
- category2samplecount: any
50
- groupSettingInstance?: any
51
- }
@@ -1,31 +0,0 @@
1
- import { TermWrapper } from './tw.ts'
2
- import { BaseQ } from './term.ts'
3
- import { NumericTerm } from './numeric.ts'
4
- import { TermSettingInstance } from '../termsetting.ts'
5
-
6
- /*
7
- --------EXPORTED--------
8
- MetaboliteIntensityQ
9
- MetaboliteIntensityTermWrapper
10
- MetaboliteIntensityTermSettingInstance
11
-
12
- */
13
-
14
- export type MetaboliteIntensityQ = BaseQ & {
15
- mode: 'continuous'
16
- }
17
-
18
- export type MetaboliteIntensityTW = TermWrapper & {
19
- q: MetaboliteIntensityQ
20
- term: MetaboliteIntensityTerm
21
- }
22
-
23
- export type MetaboliteIntensityTerm = NumericTerm & {
24
- metabolite: string
25
- bins: any
26
- }
27
-
28
- export type MetaboliteIntensityTermSettingInstance = TermSettingInstance & {
29
- q: MetaboliteIntensityQ
30
- term: MetaboliteIntensityTerm
31
- }