@sjcrh/proteinpaint-types 2.177.0 → 2.178.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 (54) hide show
  1. package/dist/brainImaging.js +1 -1
  2. package/dist/{chunk-LHJGTOZJ.js → chunk-26UKKPK2.js} +1301 -594
  3. package/dist/{chunk-4SOVPEYQ.js → chunk-2XQJCZEO.js} +842 -243
  4. package/dist/{chunk-UQEAM7BH.js → chunk-2Y7WE3JU.js} +1301 -594
  5. package/dist/chunk-4DCPDZW4.js +143 -0
  6. package/dist/{chunk-5KF6Z3GL.js → chunk-CX2Y673E.js} +923 -329
  7. package/dist/chunk-CYQDO4FX.js +3191 -0
  8. package/dist/{chunk-W7UCAYSF.js → chunk-FQYNRDHB.js} +923 -329
  9. package/dist/chunk-FRXRNCDV.js +14 -0
  10. package/dist/{chunk-F4YCPOQV.js → chunk-GAYJUXNZ.js} +947 -353
  11. package/dist/{chunk-7WEVNKAM.js → chunk-HZEV7D5E.js} +1301 -594
  12. package/dist/{chunk-4ZMQ5CTL.js → chunk-NIEACU6R.js} +7 -31
  13. package/dist/{chunk-Q6MWNJ2V.js → chunk-NRV6MPRM.js} +3421 -1378
  14. package/dist/{chunk-44LN7YTE.js → chunk-PHRILOVX.js} +923 -329
  15. package/dist/{chunk-URHI6FFP.js → chunk-UFYKXOY2.js} +2233 -690
  16. package/dist/{chunk-63OD34W2.js → chunk-UWAVSKMD.js} +1301 -594
  17. package/dist/chunk-VBNF7BRI.js +3492 -0
  18. package/dist/{chunk-2DJFVQUQ.js → chunk-WXCXZRKP.js} +1305 -598
  19. package/dist/{chunk-7NKZVHIZ.js → chunk-YHKFJCXG.js} +1445 -496
  20. package/dist/correlationVolcano.js +1 -1
  21. package/dist/grin2.js +1 -1
  22. package/dist/index.js +79 -61
  23. package/dist/termdb.boxplot.js +1 -1
  24. package/dist/termdb.categories.js +1 -1
  25. package/dist/termdb.chat.js +3122 -5
  26. package/dist/termdb.chat2.js +13 -0
  27. package/dist/termdb.cluster.js +1 -1
  28. package/dist/termdb.descrstats.js +1 -1
  29. package/dist/termdb.diffMeth.js +11 -0
  30. package/dist/termdb.dmr.js +11 -0
  31. package/dist/termdb.numericcategories.js +1 -1
  32. package/dist/termdb.percentile.js +1 -1
  33. package/dist/termdb.singlecellData.js +1 -1
  34. package/dist/termdb.termsbyids.js +1 -1
  35. package/dist/termdb.topTermsByType.js +1 -1
  36. package/dist/termdb.topVariablyExpressedGenes.js +1 -1
  37. package/dist/termdb.violin.js +1 -1
  38. package/package.json +1 -1
  39. package/src/dataset.ts +55 -8
  40. package/src/index.ts +5 -1
  41. package/src/routes/grin2.ts +5 -11
  42. package/src/routes/{termdb.chat.ts → termdb.chat2.ts} +42 -15
  43. package/src/routes/termdb.cluster.ts +11 -0
  44. package/src/routes/termdb.diffMeth.ts +49 -0
  45. package/src/routes/termdb.dmr.ts +47 -0
  46. package/src/routes/termdb.singlecellData.ts +3 -1
  47. package/src/terms/dnaMethylation.ts +19 -0
  48. package/src/terms/numeric.ts +13 -2
  49. package/src/terms/singleCellCellType.ts +1 -1
  50. package/src/terms/singleCellGeneExpression.ts +25 -19
  51. package/src/terms/term.ts +1 -1
  52. package/src/terms/termCollection.ts +93 -21
  53. package/src/terms/wholeProteomeAbundance.ts +30 -0
  54. package/dist/chunk-WWE2SDCU.js +0 -494
