@sjcrh/proteinpaint-server 2.52.0 → 2.54.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.52.0",
3
+ "version": "2.54.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",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "dev": "npm run start",
18
18
  "prestart": "tsx emitImports.js dev > server.js",
19
- "start": "tsx watch src/app.ts",
19
+ "start": "tsx watch . /start.js",
20
20
  "test:unit": "tsx emitImports.js unit > serverTests.js && tsx serverTests.js && rm -rf ./cache",
21
21
  "getconf": "../build/getConfigProp.js",
22
22
  "doc": "../augen/build.sh routes shared/types/routes shared/checkers ../public/docs/server",
@@ -5,6 +5,7 @@ import serverconfig from "#src/serverconfig.js";
5
5
  import { gdc_validate_query_geneExpression } from "#src/mds3.gdc.js";
6
6
  import { mayLimitSamples } from "#src/mds3.filter.js";
7
7
  import { dtgeneexpression } from "#shared/common.js";
8
+ import { clusterMethodLst, distanceMethodLst } from "#shared/clustering.js";
8
9
  const api = {
9
10
  endpoint: "termdb/cluster",
10
11
  methods: {
@@ -71,6 +72,10 @@ async function doClustering(data, q) {
71
72
  sampleSet.add(s);
72
73
  break;
73
74
  }
75
+ if (!clusterMethodLst.find((i) => i.value == q.clusterMethod))
76
+ throw "Invalid cluster method";
77
+ if (!distanceMethodLst.find((i) => i.value == q.distanceMethod))
78
+ throw "Invalid distance method";
74
79
  const inputData = {
75
80
  matrix: [],
76
81
  row_names: [],
@@ -78,6 +83,7 @@ async function doClustering(data, q) {
78
83
  col_names: [...sampleSet],
79
84
  // samples
80
85
  cluster_method: q.clusterMethod,
86
+ distance_method: q.distanceMethod,
81
87
  plot_image: false
82
88
  // When true causes cluster.rs to plot the image into a png file (EXPERIMENTAL)
83
89
  };