@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
package/src/terms/term.ts CHANGED
@@ -47,7 +47,7 @@ export type BaseTerm = {
47
47
  }
48
48
  }
49
49
 
50
- // NumericTerm includes integer, float, date, geneExpression, metaboliteIntensity, and other non-dict terms
50
+ // NumericTerm includes integer, float, date, geneExpression, metaboliteIntensity, wholeProteomeAbundance, and other non-dict terms
51
51
  export type Term = BaseTerm &
52
52
  (NumericTerm | ConditionTerm | SampleLstTerm | SnpsTerm | GvTerm | QualTerm | TermCollection)
53
53
 
@@ -1,17 +1,20 @@
1
1
  import type { BaseTerm, BaseTW, MinBaseQ } from '../index.ts'
2
2
 
3
3
  /*
4
- For term type 'snp'
4
+ For term type 'termCollection'
5
5
  */
6
+ export type CategoryKey = { key: string; shown: boolean }
6
7
 
7
- export type TermCollection = BaseTerm & {
8
+ type BaseTermCollection = BaseTerm & {
8
9
  name: string
9
10
  collectionId?: string
10
11
  type: 'termCollection'
11
- // may be queried from backend, but should be available in frontend for termsetting edit menu
12
- /** the full list of term.ids that are available in this collection */
12
+ /** list of term.ids that are available in this collection. this is used in request payload and server side */
13
+ termIds?: string[]
14
+ /** list of term objs corresponding to termIds[].
15
+ this is generated on server init, and sent to client, so client has easy access to show name of every term */
13
16
  termlst: BaseTerm[]
14
- numerators?: string[]
17
+ /** TODO purpose */
15
18
  newTvs?: boolean
16
19
  propsByTermId: {
17
20
  [termId: string]: {
@@ -20,42 +23,111 @@ export type TermCollection = BaseTerm & {
20
23
  }
21
24
  }
22
25
 
23
- export type RawTermCollection = TermCollection & {
26
+ export type NumericTermCollection = BaseTermCollection & {
27
+ /**
28
+ * Copies ds.cohort.termdb.termCollections[].type ('numeric' | 'categorical').
29
+ * Allows client code using the term to know the collection kind without looking up config.
30
+ */
31
+ memberType: 'numeric'
32
+ /** the sum of numerator values will be divided by the sum of values for all terms,
33
+ * to be used for sorting matrix sample columns */
34
+ numerators?: string[]
35
+ }
36
+
37
+ export type CategoricalTermCollection = BaseTermCollection & {
38
+ /**
39
+ * Copies ds.cohort.termdb.termCollections[].type ('numeric' | 'categorical').
40
+ * Allows client code using the term to know the collection kind without looking up config.
41
+ */
42
+ memberType: 'categorical'
43
+ categoryKeys: CategoryKey[]
44
+ }
45
+
46
+ export type TermCollection = NumericTermCollection | CategoricalTermCollection
47
+
48
+ /** Pre-fill shape for a numeric termCollection (memberType set by TermCollection.fill()) */
49
+ export type RawNumericTermCollection = {
24
50
  type?: 'termCollection'
25
- termlst: BaseTerm[]
51
+ memberType?: 'numeric'
52
+ name?: string
53
+ collectionId?: string
54
+ termIds?: string[]
55
+ termlst?: BaseTerm[]
26
56
  propsByTermId?: {
27
57
  [termId: string]: {
28
58
  [prop: string]: any
29
59
  }
30
60
  }
61
+ numerators?: string[]
31
62
  }
32
63
 
33
- export type TermCollectionQValues = MinBaseQ & {
34
- mode: 'continuous' // | 'discrete'
64
+ /** Pre-fill shape for a categorical termCollection (memberType set by TermCollection.fill()) */
65
+ export type RawCategoricalTermCollection = {
66
+ type?: 'termCollection'
67
+ memberType?: 'categorical'
68
+ name?: string
69
+ collectionId?: string
70
+ termIds?: string[]
71
+ termlst?: BaseTerm[]
72
+ propsByTermId?: {
73
+ [termId: string]: {
74
+ [prop: string]: any
75
+ }
76
+ }
77
+ categoryKeys?: CategoryKey[]
78
+ }
79
+
80
+ export type RawTermCollection = RawNumericTermCollection | RawCategoricalTermCollection
81
+
82
+ /** Q shape for numeric (continuous) termCollection wrappers */
83
+ export type TermCollectionQCont = MinBaseQ & {
84
+ mode: 'continuous'
35
85
  type: 'values'
36
- // groupValuesBy: 'sampleId' | 'termId'
37
86
  /** a selection of term.ids for the current termwrapper, selected from term.lst */
38
87
  lst: string[]
88
+ /** the sum of numerator values divided by the sum of all values will be used
89
+ * to sort matrix sample columns */
39
90
  numerators?: string[]
40
91
  }
41
92
 
93
+ /** Q shape for categorical (qualitative) termCollection wrappers */
94
+ export type TermCollectionQQual = MinBaseQ & {
95
+ mode: 'discrete'
96
+ type: 'values'
97
+ /** a selection of term.ids for the current termwrapper, selected from term.lst */
98
+ lst: string[]
99
+ categoryKeys?: CategoryKey[]
100
+ }
101
+
42
102
  // TODO: may add different q types below
43
- export type TermCollectionQ = TermCollectionQValues
103
+ export type TermCollectionQ = TermCollectionQCont | TermCollectionQQual
44
104
 
45
- export type TermCollectionTWValues = BaseTW & {
46
- type: 'TermCollectionTWValues'
47
- term: TermCollection
48
- q: TermCollectionQValues
105
+ export type TermCollectionTWCont = BaseTW & {
106
+ type: 'TermCollectionTWCont'
107
+ term: NumericTermCollection
108
+ q: TermCollectionQCont
109
+ }
110
+
111
+ export type TermCollectionTWQual = BaseTW & {
112
+ type: 'TermCollectionTWQual'
113
+ term: CategoricalTermCollection
114
+ q: TermCollectionQQual
49
115
  }
50
116
 
51
117
  // TODO: may add different termCollection TW types here
52
- export type TermCollectionTW = TermCollectionTWValues
118
+ export type TermCollectionTW = TermCollectionTWCont | TermCollectionTWQual
119
+
120
+ export type RawTermCollectionTWCont = {
121
+ type?: 'TermCollectionTWCont'
122
+ term: RawNumericTermCollection
123
+ q?: TermCollectionQCont
124
+ }
53
125
 
54
- export type RawTermCollectionTWValues = /*TermCollectionTW &*/ {
55
- type?: 'TermCollectionTWValues' | 'termCollection' // deprecated
56
- term: RawTermCollection
57
- q: TermCollectionQValues
126
+ export type RawTermCollectionTWQual = {
127
+ type?: 'TermCollectionTWQual'
128
+ term: RawCategoricalTermCollection
129
+ q?: TermCollectionQQual
58
130
  }
59
131
 
60
132
  // TODO: may add different termCollection TW types here
61
- export type RawTermCollectionTW = RawTermCollectionTWValues
133
+ export type RawTermCollectionTW = RawTermCollectionTWCont | RawTermCollectionTWQual
@@ -0,0 +1,30 @@
1
+ import type { NumericBaseTerm, PresetNumericBins, NumTW, RawNumTW } from '../index.ts'
2
+
3
+ /*
4
+ --------EXPORTED--------
5
+ ProteomeTermWrapper
6
+ ProteomeTermSettingInstance
7
+
8
+ */
9
+
10
+ export type WholeProteomeAbundanceTerm = NumericBaseTerm & {
11
+ id?: string
12
+ name: string
13
+ type: 'wholeProteomeAbundance'
14
+ protein: string
15
+ bins?: PresetNumericBins
16
+ unit?: string
17
+ }
18
+
19
+ export type WholeProteomeAbundanceTW = NumTW & { term: WholeProteomeAbundanceTerm }
20
+
21
+ export type RawWholeProteomeAbundanceTerm = NumericBaseTerm & {
22
+ id?: string
23
+ type: 'wholeProteomeAbundance'
24
+ protein: string
25
+ name?: string
26
+ bins?: PresetNumericBins
27
+ unit?: string
28
+ }
29
+
30
+ export type RawWholeProteomeAbundanceTW = RawNumTW & { term: RawWholeProteomeAbundanceTerm }