@@ -0,0 +1,13 @@
1
+ import {
2
+ validChatRequest,
3
+ validChatResponse
4
+ } from "./chunk-GAYJUXNZ.js";
5
+ import {
6
+ ChatPayload
7
+ } from "./chunk-FRXRNCDV.js";
8
+ import "./chunk-YNHC5SXO.js";
9
+ export {
10
+ ChatPayload,
11
+ validChatRequest,
12
+ validChatResponse
13
+ };
@@ -2,7 +2,7 @@ import {
2
2
  termdbClusterPayload,
3
3
  validTermdbClusterRequest,
4
4
  validTermdbClusterResponse
5
- } from "./chunk-Q6MWNJ2V.js";
5
+ } from "./chunk-NRV6MPRM.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbClusterPayload,
@@ -2,7 +2,7 @@ import {
2
2
  descrStatsPayload,
3
3
  validDescrStatsRequest,
4
4
  validDescrStatsResponse
5
- } from "./chunk-63OD34W2.js";
5
+ } from "./chunk-UWAVSKMD.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  descrStatsPayload,
@@ -0,0 +1,11 @@
1
+ import {
2
+ diffMethPayload,
3
+ validDiffMethRequest,
4
+ validDiffMethResponse
5
+ } from "./chunk-4DCPDZW4.js";
6
+ import "./chunk-YNHC5SXO.js";
7
+ export {
8
+ diffMethPayload,
9
+ validDiffMethRequest,
10
+ validDiffMethResponse
11
+ };
@@ -0,0 +1,11 @@
1
+ import {
2
+ TermdbDmrPayload,
3
+ validTermdbDmrRequest,
4
+ validTermdbDmrResponse
5
+ } from "./chunk-CYQDO4FX.js";
6
+ import "./chunk-YNHC5SXO.js";
7
+ export {
8
+ TermdbDmrPayload,
9
+ validTermdbDmrRequest,
10
+ validTermdbDmrResponse
11
+ };
@@ -2,7 +2,7 @@ import {
2
2
  numericCategoriesPayload,
3
3
  validNumericCategoriesRequest,
4
4
  validNumericCategoriesResponse
5
- } from "./chunk-5KF6Z3GL.js";
5
+ } from "./chunk-CX2Y673E.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  numericCategoriesPayload,
@@ -2,7 +2,7 @@ import {
2
2
  percentilePayload,
3
3
  validPercentileRequest,
4
4
  validPercentileResponse
5
- } from "./chunk-7NKZVHIZ.js";
5
+ } from "./chunk-YHKFJCXG.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  percentilePayload,
@@ -2,7 +2,7 @@ import {
2
2
  termdbSingleCellDataPayload,
3
3
  validTermdbSingleCellDataRequest,
4
4
  validTermdbSingleCellDataResponse
5
- } from "./chunk-4ZMQ5CTL.js";
5
+ } from "./chunk-NIEACU6R.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbSingleCellDataPayload,
@@ -2,7 +2,7 @@ import {
2
2
  termsByIdsPayload,
3
3
  validTermsByIdsRequest,
4
4
  validTermsByIdsResponse
5
- } from "./chunk-7WEVNKAM.js";
5
+ } from "./chunk-HZEV7D5E.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termsByIdsPayload,
@@ -2,7 +2,7 @@ import {
2
2
  termdbTopTermsByTypePayload,
3
3
  validTermdbTopTermsByTypeRequest,
4
4
  validTermdbTopTermsByTypeResponse
5
- } from "./chunk-URHI6FFP.js";
5
+ } from "./chunk-UFYKXOY2.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbTopTermsByTypePayload,
@@ -2,7 +2,7 @@ import {
2
2
  termdbTopVariablyExpressedGenesPayload,
3
3
  validTermdbTopVariablyExpressedGenesRequest,
4
4
  validTermdbTopVariablyExpressedGenesResponse
5
- } from "./chunk-W7UCAYSF.js";
5
+ } from "./chunk-FQYNRDHB.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  termdbTopVariablyExpressedGenesPayload,
@@ -2,7 +2,7 @@ import {
2
2
  validViolinRequest,
3
3
  validViolinResponse,
4
4
  violinPayload
5
- } from "./chunk-44LN7YTE.js";
5
+ } from "./chunk-PHRILOVX.js";
6
6
  import "./chunk-YNHC5SXO.js";
