@sjcrh/proteinpaint-server 2.189.0 → 2.190.1

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.
Files changed (82) hide show
  1. package/package.json +9 -12
  2. package/routes/aiProjectAdmin.js +2 -28
  3. package/routes/aiProjectSelectedWSImages.js +2 -16
  4. package/routes/brainImaging.js +1 -15
  5. package/routes/brainImagingSamples.js +1 -15
  6. package/routes/burden.js +1 -15
  7. package/routes/correlationVolcano.js +1 -15
  8. package/routes/dataset.js +1 -16
  9. package/routes/deleteWSITileSelection.js +2 -12
  10. package/routes/dsdata.js +1 -19
  11. package/routes/gdc.grin2.list.js +1 -15
  12. package/routes/gdc.grin2.run.js +1 -15
  13. package/routes/gdc.maf.js +1 -15
  14. package/routes/gdc.mafBuild.js +1 -15
  15. package/routes/genesetEnrichment.js +129 -97
  16. package/routes/grin2.js +110 -79
  17. package/routes/saveWSIAnnotation.js +2 -13
  18. package/routes/termdb.DE.js +137 -54
  19. package/routes/termdb.categories.js +2 -16
  20. package/routes/termdb.chat.js +169 -1076
  21. package/routes/termdb.cluster.js +5 -16
  22. package/routes/termdb.config.js +12 -17
  23. package/routes/termdb.descrstats.js +2 -16
  24. package/routes/termdb.diffMeth.js +100 -21
  25. package/routes/termdb.geneRanking.js +139 -0
  26. package/routes/termdb.proteome.js +1 -15
  27. package/routes/termdb.runChart.js +16 -30
  28. package/routes/termdb.sampleScatter.js +7 -97
  29. package/routes/termdb.singleCellPlots.js +159 -0
  30. package/routes/termdb.singlecellSamples.js +6 -16
  31. package/routes/termdb.violinBox.js +1 -15
  32. package/routes/wsimages.js +1 -16
  33. package/src/app.js +4028 -4116
  34. package/routes/_template_.js +0 -33
  35. package/routes/aiProjectTrainModel.js +0 -68
  36. package/routes/alphaGenome.js +0 -41
  37. package/routes/alphaGenomeTypes.js +0 -36
  38. package/routes/dzimages.js +0 -55
  39. package/routes/gene2canonicalisoform.js +0 -37
  40. package/routes/genelookup.js +0 -32
  41. package/routes/genesetOverrepresentation.js +0 -49
  42. package/routes/genomes.js +0 -150
  43. package/routes/healthcheck.js +0 -35
  44. package/routes/hicdata.js +0 -74
  45. package/routes/hicgenome.js +0 -75
  46. package/routes/hicstat.js +0 -35
  47. package/routes/img.js +0 -46
  48. package/routes/isoformlst.js +0 -48
  49. package/routes/ntseq.js +0 -36
  50. package/routes/pdomain.js +0 -53
  51. package/routes/profile.barchart2.js +0 -114
  52. package/routes/profile.forms2.js +0 -107
  53. package/routes/profile.polar2.js +0 -101
  54. package/routes/profile.radar2.js +0 -112
  55. package/routes/profile.radarFacility2.js +0 -148
  56. package/routes/sampledzimages.js +0 -48
  57. package/routes/samplewsimages.js +0 -60
  58. package/routes/snp.js +0 -98
  59. package/routes/termdb.chat2.js +0 -217
  60. package/routes/termdb.chat3.js +0 -209
  61. package/routes/termdb.cohort.summary.js +0 -37
  62. package/routes/termdb.cohorts.js +0 -41
  63. package/routes/termdb.dapVolcano.js +0 -80
  64. package/routes/termdb.dmr.js +0 -93
  65. package/routes/termdb.filterTermValues.js +0 -89
  66. package/routes/termdb.isoformAvailability.js +0 -35
  67. package/routes/termdb.numericcategories.js +0 -46
  68. package/routes/termdb.percentile.js +0 -66
  69. package/routes/termdb.profileFormScores.js +0 -92
  70. package/routes/termdb.profileScores.js +0 -113
  71. package/routes/termdb.rootterm.js +0 -39
  72. package/routes/termdb.sampleImages.js +0 -63
  73. package/routes/termdb.singleSampleMutation.js +0 -75
  74. package/routes/termdb.singlecellDEgenes.js +0 -55
  75. package/routes/termdb.singlecellData.js +0 -39
  76. package/routes/termdb.termchildren.js +0 -42
  77. package/routes/termdb.termsbyids.js +0 -50
  78. package/routes/termdb.topMutatedGenes.js +0 -127
  79. package/routes/termdb.topTermsByType.js +0 -96
  80. package/routes/termdb.topVariablyExpressedGenes.js +0 -132
  81. package/routes/tileserver.js +0 -68
  82. package/routes/wsisamples.js +0 -71
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-server",
3
- "version": "2.189.0",
3
+ "version": "2.190.1",
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",
@@ -8,17 +8,16 @@
8
8
  "bin": "start.js",
