@sjcrh/proteinpaint-server 2.53.0 → 2.55.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.53.0",
3
+ "version": "2.55.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,7 +61,7 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@sjcrh/augen": "2.46.0",
64
- "@sjcrh/proteinpaint-rust": "2.49.0",
64
+ "@sjcrh/proteinpaint-rust": "2.55.0",
65
65
  "better-sqlite3": "^9.4.1",
66
66
  "body-parser": "^1.15.2",
67
67
  "canvas": "~2.11.2",
package/routes/gdc.maf.js CHANGED
@@ -73,6 +73,8 @@ async function listMafFiles(q, ds) {
73
73
  "file_size",
74
74
  "cases.project.project_id",
75
75
  // for display only
76
+ "cases.case_id",
77
+ // case uuid for making case url link to portal
76
78
  "cases.submitter_id",
77
79
  // used when listing all cases & files
78
80
  "cases.samples.sample_type"
@@ -100,9 +102,10 @@ async function listMafFiles(q, ds) {
100
102
  const file = {
101
103
  id: h.id,
102
104
  project_id: c.project.project_id,
103
- file_size: h.file_size
105
+ file_size: h.file_size,
106
+ case_submitter_id: c.submitter_id,
107
+ case_uuid: c.case_id
104
108
  };
105
- file.case_submitter_id = c.submitter_id;
106
109
  if (c.samples) {
107
110
  file.sample_types = c.samples.map((i) => i.sample_type).sort();
108
111
  }
@@ -1,5 +1,5 @@
1
1
  import { mclasscnvgain, mclasscnvloss, dtsnvindel } from "#shared/common.js";
2
- import got from "got";
2
+ import ky from "ky";
3
3
  const api = {
4
4
  endpoint: "gdc/topMutatedGenes",
5
5
  methods: {
@@ -29,6 +29,10 @@ function init({ genomes }) {
29
29
  res.send(payload);
30
30
  } catch (e) {
31
31
  res.send({ status: "error", error: e.message || e });
32
+ if (e.stack)
33
+ console.log(e.stack);
34
+ else
35
+ console.trace(e);
32
36
  }
33
37
  };
34
38
  }
@@ -232,11 +236,12 @@ async function getGenesGraphql(q, ds) {
232
236
  const { host, headers } = ds.getHostHeaders(q);
233
237
  const query = queryV2.query;
234
238
  const variables = queryV2.getVariables(q);
235
- const response = await got.post(host.graphql, {
239
+ const re = await ky.post(host.graphql, {
240
+ timeout: false,
241
+ // do not let ky timeout
236
242
  headers,
237
- body: JSON.stringify({ query, variables })
238
- });
239
- const re = JSON.parse(response.body);
243
+ json: { query, variables }
244
+ }).json();
240
245
  const genes = [];
241
246
  for (const g of re.data.genesTableViewer.explore.genes.hits.edges) {
242
247
  if (typeof g.node != "object")
@@ -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
  };
@@ -25,7 +25,7 @@ function init({ genomes }) {
25
25
  const genome = genomes[q.genome];
26
26
  if (!genome)
27
27
  throw "invalid genome";
28
- const [ds, tdb] = get_ds_tdb(genome, q);
28
+ const [ds] = get_ds_tdb(genome, q);
29
29
  return make(q, res, ds, genome);
30
30
  } catch (e) {
31
31
  res.send({ error: e.message || e });
@@ -105,7 +105,8 @@ function addScatterplots(c, ds) {
105
105
  colorColumn: p.colorColumn,
106
106
  sampleType: p.sampleType,
107
107
  coordsColumns: p.coordsColumns,
108
- settings: p.settings
108
+ settings: p.settings,
109
+ sampleCategory: p.sampleCategory
109
110
  };
110
111
  });
111
112
  }
@@ -131,6 +132,9 @@ function addGenomicQueries(c, ds, genome) {
131
132
  allowSNPs: q.snvindel.allowSNPs
132
133
  };
133
134
  }
135
+ if (q.svfusion) {
136
+ q2.svfusion = {};
137
+ }
134
138
  if (q.cnv) {
135
139
  q2.cnv = {};
136
140
  for (const k of [
@@ -145,6 +149,11 @@ function addGenomicQueries(c, ds, genome) {
145
149
  q2.cnv[k] = q.cnv[k];
146
150
  }
147
151
  }
152
+ if (q.geneCnv) {
153
+ if (!q2.cnv) {
154
+ q2.cnv = {};
155
+ }
156
+ }
148
157
  if (q.topMutatedGenes)
149
158
  q2.topMutatedGenes = q.topMutatedGenes;
150
159
  if (q.topVariablyExpressedGenes)