@sjcrh/proteinpaint-server 2.138.3-5 → 2.138.3-7

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.
@@ -114,10 +114,11 @@ function termdb_test_default() {
114
114
  name: "Demographics",
115
115
  plots: [
116
116
  {
117
- chartType: "barchart",
118
- settings: { barchart: { colorBars: true, showPercent: true } },
117
+ chartType: "violin",
118
+ settings: { violin: { showStats: false } },
119
119
  term: {
120
- id: "agedx"
120
+ id: "agedx",
121
+ q: { mode: "continuous" }
121
122
  }
122
123
  },
123
124
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-server",
3
- "version": "2.138.3-5",
3
+ "version": "2.138.3-7",
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",
@@ -62,9 +62,9 @@
62
62
  "@sjcrh/augen": "2.136.0",
63
63
  "@sjcrh/proteinpaint-python": "2.135.2-0",
64
64
  "@sjcrh/proteinpaint-r": "2.137.2-0",
65
- "@sjcrh/proteinpaint-rust": "2.137.2-0",
66
- "@sjcrh/proteinpaint-shared": "2.137.3",
67
- "@sjcrh/proteinpaint-types": "2.138.3-5",
65
+ "@sjcrh/proteinpaint-rust": "2.138.3-7",
66
+ "@sjcrh/proteinpaint-shared": "2.138.3-7",
67
+ "@sjcrh/proteinpaint-types": "2.138.3-7",
68
68
  "@types/express": "^5.0.0",
69
69
  "@types/express-session": "^1.18.1",
70
70
  "better-sqlite3": "^9.4.1",
@@ -265,10 +265,12 @@ function getAllowedTermTypes(ds) {
265
265
  for (const t of ds.cohort.termdb.allowedTermTypes)
266
266
  typeSet.add(t);
267
267
  }
268
- if (ds?.queries?.geneExpression)
268
+ if (ds.queries?.geneExpression)
269
269
  typeSet.add(TermTypes.GENE_EXPRESSION);
270
- if (ds?.queries?.metaboliteIntensity)
270
+ if (ds.queries?.metaboliteIntensity)
271
271
  typeSet.add(TermTypes.METABOLITE_INTENSITY);
272
+ if (ds.queries?.ssGSEA)
273
+ typeSet.add(TermTypes.SSGSEA);
272
274
  return [...typeSet];
273
275
  }
274
276
  function getSelectCohort(ds, req) {
@@ -21,34 +21,30 @@ function init({ genomes }) {
21
21
  if (!g)
22
22
  throw "invalid genome name";
23
23
  const ds = g.datasets?.[req.query.dslabel];
24
- getFilters(req.query, ds, res);
24
+ res.send(await getFilters(req.query, ds));
25
25
  } catch (e) {
26
- console.log(e);
26
+ if (e.stack)
27
+ console.log(e.stack);
27
28
  res.send({ status: "error", error: e.message || e });
28
29
  }
29
30
  };
30
31
  }
31
- async function getFilters(query, ds, res) {
32
+ async function getFilters(query, ds) {
32
33
  if (!query.filterByUserSites)
33
34
  authApi.mayAdjustFilter(query, ds, query.terms);
34
- try {
35
- const samplesPerFilter = await getSamplesPerFilter(query, ds);
36
- const filtersData = await getData(
37
- {
38
- terms: query.terms,
39
- __protected__: query.__protected__
40
- },
41
- ds
42
- );
43
- const tw2List = {};
44
- for (const tw of query.terms) {
45
- tw2List[tw.term.id] = getList(samplesPerFilter, filtersData, tw, query.showAll);
46
- }
47
- res.send({ ...tw2List });
48
- } catch (e) {
49
- console.log(e);
50
- res.send({ error: e.message || e });
35
+ const samplesPerFilter = await getSamplesPerFilter(query, ds);
36
+ const filtersData = await getData(
37
+ {
38
+ terms: query.terms,
39
+ __protected__: query.__protected__
40
+ },
41
+ ds
42
+ );
43
+ const tw2List = {};
44
+ for (const tw of query.terms) {
45
+ tw2List[tw.term.id] = getList(samplesPerFilter, filtersData, tw, query.showAll);
51
46
  }
47
+ return { ...tw2List };
52
48
  }
53
49
  function getList(samplesPerFilter, filtersData, tw, showAll) {
54
50
  const values = Object.values(tw.term.values);