9
9
  "imports": {
10
10
  "#types": "@sjcrh/proteinpaint-types",
11
- "#types/checkers": "@sjcrh/proteinpaint-types/checkers",
12
11
  "#shared": "@sjcrh/proteinpaint-shared",
13
12
  "#shared/*": "@sjcrh/proteinpaint-shared/*",
14
13
  "#src/*": "./src/*",
15
- "#routes/*": "./routes/*"
14
+ "#routes/*": "./src/routes/*"
16
15
  },
17
16
  "scripts": {
18
17
  "dev": "npm run start",
19
18
  "prestart": "tsx emitImports.js dev > server.js",
20
19
  "start": "tsx watch ./start.js",
21
- "test:unit": "tsx emitImports.js unit > serverTests.js && c8 tsx serverTests.js && rm -rf ./cache",
20
+ "test:unit": "tsx emitImports.js unit > serverTests.js && c8 tsx --conditions=sjpp/dev serverTests.js && rm -rf ./cache",
22
21
  "test": "tsc && npm run test:unit",
23
22
  "precombined:coverage": "tsx emitImports.js unit > serverTests.js",
24
23
  "combined:coverage": "coverageKey=test c8 --all --src=proteinpaint/server --experimental-monocart -r=v8 -r=html -r=json -r=markdown-summary -r=markdown-details -o=./.coverage tsx ./coverage.js & ",
@@ -55,18 +54,16 @@
55
54
  "nodemon": "^3.1.10",
56
55
  "prettier": "^2.8.8",
57
56
  "tape": "^5.2.2",
58
- "ts-node": "^10.9.1",
59
- "ts-patch": "^3.0.2",
60
57
  "tsx": "^4.7.1",
61
58
  "typescript": "^5.6.3"
62
59
  },
