@sjcrh/proteinpaint-server 2.148.1 → 2.149.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.148.1",
3
+ "version": "2.149.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",
@@ -62,10 +62,10 @@
62
62
  "dependencies": {
63
63
  "@sjcrh/augen": "2.143.0",
64
64
  "@sjcrh/proteinpaint-python": "2.146.0",
65
- "@sjcrh/proteinpaint-r": "2.146.4-0",
66
- "@sjcrh/proteinpaint-rust": "2.148.1",
67
- "@sjcrh/proteinpaint-shared": "2.147.1",
68
- "@sjcrh/proteinpaint-types": "2.148.1",
65
+ "@sjcrh/proteinpaint-r": "2.149.0",
66
+ "@sjcrh/proteinpaint-rust": "2.149.0",
67
+ "@sjcrh/proteinpaint-shared": "2.149.0",
68
+ "@sjcrh/proteinpaint-types": "2.149.0",
69
69
  "@types/express": "^5.0.0",
70
70
  "@types/express-session": "^1.18.1",
71
71
  "better-sqlite3": "^9.4.1",
@@ -182,6 +182,7 @@ async function run_DE(param, ds, term_results, term_results2) {
182
182
  cachedir: serverconfig.cachedir,
183
183
  min_count: param.min_count,
184
184
  min_total_count: param.min_total_count,
185
+ cpm_cutoff: param.cpm_cutoff,
185
186
  storage_type: param.storage_type,
186
187
  DE_method: param.method,
187
188
  mds_cutoff: 1e4
@@ -217,13 +218,17 @@ async function run_DE(param, ds, term_results, term_results2) {
217
218
  }
218
219
  const images = [result2.ql_image];
219
220
  if (result2.mds_image) images.push(result2.mds_image);
220
- return {
221
+ const output = {
221
222
  data: result2.gene_data,
222
223
  sample_size2: result2.num_cases[0],
223
224
  sample_size1: result2.num_controls[0],
224
225
  method: param.method,
225
226
  images
226
227
  };
228
+ if (result2.bcv && result2.bcv[0] !== null && result2.bcv[0] !== void 0) {
229
+ output.bcv = result2.bcv[0];
230
+ }
231
+ return output;
227
232
  }
228
233
  const time1 = (/* @__PURE__ */ new Date()).valueOf();
229
234
  const result = JSON.parse(await run_rust("DEanalysis", JSON.stringify(expression_input)));
@@ -66,7 +66,7 @@ function getDescrStats(values, showOutlierRange = false) {
66
66
  if (!values.length) {
67
67
  return {};
68
68
  }
69
- if (values.some((v) => !Number.isFinite(v))) throw "non-numeric values found";
69
+ if (values.some((v) => !Number.isFinite(v))) throw new Error("non-numeric values found");
70
70
  const sorted_arr = values.sort((a, b) => a - b);
71
71
  const n = sorted_arr.length;
72
72
  const median = computePercentile(sorted_arr, 50, true);
@@ -56,6 +56,8 @@ async function getViolin(q, ds) {
56
56
  },
57
57
  ds
58
58
  );
59
+ if (!data) throw "getData() returns nothing";
60
+ if (data.error) throw data.error;
59
61
  const samples = Object.values(data.samples);
60
62
  let values = samples.map((s) => s?.[q.tw.$id]?.value).filter((v) => typeof v === "number" && !q.tw.term.values?.[v]?.uncomputable);
61
63
  if (q.unit == "log") values = values.filter((v) => v > 0);
@@ -50,7 +50,8 @@ function init({ genomes }) {
50
50
  status: "ok",
51
51
  wsiSessionId: session.imageSessionId,
52
52
  overlays: session.overlays,
53
- slide_dimensions: getWsiImageResponse.slide_dimensions
53
+ slide_dimensions: getWsiImageResponse.slide_dimensions,
54
+ mpp: getWsiImageResponse.mpp
54
55
  };
55
56
  res.status(200).json(payload);
56
57
  } catch (e) {