@sjcrh/proteinpaint-server 2.58.0 → 2.58.1-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 +1 -1
- package/routes/termdb.cluster.js +1 -1
- package/routes/termdb.getdescrstats.js +10 -16
- package/src/app.js +215 -206
package/package.json
CHANGED
package/routes/termdb.cluster.js
CHANGED
|
@@ -136,7 +136,7 @@ async function validate_query_geneExpression(ds, genome) {
|
|
|
136
136
|
const q = ds.queries.geneExpression;
|
|
137
137
|
if (!q)
|
|
138
138
|
return;
|
|
139
|
-
q.
|
|
139
|
+
q.gene2bins = {};
|
|
140
140
|
if (q.src == "gdcapi") {
|
|
141
141
|
gdc_validate_query_geneExpression(ds, genome);
|
|
142
142
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { get_rows_by_one_key } from "../src/termdb.sql.js";
|
|
2
1
|
import Summarystats from "../shared/descriptive.stats.js";
|
|
2
|
+
import { getData } from "#src/termdb.matrix.js";
|
|
3
3
|
const api = {
|
|
4
4
|
endpoint: "termdb/descrstats",
|
|
5
5
|
methods: {
|
|
@@ -64,7 +64,7 @@ function init({ genomes }) {
|
|
|
64
64
|
const tdb = ds.cohort.termdb;
|
|
65
65
|
if (!tdb)
|
|
66
66
|
throw "invalid termdb object";
|
|
67
|
-
await trigger_getdescrstats(q, res, ds);
|
|
67
|
+
await trigger_getdescrstats(q, res, ds, g);
|
|
68
68
|
} catch (e) {
|
|
69
69
|
res.send({ error: e?.message || e });
|
|
70
70
|
if (e instanceof Error && e.stack)
|
|
@@ -72,20 +72,14 @@ function init({ genomes }) {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
async function trigger_getdescrstats(q, res, ds) {
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
throw "invalid termid";
|
|
79
|
-
if (term.type != "float" && term.type != "integer")
|
|
80
|
-
throw "not numerical term";
|
|
81
|
-
const rows = await get_rows_by_one_key({
|
|
82
|
-
ds,
|
|
83
|
-
key: q.tid,
|
|
84
|
-
filter: q.filter
|
|
85
|
-
});
|
|
75
|
+
async function trigger_getdescrstats(q, res, ds, genome) {
|
|
76
|
+
const terms = [q.tw];
|
|
77
|
+
const data = await getData({ filter: q.filter, terms }, ds, genome);
|
|
86
78
|
const values = [];
|
|
87
|
-
for (const
|
|
88
|
-
|
|
79
|
+
for (const key in data.samples) {
|
|
80
|
+
const sample = data.samples[key];
|
|
81
|
+
const value = sample[q.tw.$id].value;
|
|
82
|
+
if (q.tw.values?.[value]?.uncomputable) {
|
|
89
83
|
continue;
|
|
90
84
|
}
|
|
91
85
|
if (q.settings?.violin?.unit === "log") {
|
|
@@ -93,7 +87,7 @@ async function trigger_getdescrstats(q, res, ds) {
|
|
|
93
87
|
continue;
|
|
94
88
|
}
|
|
95
89
|
}
|
|
96
|
-
values.push(value);
|
|
90
|
+
values.push(parseFloat(value));
|
|
97
91
|
}
|
|
98
92
|
res.send(Summarystats(values));
|
|
99
93
|
}
|