@sjcrh/proteinpaint-server 2.157.0 → 2.158.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.157.0",
3
+ "version": "2.158.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,16 +61,16 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@sjcrh/augen": "2.143.0",
64
- "@sjcrh/proteinpaint-python": "2.157.0",
64
+ "@sjcrh/proteinpaint-python": "2.158.0",
65
65
  "@sjcrh/proteinpaint-r": "2.152.1-0",
66
66
  "@sjcrh/proteinpaint-rust": "2.157.0",
67
67
  "@sjcrh/proteinpaint-shared": "2.157.0",
68
- "@sjcrh/proteinpaint-types": "2.157.0",
68
+ "@sjcrh/proteinpaint-types": "2.158.0",
69
69
  "@types/express": "^5.0.0",
70
70
  "@types/express-session": "^1.18.1",
71
71
  "better-sqlite3": "^12.4.1",
72
72
  "body-parser": "^1.15.2",
73
- "canvas": "~3.1.2",
73
+ "canvas": "~3.2.0",
74
74
  "compression": "^1.6.2",
75
75
  "connect-redis": "^6.1.3",
76
76
  "cookie-parser": "^1.4.5",
@@ -80,7 +80,7 @@
80
80
  "express-basic-auth": "^1.1.5",
81
81
  "express-session": "^1.18.1",
82
82
  "got": "^14.2.0",
83
- "image-size": "^0.5.5",
83
+ "image-size": "^0.9.7",
84
84
  "jsonwebtoken": "^9.0.0",
85
85
  "ky": "^1.2.1",
86
86
  "micromatch": "^4.0.5",
package/routes/grin2.js CHANGED
@@ -118,7 +118,9 @@ async function runGrin2(g, ds, request) {
118
118
  plot_width: request.width,
119
119
  plot_height: request.height,
120
120
  device_pixel_ratio: request.devicePixelRatio,
121
- png_dot_radius: request.pngDotRadius
121
+ png_dot_radius: request.pngDotRadius,
122
+ lesion_type_colors: request.lesionTypeColors,
123
+ q_value_threshold: request.qValueThreshold
122
124
  };
123
125
  const manhattanPlotStart = Date.now();
124
126
  const rsResult = await run_rust("manhattan_plot", JSON.stringify(rustInput));
package/routes/img.js CHANGED
@@ -2,7 +2,7 @@ import { imgPayload } from "#types/checkers";
2
2
  import path from "path";
3
3
  import fs from "fs";
4
4
  import * as utils from "../src/utils.js";
5
- import imagesize from "image-size";
5
+ import { imageSize } from "image-size";
6
6
  const api = {
7
7
  endpoint: "img",
8
8
  methods: {
@@ -31,9 +31,10 @@ async function sendImage(req, res) {
31
31
  if (e) throw "invalid image file";
32
32
  const data = await fs.promises.readFile(file);
33
33
  const ext = path.extname(file).substring(1);
34
+ const { width, height } = imageSize(file);
34
35
  const image = {
35
36
  src: `data:image/${ext};base64,${Buffer.from(data).toString("base64")}`,
36
- size: imagesize(file)
37
+ size: `${width}x${height}`
37
38
  };
38
39
  res.send({ ...image });
39
40
  } catch (e2) {
@@ -7,7 +7,7 @@ import { get_ds_tdb } from "../src/termdb.js";
7
7
  import { run_R } from "@sjcrh/proteinpaint-r";
8
8
  import { mayLog } from "#src/helpers.ts";
9
9
  import serverconfig from "../src/serverconfig.js";
10
- import imagesize from "image-size";
10
+ import { imageSize } from "image-size";
11
11
  import { get_header_txt } from "#src/utils.js";
12
12
  import { formatElapsedTime } from "@sjcrh/proteinpaint-shared/time.js";
13
13
  const api = {
@@ -254,9 +254,10 @@ function validateGroups(sample_size1, sample_size2, group1names, group2names) {
254
254
  async function readFileAndDelete(file, key, response) {
255
255
  const plot = await fs.promises.readFile(file);
256
256
  const plotBuffer = Buffer.from(plot).toString("base64");
257
+ const { width, height } = imageSize(file);
257
258
  const obj = {
258
259
  src: `data:image/png;base64,${plotBuffer}`,
259
- size: imagesize(file),
260
+ size: `${width}x${height}`,
260
261
  key
261
262
  };
262
263
  response[key] = obj;
@@ -77,7 +77,15 @@ async function getWSImagePath(ds, wSImagesRequest) {
77
77
  }
78
78
  async function getSessionId(ds, cookieJar, getCookieString, setCookie, wsimage, projectId) {
79
79
  const sessionManager = SessionManager.getInstance();
80
- const invalidateResult = await sessionManager.syncAndInvalidateSessions(wsimage);
80
+ const maxSessions = serverconfig.features?.tileserver?.maxSessions;
81
+ const maxIdleTime = serverconfig.features?.tileserver?.maxIdleTime;
82
+ const invalidationThreshold = serverconfig.features?.tileserver?.invalidationThreshold;
83
+ const invalidateResult = await sessionManager.syncAndInvalidateSessions(
84
+ wsimage,
85
+ maxSessions,
86
+ maxIdleTime,
87
+ invalidationThreshold
88
+ );
81
89
  if (!invalidateResult) throw new Error("Session invalidation failed");
82
90
  const session = await sessionManager.getSession(wsimage);
83
91
  if (session) {