@sjcrh/proteinpaint-server 2.79.1-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 +1 -1
- package/routes/termdb.config.js +1 -1
- package/routes/termdb.singlecellSamples.js +9 -2
- package/src/app.js +25 -9
package/package.json
CHANGED
package/routes/termdb.config.js
CHANGED
|
@@ -222,7 +222,7 @@ function addNonDictionaryQueries(c, ds, genome) {
|
|
|
222
222
|
width: q.singleCell.data.width,
|
|
223
223
|
height: q.singleCell.data.height,
|
|
224
224
|
plots: q.singleCell.data.plots.map((p) => {
|
|
225
|
-
return { name: p.name,
|
|
225
|
+
return { name: p.name, colorColumns: p.colorColumns.map((c2) => c2.name) };
|
|
226
226
|
})
|
|
227
227
|
}
|
|
228
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[
|
|
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({
|
|
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 };
|