@sjcrh/proteinpaint-server 2.88.0 → 2.88.2

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.88.0",
3
+ "version": "2.88.2",
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",
@@ -60,8 +60,8 @@
60
60
  "dependencies": {
61
61
  "@sjcrh/augen": "2.87.0",
62
62
  "@sjcrh/proteinpaint-rust": "2.84.0",
63
- "@sjcrh/proteinpaint-shared": "2.87.1",
64
- "@sjcrh/proteinpaint-types": "2.88.0",
63
+ "@sjcrh/proteinpaint-shared": "2.88.2",
64
+ "@sjcrh/proteinpaint-types": "2.88.2",
65
65
  "better-sqlite3": "^9.4.1",
66
66
  "body-parser": "^1.15.2",
67
67
  "canvas": "~2.11.2",
@@ -159,15 +159,15 @@ function setDescrStats(boxplot, sortedValues) {
159
159
  const variance = squareDiffs / (sortedValues.length - 1);
160
160
  return [
161
161
  { id: "total", label: "Total", value: sortedValues.length },
162
- { id: "min", label: "Minimum", value: roundValueAuto(sortedValues[0]) },
163
- { id: "p25", label: "1st quartile", value: roundValueAuto(boxplot.p25) },
164
- { id: "median", label: "Median", value: roundValueAuto(boxplot.p50) },
165
- { id: "mean", label: "Mean", value: roundValueAuto(mean) },
166
- { id: "p75", label: "3rd quartile", value: roundValueAuto(boxplot.p75) },
167
- { id: "max", label: "Maximum", value: roundValueAuto(sortedValues[sortedValues.length - 1]) },
168
- { id: "sd", label: "Standard deviation", value: isNaN(sd) ? null : roundValueAuto(sd) },
169
- { id: "variance", label: "Variance", value: roundValueAuto(variance) },
170
- { id: "iqr", label: "Inter-quartile range", value: roundValueAuto(boxplot.iqr) }
162
+ { id: "min", label: "Minimum", value: roundValueAuto(sortedValues[0], true) },
163
+ { id: "p25", label: "1st quartile", value: roundValueAuto(boxplot.p25, true) },
164
+ { id: "median", label: "Median", value: roundValueAuto(boxplot.p50, true) },
165
+ { id: "mean", label: "Mean", value: roundValueAuto(mean, true) },
166
+ { id: "p75", label: "3rd quartile", value: roundValueAuto(boxplot.p75, true) },
167
+ { id: "max", label: "Maximum", value: roundValueAuto(sortedValues[sortedValues.length - 1], true) },
168
+ { id: "sd", label: "Standard deviation", value: isNaN(sd) ? null : roundValueAuto(sd, true) },
169
+ { id: "variance", label: "Variance", value: roundValueAuto(variance, true) },
170
+ { id: "iqr", label: "Inter-quartile range", value: roundValueAuto(boxplot.iqr, true) }
171
171
  ];
172
172
  }
173
173
  function setUncomputableValues(values) {
@@ -2,7 +2,7 @@ import fs from "fs";
2
2
  import path from "path";
3
3
  import { read_file } from "#src/utils.js";
4
4
  import run_R from "#src/run_R.js";
5
- import { joinUrl } from "#src/helpers.ts";
5
+ import { joinUrl, mayLog } from "#src/helpers.ts";
6
6
  import { run_rust } from "@sjcrh/proteinpaint-rust";
7
7
  import serverconfig from "#src/serverconfig.js";
8
8
  import { termdbSingleCellSamplesPayload } from "#types/checkers";
@@ -227,7 +227,6 @@ function gdc_validateGeneExpression(G, ds, genome) {
227
227
  G.sample2gene2expressionBins = {};
228
228
  G.get = async (q) => {
229
229
  try {
230
- const uuid = ds.__gdc.map2caseid.get(q.sample.sID);
231
230
  const fileid = q.sample.eID;
232
231
  const hdf5id = ds.__gdc.scrnaAnalysis2hdf5.get(fileid);
233
232
  if (!hdf5id)
@@ -241,7 +240,12 @@ function gdc_validateGeneExpression(G, ds, genome) {
241
240
  file_id: hdf5id
242
241
  };
243
242
  const { host } = ds.getHostHeaders(q);
244
- const out = await ky.post(joinUrl(host.rest, "scrna_seq/gene_expression"), { timeout: false, json: body }).json();
243
+ const t = Date.now();
244
+ const response = await ky.post(joinUrl(host.rest, "scrna_seq/gene_expression"), { timeout: false, json: body });
245
+ if (!response.ok)
246
+ throw `HTTP Error: ${response.status} ${response.statusText}`;
247
+ const out = await response.json();
248
+ mayLog("gdc scrna gene exp", q.gene, Date.now() - t);
245
249
  const result = out.data[0].cells;
246
250
  const data = {};
247
251
  for (const r of result) {