@sjcrh/proteinpaint-server 2.79.0 → 2.79.1-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-server",
3
- "version": "2.79.0",
3
+ "version": "2.79.1-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",
@@ -48,7 +48,7 @@
48
48
  "@typescript-eslint/eslint-plugin": "^5.60.0",
49
49
  "babel-loader": "^8.2.2",
50
50
  "esbuild": "^0.19.12",
51
- "glob": "^10.4.1",
51
+ "glob": "^10.4.5",
52
52
  "node-watch": "^0.7.1",
53
53
  "nodemon": "^2.0.19",
54
54
  "prettier": "^2.8.8",
@@ -59,7 +59,8 @@ function make(q, res, ds, genome) {
59
59
  urlTemplates: tdb.urlTemplates,
60
60
  title: "title" in ds.cohort ? ds.cohort.title : { text: ds.label },
61
61
  hideGroupsTab: ds.cohort.hideGroupsTab,
62
- tracks: tdb.tracks
62
+ tracks: tdb.tracks,
63
+ hasSampleAncestry: ds.cohort.termdb.hasSampleAncestry
63
64
  };
64
65
  if (tdb.chartConfigByType)
65
66
  c.chartConfigByType = tdb.chartConfigByType;
@@ -221,7 +222,7 @@ function addNonDictionaryQueries(c, ds, genome) {
221
222
  width: q.singleCell.data.width,
222
223
  height: q.singleCell.data.height,
223
224
  plots: q.singleCell.data.plots.map((p) => {
224
- return { name: p.name, colorColumn: p.colorColumn.name };
225
+ return { name: p.name, colorColumns: p.colorColumns.map((c2) => c2.name) };
225
226
  })
226
227
  }
227
228
  };
@@ -129,12 +129,13 @@ function validateDataNative(D, ds) {
129
129
  }
130
130
  file2Lines[tsvfile] = (await read_file(tsvfile)).trim().split("\n");
131
131
  }
132
+ const colorColumn = plot.colorColumns.find((c) => c.name == q.colorBy?.[plot.name]) || plot.colorColumns[0];
132
133
  const lines = file2Lines[tsvfile];
133
134
  const cells = [];
134
135
  for (let i = 1; i < lines.length; i++) {
135
136
  const l = lines[i].split(" ");
136
137
  const cellId = lines.length > 3 ? l[0] : void 0, x = Number(l[plot.coordsColumns.x]), y = Number(l[plot.coordsColumns.y]);
137
- const category = l[plot.colorColumn?.index] || "";
138
+ const category = l[colorColumn?.index] || "";
138
139
  if (!cellId)
139
140
  throw "cell id missing";
140
141
  if (!Number.isFinite(x) || !Number.isFinite(y))
@@ -147,7 +148,13 @@ function validateDataNative(D, ds) {
147
148
  }
148
149
  cells.push(cell);
149
150
  }
150
- plots.push({ name: plot.name, cells, colorBy: plot.colorColumn?.name, colorMap: plot.colorColumn?.colorMap });
151
+ plots.push({
152
+ name: plot.name,
153
+ cells,
154
+ colorColumns: plot.colorColumns.map((c) => c.name),
155
+ colorBy: colorColumn?.name,
156
+ colorMap: colorColumn?.colorMap
157
+ });
151
158
  }
152
159
  if (plots.length == 0) {
153
160
  return { nodata: true };