7
7
  export {
8
8
  validViolinRequest,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-types",
3
- "version": "2.177.0",
3
+ "version": "2.178.0",
4
4
  "type": "module",
5
5
  "description": "Shared type definitions between ProteinPaint server and client code",
6
6
  "main": "src/index.ts",
package/src/dataset.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import type { Mclass } from './Mclass.ts'
2
+ import type { BaseTerm } from './terms/term.ts'
3
+ import type { CategoryKey } from './terms/termCollection.ts'
2
4
  import type { WSImage } from './routes/samplewsimages.ts'
3
5
  import type { WSISample } from './routes/wsisamples.ts'
4
6
  import type { SaveWSIAnnotationRequest } from './routes/saveWSIAnnotation.ts'
@@ -694,6 +696,17 @@ export type MetaboliteIntensityQueryNative = {
694
696
 
695
697
  export type MetaboliteIntensityQuery = MetaboliteIntensityQueryNative
696
698
 
699
+ export type WholeProteomeAbundanceQuery = {
700
+ /** document structure */
701
+ file: string
702
+ samples?: number[]
703
+ /** _proteins,used to dynamically built cache of protein names to speed up search */
704
+ _proteins?: string[]
705
+ get?: (param: any) => void
706
+ find?: (param: string[]) => void
707
+ bins?: { [index: string]: any }
708
+ }
709
+
697
710
  /** the geneExpression query
698
711
  three possibilities
699
712
  { src: 'native', file }
@@ -853,6 +866,8 @@ export type SingleCellQuery = {
853
866
  DEgenes?: SingleCellDEgeneGdc
854
867
  /** supplies per-sample images. will create a new tab on the ui. one image per sample */
855
868
  images?: SCImages
869
+ /** Created on mds.init() from colorMap and alias within each plot. */
870
+ terms?: object[]
856
871
  }
857
872
 
858
873
  type SCImages = {
@@ -967,6 +982,21 @@ type Mds3Queries = {
967
982
  file: string
968
983
  // in case a genome may have more than 1 geneset dbs, here may specify name of db that this result is based on */
969
984
  }
985
+ /** dna methylation beta value matrix
986
+ */
987
+ dnaMethylation?: {
988
+ /** path to h5 file */
989
+ file: string
990
+ /** dna methylation unit (e.g. 'Average Beta Value') */
991
+ unit: string
992
+ /** promoter-by-sample matrix, values are average M-value */
993
+ promoter?: {
994
+ /** path to h5 file */
995
+ file: string
996
+ /** unit label for promoter values (e.g. 'Average M-value') */
997
+ unit: string
998
+ }
999
+ }
970
1000
  rnaseqGeneCount?: RnaseqGeneCount
971
1001
  /** Used to create the top mutated genes UI in the gene
972
1002
  * set edit ui and data requests. */
@@ -978,6 +1008,10 @@ type Mds3Queries = {
978
1008
  src: 'native'
979
1009
  file: string
980
1010
  }
1011
+ proteome?: {
1012
+ /** whole proteome abundance */
1013
+ whole?: WholeProteomeAbundanceQuery
1014
+ }
981
1015
  singleCell?: SingleCellQuery
982
1016
  singleSampleGenomeQuantification?: SingleSampleGenomeQuantification
983
1017
  singleSampleGbtk?: SingleSampleGbtk
@@ -1607,18 +1641,18 @@ keep this setting here for reason of:
1607
1641
  isTermVisible?: (clientAuthResult: any, ids: string) => boolean
1608
1642
  hiddenIds?: string[]
1609
1643
  getAdditionalFilter?: (__protected__: any, term: any) => Filter | undefined
1610
- /** collections of numeric dictionary terms that are related and can be used together in some plots
1611
- */
1612
- numericTermCollections?: NumericTermCollection[]
1644
+ /** collections of dictionary terms (numeric or categorical) that are related and can be used together in some plots */
1645
+ termCollections?: TermCollection[]
1613
1646
  }
1614
1647
 
1615
- type NumericTermCollection = {
1616
- /** collection id */
1617
- id?: string
1618
- /** human readable name for this collection, may be as collection id if missing */
1648
+ type TermCollectionBase = {
1649
+ /** human readable name as well as unique identifier for this collection */
1619
1650
  name: string
1620
- /** array of dictionary numeric term ids belonging to this collection */
1651
+ /** array of dictionary term ids belonging to this collection */
1621
1652
  termIds: string[]
1653
+ /** full term objects corresponding to termIds[]; populated by server on dataset init,
1654
+ * sent to client so fill() can resolve member term names without extra requests */
1655
+ termlst?: BaseTerm[]
1622
1656
  /** array of branch term ids belonging to this collection,
1623
1657
  * may be used as state.tree.expandedTermIds[] option to termdb appInit() */
1624
1658
  branchIds: string[]
@@ -1634,6 +1668,18 @@ type NumericTermCollection = {
1634
1668
  }[]
1635
1669
  }
1636
1670
 
1671
+ type NumericTermCollection = TermCollectionBase & {
1672
+ type: 'numeric'
1673
+ }
1674
+
1675
+ type CategoricalTermCollection = TermCollectionBase & {
1676
+ type: 'categorical'
1677
+ /** category values to filter on; hydrated form uses CategoryKey[] */
1678
+ categoryKeys: CategoryKey[]
1679
+ }
1680
+
1681
+ type TermCollection = NumericTermCollection | CategoricalTermCollection
1682
+
1637
1683
  type SampleType = {
1638
1684
  name: string
1639
1685
  plural_name: string
@@ -1960,6 +2006,7 @@ export type Mds3 = BaseMds & {
1960
2006
  validate_filter0?: (f: any) => void
1961
2007
  ssm2canonicalisoform?: GdcApi
1962
2008
  variant2samples?: Variant2Samples
2009
+ scatterplots?: Scatterplots
1963
2010
  /** disables switching to genomic mode for the protein view mds3 tk of this ds
1964
2011
  works by preventing block gmmode menu from showing "genomic" option
1965
2012
  is only passed via mds3 adhoc ds copy, but not termdbConfig
package/src/index.ts CHANGED
@@ -40,12 +40,14 @@ export * from './routes/saveWSIAnnotation.ts'
40
40
  export * from './routes/snp.ts'
41
41
  export * from './routes/termdb.boxplot.ts'
42
42
  export * from './routes/termdb.categories.ts'
43
- export * from './routes/termdb.chat.ts'
43
+ export * from './routes/termdb.chat2.ts'
44
44
  export * from './routes/termdb.cluster.ts'
45
45
  export * from './routes/termdb.cohort.summary.ts'
46
46
  export * from './routes/termdb.cohorts.ts'
47
47
  export * from './routes/termdb.DE.ts'
48
+ export * from './routes/termdb.diffMeth.ts'
48
49
  export * from './routes/termdb.descrstats.ts'
50
+ export * from './routes/termdb.dmr.ts'
49
51
  export * from './routes/termdb.numericcategories.ts'
50
52
  export * from './routes/termdb.percentile.ts'
51
53
  export * from './routes/termdb.runChart.ts'
@@ -73,6 +75,7 @@ export * from './terms/numeric.ts'
73
75
  export * from './terms/geneVariant.ts'
74
76
  export * from './terms/geneExpression.ts'
75
77
  export * from './terms/metaboliteIntensity.ts'
78
+ export * from './terms/wholeProteomeAbundance.ts'
76
79
  export * from './terms/qualitative.ts'
77
80
  export * from './terms/singleCellCellType.ts'
78
81
  export * from './terms/singleCellGeneExpression.ts'
@@ -80,6 +83,7 @@ export * from './terms/snp.ts'
80
83
  export * from './terms/snps.ts'
81
84
  export * from './terms/samplelst.ts'
82
85
  export * from './terms/ssGSEA.ts'
86
+ export * from './terms/dnaMethylation.ts'
83
87
  export * from './terms/q.ts'
84
88
  export * from './terms/term.ts'
85
89
  export * from './terms/termCollection.ts'
@@ -1,13 +1,5 @@
1
- /** General GRIN2 route
2
- * This route handles the GRIN2 analysis for any non-GDC data.
3
- * It processes the incoming data structure via PP's existing filter infrastructure
4
- * and returns the same structured results as GDC-GRIN2.
5
- * Specifically it will return a sortable table of top mutated genes and
6
- * a static PNG manhattan-like plot of the -log10(q-value).
7
- * We allow the user to customize the snvindel, CNV, and fusion filtering options.
8
- */
9
-
10
1
  import type { RoutePayload } from './routeApi.js'
2
+ import type { Filter } from '../filter.ts'
11
3
 
12
4
  /** GRIN2 request */
13
5
  export type GRIN2Request = {
@@ -49,8 +41,8 @@ export type GRIN2Request = {
49
41
  /** Bin size for Manhattan plot histogram bin size. Used in the calculation of dynamic y-axis capping process (default: 10) */
50
42
  binSize: number
51
43
 
52
- /** Filter from existing PP infrastructure */
53
- filter?: any // Filter object passed to get_samples(filter, ds)
44
+ /** pp filter */
45
+ filter?: Filter
54
46
 
55
47
  /** Options for filtering SNV/indel file content */
56
48
  snvindelOptions?: {
@@ -66,6 +58,8 @@ export type GRIN2Request = {
66
58
  fivePrimeFlankSize?: number
67
59
  /** Number of bases to include as 3' flank around the mutation position */
68
60
  threePrimeFlankSize?: number
61
+ /** MAF filter object (tvslst) to filter mutations by allele frequency */
62
+ mafFilter?: Filter
69
63
  }
70
64
 
71
65
  /** Options for filtering CNV file content */
@@ -11,9 +11,14 @@ export type ChatRequest = {
11
11
  __protected__?: any
12
12
  }
13
13
 
14
- type HtmlResponse = {
14
+ export type TextResponse = {
15
+ type: 'text'
16
+ /** Plain text message to display in the chat */
17
+ text: string
18
+ }
19
+ export type HtmlResponse = {
15
20
  type: 'html'
16
- /** for display only */
21
+ /** Pre-approved HTML from the dataset JSON resources array */
17
22
  html: string
18
23
  }
19
24
  export type PlotResponse = {
@@ -22,9 +27,20 @@ export type PlotResponse = {
22
27
  /** Specifies what action to take e.g. Summary plot or no action. Will add more chart types later */
23
28
  }
24
29
 
25
- export type LlmConfig = { provider: 'SJ' | 'ollama'; api: string; modelName: string }
30
+ export type LlmConfig = {
31
+ provider: 'SJ' | 'ollama'
32
+ api: string
33
+ modelName: string
34
+ embeddingModelName: string
35
+ /** Whether to load the embedding model locally (via transformers.js) or call a remote API. Defaults to 'local'. */
36
+ embeddingModelAccess?: 'local' | 'api'
37
+ /** Smaller model to use for LLM classification fallback. Defaults to modelName if not set. */
38
+ classifierModelName?: string
39
+ /** Log verbose debug output (e.g. raw embedding arrays) to the terminal. Defaults to false. */
40
+ verbose?: boolean
41
+ }
26
42
 
27
- export type ChatResponse = HtmlResponse | PlotResponse
43
+ export type ChatResponse = TextResponse | HtmlResponse | PlotResponse
28
44
 
29
45
  export const ChatPayload: RoutePayload = {
30
46
  request: {
@@ -90,23 +106,34 @@ export type DbValue = {
90
106
  }
91
107
 
92
108
  export type ClassificationType =
93
- | html_type
94
- | plot_type /** Variable containing the type of action the UI needs to take */
95
-
96
- export type html_type = {
97
- /** When type == html, display the string in the html field */
98
- type: 'html'
99
- /** The message to be dislayed on the chatbot UI */
100
- html: string
101
- }
109
+ | plot_type
110
+ | resource_type
111
+ | none_type /** Variable containing the type of action the UI needs to take */
102
112
 
103
113
  export type plot_type = {
104
114
  /** When type == plot, show the corresponding plot in the plot field */
105
115
  type: 'plot'
106
- /** The type of plot to be displayed on the UI. */
107
- plot: 'summary' | 'dge' | 'none' | 'survival' | 'matrix' | 'sampleScatter'
116
+ /** The type of plot to be displayed on the UI.
117
+ * Standard categories are listed; datasets may define additional custom categories. */
118
+ plot: 'summary' | 'dge' | 'survival' | 'matrix' | 'sampleScatter'
108
119
  }
109
120
 
121
+ export type resource_type = {
122
+ /** When type == resource, invoke the resource agent to return a matching resource link */
123
+ type: 'resource'
124
+ }
125
+
126
+ export type none_type = {
127
+ /** When type == none, the query did not match any known category */
128
+ type: 'none'
129
+ }
130
+
131
+ /** Top-level classification returned by classifyQuery: plot or notplot (subtype determined separately by plot.ts) */
132
+ export type QueryClassification = { type: 'plot' } | { type: 'notplot' }
133
+
134
+ /** Specific plot type returned by classifyPlotType in plot.ts */
135
+ export type PlotType = 'summary' | 'dge' | 'survival' | 'matrix' | 'samplescatter'
136
+
110
137
  export type DEType = {
111
138
  /** Name of group1 which is an array of filter terms */
112
139
  group1: FilterTerm[]
@@ -4,6 +4,7 @@ import type { Filter } from '../filter.ts'
4
4
  import type { Term } from '../terms/term.ts'
5
5
  import type { GeneExpressionTW } from '../terms/geneExpression.ts'
6
6
  import type { MetaboliteIntensityTW } from '../terms/metaboliteIntensity.ts'
7
+ import type { WholeProteomeAbundanceTW } from '../terms/wholeProteomeAbundance.ts'
7
8
  import type { NumericTW } from '../terms/numeric.ts'
8
9
 
9
10
  export type Gene = {
@@ -48,6 +49,15 @@ export type TermdbClusterRequestMetabolite = TermdbClusterRequestBase & {
48
49
  zScoreTransformation?: string
49
50
  }
50
51
 
52
+ export type TermdbClusterRequestWholeProteomeAbundance = TermdbClusterRequestBase & {
53
+ /** Data type */
54
+ dataType: 'wholeProteomeAbundance'
55
+ /** List of terms */
56
+ terms: WholeProteomeAbundanceTW[]
57
+ /** perform z-score transformation on values */
58
+ zScoreTransformation?: string
59
+ }
60
+
51
61
  export type TermdbClusterRequestNumericDictTerm = TermdbClusterRequestBase & {
52
62
  /** Data type */
53
63
  dataType: 'numericDictTerm'
@@ -61,6 +71,7 @@ export type TermdbClusterRequest =
61
71
  | TermdbClusterRequestGeneExpression
62
72
  | TermdbClusterRequestMetabolite
63
73
  | TermdbClusterRequestNumericDictTerm
74
+ | TermdbClusterRequestWholeProteomeAbundance
64
75
 
65
76
  export type Hclust = {
66
77
  merge: { n1: number; n2: number }[]
@@ -0,0 +1,49 @@
1
+ import type { RoutePayload } from './routeApi.js'
2
+
3
+ export type DiffMethRequest = {
4
+ /** Genome build name */
5
+ genome: string
6
+ /** Dataset label */
7
+ dslabel: string
8
+ /** Object containing two arrays of samples for differential methylation analysis */
9
+ samplelst: any
10
+ /** Minimum non-NA samples required per group (default 3) */
11
+ min_samples_per_group?: number
12
+ /** Term for confounding variable 1 (if present) */
13
+ tw?: any
14
+ /** Term for confounding variable 2 (if present) */
15
+ tw2?: any
16
+ /** Option to return early with actual number of samples with methylation values */
17
+ preAnalysis?: boolean
18
+ }
19
+
20
+ export type DiffMethResponse = {
21
+ /** Array of promoter-level differential methylation results */
22
+ data: DiffMethDataEntry[]
23
+ /** Effective sample size for group 1 */
24
+ sample_size1: number
25
+ /** Effective sample size for group 2 */
26
+ sample_size2: number
27
+ }
28
+
29
+ export type DiffMethDataEntry = {
30
+ /** ENCODE CRE promoter ID (e.g. EH38E3756858) */
31
+ promoter_id: string
32
+ /** Gene symbol(s) associated with the promoter (comma-separated if multiple) */
33
+ gene_name: string
34
+ /** M-value difference (positive = hypermethylated in cases) */
35
+ fold_change: number
36
+ /** Raw p-value from moderated t-test */
37
+ original_p_value: number
38
+ /** FDR-adjusted p-value (Benjamini-Hochberg) */
39
+ adjusted_p_value: number
40
+ }
41
+
42
+ export const diffMethPayload: RoutePayload = {
43
+ request: {
44
+ typeId: 'DiffMethRequest'
45
+ },
46
+ response: {
47
+ typeId: 'DiffMethResponse'
48
+ }
49
+ }
@@ -0,0 +1,47 @@
1
+ import type { Filter } from '../filter.ts'
2
+ import type { RoutePayload } from './routeApi.ts'
3
+
4
+ export type TermdbDmrRequest = {
5
+ genome: string
6
+ dslabel: string
7
+ /** list of samples from each group */
8
+ group1: Sample[]
9
+ group2: Sample[]
10
+ /** query region */
11
+ chr: string
12
+ start: number
13
+ stop: number
14
+ // todo more params
15
+ filter?: Filter
16
+ __protected__?: any
17
+ }
18
+
19
+ type Sample = {
20
+ sampleId: number | string
21
+ sample: string
22
+ }
23
+
24
+ export type TermdbDmrSuccessResponse = {
25
+ status: 'ok'
26
+ dmrs: {
27
+ chr: string
28
+ start: number
29
+ stop: number
30
+ // todo more stats
31
+ }[]
32
+ }
33
+
34
+ export type TermdbDmrErrorResponse = {
35
+ error: string
36
+ }
37
+
38
+ export type TermdbDmrResponse = TermdbDmrSuccessResponse | TermdbDmrErrorResponse
39
+
40
+ export const TermdbDmrPayload: RoutePayload = {
41
+ request: {
42
+ typeId: 'TermdbDmrRequest'
43
+ },
44
+ response: {
45
+ typeId: 'TermdbDmrResponse'
46
+ }
47
+ }
@@ -44,8 +44,10 @@ export type TermdbSingleCellDataRequest = {
44
44
  key: plot.name, value: column name
45
45
  if missing, use default setting of the plot
46
46
  */
47
- colorBy?: { [key: string]: string }
47
+ // colorBy?: { [key: string]: string }
48
+ colorBy?: string
48
49
  colorMap?: { [key: string]: string }
50
+ singleCellPlot?: any
49
51
  }
50
52
 
51
53
  export type HasdataResponse = {
@@ -0,0 +1,19 @@
1
+ import type { NumericBaseTerm, NumericQ, PresetNumericBins, NumTW, RawNumTW } from './numeric.ts'
2
+
3
+ export type DnaMethylationQ = NumericQ & { dt?: number }
4
+
5
+ export type DnaMethylationTerm = NumericBaseTerm & {
6
+ /** term.id: plan to be concatenated string value "chr:start-stop" */
7
+ /** term.name: can be user-assigned */
8
+ type: 'dnaMethylation'
9
+ chr: string
10
+ start: number
11
+ stop: number
12
+ bins?: PresetNumericBins
13
+ }
14
+
15
+ export type RawDnaMethylationTerm = DnaMethylationTerm & { name?: string }
16
+
17
+ export type DnaMethylationTW = NumTW & { term: DnaMethylationTerm }
18
+
19
+ export type RawDnaMethylationTW = RawNumTW & { term: RawDnaMethylationTerm }
@@ -5,8 +5,11 @@ import type {
5
5
  BaseTerm,
6
6
  GeneExpressionTerm,
7
7
  MetaboliteIntensityTerm,
8
+ WholeProteomeAbundanceTerm,
8
9
  DateTerm,
9
- SsGSEATerm
10
+ SsGSEATerm,
11
+ DnaMethylationTerm,
12
+ SingleCellGeneExpressionTerm
10
13
  } from '../index.ts'
11
14
 
12
15
  export type RawRegularBin = Partial<RegularNumericBinConfig> & { preferredBins?: string }
@@ -56,7 +59,15 @@ export type RawNumericDictTerm = NumericDictTerm & {
56
59
  id?: string
57
60
  }
58
61
 
59
- export type NumericTerm = NumericDictTerm | GeneExpressionTerm | MetaboliteIntensityTerm | DateTerm | SsGSEATerm
62
+ export type NumericTerm =
63
+ | NumericDictTerm
64
+ | GeneExpressionTerm
65
+ | MetaboliteIntensityTerm
66
+ | WholeProteomeAbundanceTerm
67
+ | DateTerm
68
+ | SsGSEATerm
69
+ | DnaMethylationTerm
70
+ | SingleCellGeneExpressionTerm
60
71
 
61
72
  export type StartUnboundedBin = {
62
73
  // where possible, assign a concrete value (true) when it is known in advance,
@@ -4,7 +4,7 @@ export type SingleCellCellTypeTerm = BaseTerm & {
4
4
  type: 'singleCellCellType'
5
5
  /** the cell types may be also cell attributes like CNV, Fusion, etc */
6
6
  /** single cell terms require a sample to read the term values, they are associated with a sample */
7
- sample: string
7
+ sample: object
8
8
  /** the plot defined in the dataset contains a column with the term values for the sample, it needs to be passed to read the sample values */
9
9
  plot: string
10
10
  groupsetting: TermGroupSetting
@@ -1,26 +1,32 @@
1
- import type { TermWrapper } from './tw.ts'
2
- import type { TermSettingInstance } from '../termsetting.ts'
3
- import type { NumericTerm, NumericQ } from './numeric.ts'
1
+ // import type { BaseTerm } from '../index.ts'
2
+ import type { PresetNumericBins, NumericBaseTerm, NumTW, RawNumTW } from '../index.ts'
4
3
 
5
- /*
6
- --------EXPORTED--------
7
- GeneExpressionQ
8
- GeneExpressionTermWrapper
9
- GeneExpressionTermSettingInstance
10
-
11
- */
4
+ type Gene = {
5
+ kind?: 'gene'
6
+ gene: string
7
+ chr?: string
8
+ start?: number
9
+ stop?: number
10
+ }
12
11
 
13
- export type SingleCellGeneExpressionTW = TermWrapper & {
14
- q: NumericQ
15
- term: SingleCellGeneExpressionTerm
12
+ type Coord = {
13
+ kind?: 'coord'
14
+ gene?: string
15
+ chr: string
16
+ start: number
17
+ stop: number
16
18
  }
17
19
 
18
- export type SingleCellGeneExpressionTerm = NumericTerm & {
20
+ export type SingleCellGeneExpressionTerm = NumericBaseTerm & {
21
+ type: 'singleCellGeneExpression'
19
22
  gene: string
20
23
  sample: string
21
- }
24
+ unit: string
25
+ bins?: PresetNumericBins
26
+ } & (Gene | Coord)
22
27
 
23
- export type SingleCellGeneExpressionTermSettingInstance = TermSettingInstance & {
24
- q: NumericQ
25
- term: SingleCellGeneExpressionTerm
26
- }
28
+ export type SingleCellGeneExpressionTermTW = NumTW & { term: SingleCellGeneExpressionTerm }
29
+
30
+ export type RawSingleCellGeneExpTerm = SingleCellGeneExpressionTerm & { name?: string }
31
+
32
+ export type RawSingleCellGeneExpTW = RawNumTW & { term: RawSingleCellGeneExpTerm }