63
60
  "dependencies": {
64
- "@sjcrh/augen": "2.181.1",
65
- "@sjcrh/proteinpaint-python": "2.188.0",
66
- "@sjcrh/proteinpaint-r": "2.188.0",
67
- "@sjcrh/proteinpaint-rust": "2.189.0",
68
- "@sjcrh/proteinpaint-shared": "2.189.0",
69
- "@sjcrh/proteinpaint-types": "2.189.0",
61
+ "@sjcrh/augen": "2.190.0",
62
+ "@sjcrh/proteinpaint-python": "2.190.0",
63
+ "@sjcrh/proteinpaint-r": "2.190.0",
64
+ "@sjcrh/proteinpaint-rust": "2.190.0",
65
+ "@sjcrh/proteinpaint-shared": "2.190.1",
66
+ "@sjcrh/proteinpaint-types": "2.190.1",
70
67
  "@types/express": "^5.0.0",
71
68
  "@types/express-session": "^1.18.1",
72
69
  "better-sqlite3": "^12.4.1",
@@ -1,31 +1,5 @@
1
- import { aiProjectAdminPayload } from "#types/checkers";
2
1
  import { getDbConnection } from "#src/aiHistoDBConnection.ts";
3
2
  import { runMultiStmtSQL, runSQL } from "#src/runSQLHelpers.ts";
4
- const api = {
5
- endpoint: "aiProjectAdmin",
6
- methods: {
7
- get: {
8
- //all requests
9
- ...aiProjectAdminPayload,
10
- init
11
- },
12
- post: {
13
- //'admin' -> edit
14
- ...aiProjectAdminPayload,
15
- init
16
- },
17
- delete: {
18
- //'admin' -> delete
19
- ...aiProjectAdminPayload,
20
- init
21
- },
22
- put: {
23
- //'admin' -> add
24
- ...aiProjectAdminPayload,
25
- init
26
- }
27
- }
28
- };
29
3
  function init({ genomes }) {
30
4
  return async (req, res) => {
31
5
  try {
@@ -173,6 +147,6 @@ function addProject(connection, project) {
173
147
  runMultiStmtSQL(connection, [{ sql: classSql, params: classParams }], "add");
174
148
  }
175
149
  export {
176
- api,
177
- getImages
150
+ getImages,
151
+ init
178
152
  };
@@ -1,19 +1,5 @@
1
- import { aiProjectSelectedWSImagesResponsePayload } from "#types/checkers";
2
- import { createSelectionID, SelectionPrefixes, FlagStatus } from "#shared";
1
+ import { createSelectionID, SelectionPrefixes, FlagStatus } from "#types";
3
2
  import { getDbConnection } from "#src/aiHistoDBConnection.ts";
4
- const api = {
5
- endpoint: "aiProjectSelectedWSImages",
6
- methods: {
7
- get: {
8
- ...aiProjectSelectedWSImagesResponsePayload,
9
- init
10
- },
11
- post: {
12
- ...aiProjectSelectedWSImagesResponsePayload,
13
- init
14
- }
15
- }
16
- };
17
3
  function init({ genomes }) {
18
4
  return async (req, res) => {
19
5
  try {
@@ -243,7 +229,7 @@ function validateWSIClassesQuery(ds, connection) {
243
229
  };
244
230
  }
245
231
  export {
246
- api,
232
+ init,
247
233
  validateWSIAnnotationsQuery,
248
234
  validateWSIClassesQuery,
249
235
  validate_query_getWSIAnnotations,
@@ -1,23 +1,9 @@
1
1
  import path from "path";
2
2
  import serverconfig from "#src/serverconfig.js";
3
- import { brainImagingPayload } from "#types/checkers";
4
3
  import { getData } from "../src/termdb.matrix.js";
5
4
  import { isNumericTerm } from "#shared";
6
5
  import { getColors } from "#shared";
7
6
  import { run_python } from "@sjcrh/proteinpaint-python";
8
- const api = {
9
- endpoint: "brainImaging",
10
- methods: {
11
- get: {
12
- ...brainImagingPayload,
13
- init
14
- },
15
- post: {
16
- ...brainImagingPayload,
17
- init
18
- }
19
- }
20
- };
21
7
  function init({ genomes }) {
22
8
  return async (req, res) => {
23
9
  try {
@@ -146,5 +132,5 @@ async function getBrainImage(query, genomes, plane, index) {
146
132
  }
147
133
  }
148
134
  export {
149
- api
135
+ init
150
136
  };
@@ -2,20 +2,6 @@ import fs from "fs";
2
2
  import path from "path";
3
3
  import serverconfig from "#src/serverconfig.js";
4
4
  import { getData } from "#src/termdb.matrix.js";
5
- const api = {
6
- endpoint: "brainImagingSamples",
7
- methods: {
8
- get: {
9
- init,
10
- request: {
11
- typeId: "BrainImagingSamplesRequest"
12
- },
13
- response: {
14
- typeId: "BrainImagingSamplesResponse"
15
- }
16
- }
17
- }
18
- };
19
5
  function init({ genomes }) {
20
6
  return async (req, res) => {
21
7
  try {
@@ -71,5 +57,5 @@ async function getBrainImageSamples(query, genomes) {
71
57
  }
72
58
  }
73
59
  export {
74
- api
60
+ init
75
61
  };
package/routes/burden.js CHANGED
@@ -1,20 +1,6 @@
1
- import { burdenPayload } from "#types/checkers";
2
1
  import { run_R } from "@sjcrh/proteinpaint-r";
3
2
  import path from "path";
4
3
  import serverconfig from "#src/serverconfig.js";
5
- const api = {
6
- endpoint: "burden",
7
- methods: {
8
- get: {
9
- init,
10
- ...burdenPayload
11
- },
12
- post: {
13
- init,
14
- ...burdenPayload
15
- }
16
- }
17
- };
18
4
  function init({ genomes }) {
19
5
  return async function handler(req, res) {
20
6
  try {
@@ -155,5 +141,5 @@ const defaultInputValues = Object.freeze({
155
141
  abd: 2.4
156
142
  });
157
143
  export {
158
- api
144
+ init
159
145
  };
@@ -1,22 +1,8 @@
1
- import { CorrelationVolcanoPayload } from "#types/checkers";
2
1
  import { getData } from "../src/termdb.matrix.js";
3
2
  import { run_R } from "@sjcrh/proteinpaint-r";
4
3
  import { mayLog } from "#src/helpers.ts";
5
4
  import { getStdDev } from "./termdb.descrstats.ts";
6
5
  const minArrayLength = 3;
7
- const api = {
8
- endpoint: "termdb/correlationVolcano",
9
- methods: {
10
- get: {
11
- ...CorrelationVolcanoPayload,
12
- init
13
- },
14
- post: {
15
- ...CorrelationVolcanoPayload,
16
- init
17
- }
18
- }
19
- };
20
6
  function init({ genomes }) {
21
7
  return async (req, res) => {
22
8
  const q = req.query;
@@ -121,6 +107,6 @@ function validate_correlationVolcano(ds) {
121
107
  }
122
108
  }
123
109
  export {
124
- api,
110
+ init,
125
111
  validate_correlationVolcano
126
112
  };
package/routes/dataset.js CHANGED
@@ -1,20 +1,5 @@
1
1
  import * as mds3_init from "#src/mds3.init.js";
2
2
  import * as common from "#shared/common.js";
3
- import { datasetPayload } from "#types/checkers";
4
- const api = {
5
- endpoint: "getDataset",
6
- // should rename to simply 'dataset', method is based on HTTP method
7
- methods: {
8
- get: {
9
- init,
10
- ...datasetPayload
11
- },
12
- post: {
13
- init,
14
- ...datasetPayload
15
- }
16
- }
17
- };
18
3
  function init({ genomes }) {
19
4
  return function(req, res) {
20
5
  try {
@@ -244,5 +229,5 @@ function copy_legacyDataset(ds) {
244
229
  return ds2;
245
230
  }
246
231
  export {
247
- api
232
+ init
248
233
  };
@@ -1,15 +1,5 @@
1
- import { deleteWSITileSelectionPayload } from "#types/checkers";
2
- import { checkSelectionType, SelectionPrefixes, FlagStatus } from "#shared";
1
+ import { checkSelectionType, SelectionPrefixes, FlagStatus } from "#types";
3
2
  import { getDbConnection } from "#src/aiHistoDBConnection.ts";
4
- const api = {
5
- endpoint: `deleteWSITileSelection`,
6
- methods: {
7
- delete: {
8
- ...deleteWSITileSelectionPayload,
9
- init
10
- }
11
- }
12
- };
13
3
  function init({ genomes }) {
14
4
  return async (req, res) => {
15
5
  try {
@@ -139,6 +129,6 @@ function validateQuery(ds, connection) {
139
129
  };
140
130
  }
141
131
  export {
142
- api,
132
+ init,
143
133
  validate_query_deleteWSIAnnotation
144
134
  };
package/routes/dsdata.js CHANGED
@@ -2,24 +2,6 @@ import path from "path";
2
2
  import { spawn } from "child_process";
3
3
  import serverconfig from "#src/serverconfig.js";
4
4
  import * as common from "#shared/common.js";
5
- import { dsDataPayload } from "#types/checkers";
6
- const api = {
7
- // route endpoint
8
- // - no need for trailing slash
9
- // - should be a noun (method is based on HTTP GET, POST, etc)
10
- // - don't add 'Data' as response is assumed to be data
11
- endpoint: "dsdata",
12
- methods: {
13
- get: {
14
- ...dsDataPayload,
15
- init
16
- },
17
- post: {
18
- ...dsDataPayload,
19
- init
20
- }
21
- }
22
- };
23
5
  function init({ genomes }) {
24
6
  return async function handle_dsdata(req, res) {
25
7
  try {
@@ -113,5 +95,5 @@ function handle_dsdata_vcf(query, req) {
113
95
  });
114
96
  }
115
97
  export {
116
- api
98
+ init
117
99
  };
@@ -1,4 +1,3 @@
1
- import { gdcGRIN2listPayload } from "#types/checkers";
2
1
  import ky from "ky";
3
2
  import { joinUrl } from "#shared/joinUrl.js";
4
3
  import serverconfig from "#src/serverconfig.js";
@@ -7,19 +6,6 @@ const mafMaxFileNumber = 1e3, cnvMaxFileNumber = 1e3;
7
6
  const allowedWorkflowType = "Aliquot Ensemble Somatic Variant Merging and Masking";
8
7
  const maxFileSizeAllowed = 1e6;
9
8
  const maxTotalSizeCompressed = serverconfig.features.gdcMafMaxFileSize || 4e8;
10
- const api = {
11
- endpoint: "gdc/GRIN2list",
12
- methods: {
13
- get: {
14
- ...gdcGRIN2listPayload,
15
- init
16
- },
17
- post: {
18
- ...gdcGRIN2listPayload,
19
- init
20
- }
21
- }
22
- };
23
9
  function init({ genomes }) {
24
10
  return async (req, res) => {
25
11
  try {
@@ -247,6 +233,6 @@ async function listCnvFiles(q, result, ds) {
247
233
  }
248
234
  }
249
235
  export {
250
- api,
236
+ init,
251
237
  maxTotalSizeCompressed
252
238
  };
@@ -1,23 +1,9 @@
1
- import { runGRIN2Payload } from "#types/checkers";
2
1
  import { run_rust } from "@sjcrh/proteinpaint-rust";
3
2
  import serverconfig from "#src/serverconfig.js";
4
3
  import path from "path";
5
4
  import { run_python } from "@sjcrh/proteinpaint-python";
6
5
  import { mayLog } from "#src/helpers.ts";
7
6
  const MAX_RECORD = 1e5;
8
- const api = {
9
- endpoint: "gdc/runGRIN2",
10
- methods: {
11
- get: {
12
- ...runGRIN2Payload,
13
- init
14
- },
15
- post: {
16
- ...runGRIN2Payload,
17
- init
18
- }
19
- }
20
- };
21
7
  function init({ genomes }) {
22
8
  return async (req, res) => {
23
9
  try {
@@ -137,5 +123,5 @@ function parseRustOutput(rustOutput) {
137
123
  }
138
124
  }
139
125
  export {
140
- api
126
+ init
141
127
  };
package/routes/gdc.maf.js CHANGED
@@ -1,4 +1,3 @@
1
- import { gdcMafPayload } from "#types/checkers";
2
1
  import ky from "ky";
3
2
  import { joinUrl } from "#shared/joinUrl.js";
4
3
  import serverconfig from "#src/serverconfig.js";
@@ -6,19 +5,6 @@ import { getGdcSampletypes } from "#src/mds3.gdc.js";
6
5
  const maxFileNumber = 1e3;
7
6
  const allowedWorkflowType = "Aliquot Ensemble Somatic Variant Merging and Masking";
8
7
  const maxTotalSizeCompressed = serverconfig.features.gdcMafMaxFileSize || 4e8;
9
- const api = {
10
- endpoint: "gdc/maf",
11
- methods: {
12
- get: {
13
- ...gdcMafPayload,
14
- init
15
- },
16
- post: {
17
- ...gdcMafPayload,
18
- init
19
- }
20
- }
21
- };
22
8
  function init({ genomes }) {
23
9
  return async (req, res) => {
24
10
  try {
@@ -94,6 +80,6 @@ async function listMafFiles(q, ds) {
94
80
  return result;
95
81
  }
96
82
  export {
97
- api,
83
+ init,
98
84
  maxTotalSizeCompressed
99
85
  };
@@ -1,22 +1,8 @@
1
1
  import ky from "ky";
2
2
  import { joinUrl } from "#shared/joinUrl.js";
3
3
  import { stream_rust } from "@sjcrh/proteinpaint-rust";
4
- import { gdcMafPayload } from "#types/checkers";
5
4
  import { maxTotalSizeCompressed } from "./gdc.maf.ts";
6
5
  import { mayLog } from "#src/helpers.ts";
7
- const api = {
8
- endpoint: "gdc/mafBuild",
9
- methods: {
10
- get: {
11
- init,
12
- ...gdcMafPayload
13
- },
14
- post: {
15
- init,
16
- ...gdcMafPayload
17
- }
18
- }
19
- };
20
6
  function init({ genomes }) {
21
7
  return async (req, res) => {
22
8
  try {
@@ -125,5 +111,5 @@ async function getFileLstUnderSizeLimit(lst, host, headers) {
125
111
  return out;
126
112
  }
127
113
  export {
128
- api
114
+ init
129
115
  };