@sjcrh/proteinpaint-server 2.59.0 → 2.60.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.59.0",
3
+ "version": "2.60.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.59.0",
64
+ "@sjcrh/proteinpaint-rust": "2.60.0",
65
65
  "better-sqlite3": "^9.4.1",
66
66
  "body-parser": "^1.15.2",
67
67
  "canvas": "~2.11.2",
@@ -137,7 +137,7 @@ async function validate_query_geneExpression(ds, genome) {
137
137
  const q = ds.queries.geneExpression;
138
138
  if (!q)
139
139
  return;
140
- q.gene2bins = {};
140
+ q.geneExpression2bins = {};
141
141
  if (q.src == "gdcapi") {
142
142
  gdc_validate_query_geneExpression(ds, genome);
143
143
  return;
@@ -169,7 +169,6 @@ async function validateNative(q, ds, genome) {
169
169
  throw "queries.geneExpression: unknown sample from header: " + l[i];
170
170
  q.samples.push(id);
171
171
  }
172
- console.log(q.samples.length, "samples from geneExpression of", ds.label);
173
172
  }
174
173
  q.get = async (param) => {
175
174
  const limitSamples = await mayLimitSamples(param, q.samples, ds);
@@ -193,8 +192,10 @@ async function validateNative(q, ds, genome) {
193
192
  continue;
194
193
  if (!g.chr) {
195
194
  const re = getResultGene(genome, { input: g.gene, deep: 1 });
196
- if (!re.gmlst || re.gmlst.length == 0)
197
- throw "unknown gene";
195
+ if (!re.gmlst || re.gmlst.length == 0) {
196
+ console.warn("unknown gene:" + g.gene);
197
+ continue;
198
+ }
198
199
  const i = re.gmlst.find((i2) => i2.isdefault) || re.gmlst[0];
199
200
  g.start = i.start;
200
201
  g.stop = i.stop;
@@ -225,6 +226,8 @@ async function validateNative(q, ds, genome) {
225
226
  gene2sample2value.set(g.gene, s2v);
226
227
  }
227
228
  const byTermId = {};
229
+ if (gene2sample2value.size == 0)
230
+ throw "no data available for the input " + param.genes?.map((g) => g.gene).join(", ");
228
231
  return { gene2sample2value, byTermId, bySampleId };
229
232
  };
230
233
  }
@@ -3,6 +3,7 @@ import { authApi } from "#src/auth.js";
3
3
  import { get_ds_tdb } from "#src/termdb.js";
4
4
  import { mayCopyFromCookie } from "#src/utils.js";
5
5
  import { mayComputeTermtypeByCohort } from "#src/termdb.server.init.js";
6
+ import { TermTypes } from "#shared/terms.js";
6
7
  const api = {
7
8
  endpoint: "termdb/config",
8
9
  methods: {
@@ -168,6 +169,12 @@ function addGenomicQueries(c, ds, genome) {
168
169
  delete q2.singleSampleGenomeQuantification[k].folder;
169
170
  }
170
171
  }
172
+ if (q.NIdata) {
173
+ q2.NIdata = {};
174
+ for (const k in q.NIdata) {
175
+ q2.NIdata[k] = JSON.parse(JSON.stringify(q.NIdata[k]));
176
+ }
177
+ }
171
178
  if (q.singleSampleGbtk) {
172
179
  q2.singleSampleGbtk = {};
173
180
  for (const k in q.singleSampleGbtk) {
@@ -207,7 +214,9 @@ function getAllowedTermTypes(ds) {
207
214
  typeSet.add("geneVariant");
208
215
  }
209
216
  if (ds?.queries?.geneExpression)
210
- typeSet.add("geneExpression");
217
+ typeSet.add(TermTypes.GENE_EXPRESSION);
218
+ if (ds?.queries?.metaboliteIntensity)
219
+ typeSet.add(TermTypes.METABOLITE_INTENSITY);
211
220
  return [...typeSet];
212
221
  }
213
222
  export {
@@ -81,7 +81,7 @@ async function trigger_getdescrstats(q, res, ds, genome) {
81
81
  for (const key in data.samples) {
82
82
  const sample = data.samples[key];
83
83
  const value = sample[q.tw.$id].value;
84
- if (q.tw.values?.[value]?.uncomputable) {
84
+ if (q.tw.q.hiddenValues?.[value]) {
85
85
  continue;
86
86
  }
87
87
  if (q.settings?.violin?.unit === "log") {