@sjcrh/proteinpaint-server 2.98.0 → 2.98.1-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-server",
3
- "version": "2.98.0",
3
+ "version": "2.98.1-0",
4
4
  "type": "module",
5
5
  "description": "a genomics visualization tool for exploring a cohort's genotype and phenotype data",
6
6
  "main": "src/app.js",
@@ -61,7 +61,7 @@
61
61
  "@sjcrh/augen": "2.87.0",
62
62
  "@sjcrh/proteinpaint-rust": "2.84.0",
63
63
  "@sjcrh/proteinpaint-shared": "2.98.0",
64
- "@sjcrh/proteinpaint-types": "2.98.0",
64
+ "@sjcrh/proteinpaint-types": "2.98.1-0",
65
65
  "better-sqlite3": "^9.4.1",
66
66
  "body-parser": "^1.15.2",
67
67
  "canvas": "~2.11.2",
@@ -27,7 +27,7 @@ function init({ genomes }) {
27
27
  if (!genome)
28
28
  throw "invalid genome";
29
29
  const [ds] = get_ds_tdb(genome, q);
30
- return make(q, res, ds, genome);
30
+ return make(q, req, res, ds, genome);
31
31
  } catch (e) {
32
32
  res.send({ error: e.message || e });
33
33
  if (e.stack)
@@ -37,13 +37,12 @@ function init({ genomes }) {
37
37
  }
38
38
  };
39
39
  }
40
- function make(q, res, ds, genome) {
40
+ function make(q, req, res, ds, genome) {
41
41
  const tdb = ds.cohort.termdb;
42
- const auth = { embedder: q.embedder };
43
42
  const c = {
44
43
  selectCohort: tdb.selectCohort,
45
44
  // optional
46
- supportedChartTypes: tdb.q?.getSupportedChartTypes(auth),
45
+ supportedChartTypes: tdb.q?.getSupportedChartTypes(req),
47
46
  renamedChartTypes: ds.cohort.renamedChartTypes,
48
47
  allowedTermTypes: getAllowedTermTypes(ds),
49
48
  termMatch2geneSet: tdb.termMatch2geneSet,
@@ -68,8 +67,6 @@ function make(q, res, ds, genome) {
68
67
  c.plotConfigByCohort = tdb.plotConfigByCohort;
69
68
  if (tdb.multipleTestingCorrection)
70
69
  c.multipleTestingCorrection = tdb.multipleTestingCorrection;
71
- if (tdb.neuroOncRegression)
72
- c.neuroOncRegression = tdb.neuroOncRegression;
73
70
  if (tdb.helpPages)
74
71
  c.helpPages = tdb.helpPages;
75
72
  if (tdb.minTimeSinceDx)
@@ -90,15 +87,19 @@ function make(q, res, ds, genome) {
90
87
  c.excludedTermtypeByTarget = tdb.excludedTermtypeByTarget;
91
88
  if (tdb.survival)
92
89
  c.survival = tdb.survival;
90
+ if (tdb.regression)
91
+ c.regression = tdb.regression;
93
92
  if (ds.assayAvailability)
94
93
  c.assayAvailability = ds.assayAvailability;
95
94
  if (ds.customTwQByType)
96
95
  c.customTwQByType = ds.customTwQByType;
97
- c.requiredAuth = authApi.getRequiredCredForDsEmbedder(q.dslabel, q.embedder);
98
96
  addRestrictAncestries(c, tdb);
99
97
  addScatterplots(c, ds);
100
98
  addMatrixplots(c, ds);
101
99
  addNonDictionaryQueries(c, ds, genome);
100
+ c.requiredAuth = authApi.getRequiredCredForDsEmbedder(q.dslabel, q.embedder);
101
+ const info = authApi.getNonsensitiveInfo(req);
102
+ c.clientAuthResult = info.clientAuthResult || {};
102
103
  res.send({ termdbConfig: c });
103
104
  }
104
105
  function addRestrictAncestries(c, tdb) {
@@ -122,7 +122,7 @@ function divideValues(q, data, sampleType) {
122
122
  key2values,
123
123
  min: absMin,
124
124
  max: absMax,
125
- uncomputableValueObj: sortObj(uncomputableValues)
125
+ uncomputableValues: sortObj(uncomputableValues)
126
126
  };
127
127
  }
128
128
  function sortObj(object) {
@@ -148,16 +148,14 @@ function setResponse(valuesObject, data, q, sampleType) {
148
148
  seriesId: key,
149
149
  plotValueCount: values?.length,
150
150
  color: overlayTerm?.term?.values?.[key]?.color || null,
151
- divideTwBins: isNumericTerm(overlayTerm.term) ? numericBins(overlayTerm, data) : null,
152
- uncomputableValueObj: Object.keys(valuesObject.uncomputableValueObj).length > 0 ? valuesObject.uncomputableValueObj : null
151
+ divideTwBins: isNumericTerm(overlayTerm.term) ? numericBins(overlayTerm, data) : null
153
152
  });
154
153
  } else {
155
- const plot = {
154
+ plots.push({
156
155
  label: sampleType,
157
156
  values,
158
157
  plotValueCount: values.length
159
- };
160
- plots.push(plot);
158
+ });
161
159
  }
162
160
  }
163
161
  const result = {
@@ -165,7 +163,7 @@ function setResponse(valuesObject, data, q, sampleType) {
165
163
  max: valuesObject.max,
166
164
  plots,
167
165
  pvalues: [],
168
- uncomputableValueObj: Object.keys(valuesObject.uncomputableValueObj).length > 0 ? valuesObject.uncomputableValueObj : null
166
+ uncomputableValues: Object.keys(valuesObject.uncomputableValues).length > 0 ? valuesObject.uncomputableValues : null
169
167
  };
170
168
  return result;
171
169
  }
@@ -222,9 +220,8 @@ function createCanvasImg(q, result, ds) {
222
220
  ctx.stroke();
223
221
  });
224
222
  plot.src = canvas.toDataURL();
225
- const isKDE = q.isKDE;
226
- plot.density = getBinsDensity(axisScale, plot, isKDE, q.ticks);
227
- plot.summaryStats = summaryStats(plot.values);
223
+ plot.density = getBinsDensity(axisScale, plot, q.isKDE, q.ticks);
224
+ plot.summaryStats = summaryStats(plot.values).values;
228
225
  delete plot.values;
229
226
  }
230
227
  }