@sjcrh/proteinpaint-server 2.66.0 → 2.67.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 +2 -2
- package/routes/termdb.categories.js +6 -7
- package/routes/termdb.config.js +6 -5
- package/routes/termdb.singlecellDEgenes.js +51 -0
- package/routes/termdb.singlecellSamples.js +5 -5
- package/routes/termdb.termsbyids.js +3 -1
- package/src/app.js +1154 -773
- package/src/serverconfig.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjcrh/proteinpaint-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.67.1-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",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"pretest": "tsc && ./test/pretest.js",
|
|
31
31
|
"prepare": "ts-patch install",
|
|
32
32
|
"pretest:type": "npm run checkers",
|
|
33
|
-
"pretest:integration": "tsc
|
|
33
|
+
"pretest:integration": "tsc",
|
|
34
34
|
"test:integration": "echo 'TODO: server integration tests'",
|
|
35
35
|
"test:tsc": "tsc --esModuleInterop --noEmit --allowImportingTsExtensions ./shared/types/test/*.type.spec.ts"
|
|
36
36
|
},
|
|
@@ -79,11 +79,10 @@ function init({ genomes }) {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
async function trigger_getcategories(q, res, tdb, ds, genome) {
|
|
82
|
-
const $id =
|
|
83
|
-
const tw = { $id, term: q.term, q: q.term1_q || getDefaultQ(q.term, q) };
|
|
82
|
+
const $id = q.tw.$id;
|
|
84
83
|
const arg = {
|
|
85
84
|
filter: q.filter,
|
|
86
|
-
terms: [tw],
|
|
85
|
+
terms: [q.tw],
|
|
87
86
|
currentGeneNames: q.currentGeneNames,
|
|
88
87
|
// optional, from mds3 mayAddGetCategoryArgs()
|
|
89
88
|
rglst: q.rglst
|
|
@@ -93,7 +92,7 @@ async function trigger_getcategories(q, res, tdb, ds, genome) {
|
|
|
93
92
|
if (data.error)
|
|
94
93
|
throw data.error;
|
|
95
94
|
const lst = [];
|
|
96
|
-
if (q.term.type == "geneVariant") {
|
|
95
|
+
if (q.tw.term.type == "geneVariant" && !q.tw.q.groupsetting.inuse) {
|
|
97
96
|
const samples = data.samples;
|
|
98
97
|
const dtClassMap = /* @__PURE__ */ new Map();
|
|
99
98
|
if (ds.assayAvailability?.byDt) {
|
|
@@ -154,15 +153,15 @@ async function trigger_getcategories(q, res, tdb, ds, genome) {
|
|
|
154
153
|
lst.push({
|
|
155
154
|
samplecount: count,
|
|
156
155
|
key,
|
|
157
|
-
label: data.refs?.byTermId?.[$id]?.events?.find((e) => e.event === key).label || q.term?.values?.[key]?.label || key
|
|
156
|
+
label: data.refs?.byTermId?.[$id]?.events?.find((e) => e.event === key).label || q.tw.term?.values?.[key]?.label || key
|
|
158
157
|
});
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
160
|
const orderedLabels = getOrderedLabels(
|
|
162
|
-
q.term,
|
|
161
|
+
q.tw.term,
|
|
163
162
|
data.refs?.byTermId?.[$id]?.bins || [],
|
|
164
163
|
data.refs?.byTermId?.[$id]?.events,
|
|
165
|
-
q.
|
|
164
|
+
q.tw.q
|
|
166
165
|
);
|
|
167
166
|
if (orderedLabels.length) {
|
|
168
167
|
lst.sort((a, b) => orderedLabels.indexOf(a.label) - orderedLabels.indexOf(b.label));
|
package/routes/termdb.config.js
CHANGED
|
@@ -191,10 +191,6 @@ function addNonDictionaryQueries(c, ds, genome) {
|
|
|
191
191
|
q2.rnaseqGeneCount = true;
|
|
192
192
|
}
|
|
193
193
|
if (q.singleCell) {
|
|
194
|
-
const plots = "plots" in q.singleCell.data ? q.singleCell.data.plots.map((p) => ({
|
|
195
|
-
name: p.name,
|
|
196
|
-
colorColumn: p.colorColumn.name
|
|
197
|
-
})) : [];
|
|
198
194
|
q2.singleCell = {
|
|
199
195
|
samples: {
|
|
200
196
|
firstColumnName: q.singleCell.samples.firstColumnName,
|
|
@@ -204,12 +200,17 @@ function addNonDictionaryQueries(c, ds, genome) {
|
|
|
204
200
|
data: {
|
|
205
201
|
sameLegend: q.singleCell.data.sameLegend,
|
|
206
202
|
refName: q.singleCell.data.refName,
|
|
207
|
-
plots
|
|
203
|
+
plots: q.singleCell.data.plots.map((p) => {
|
|
204
|
+
return { name: p.name, colorColumn: p.colorColumn.name };
|
|
205
|
+
})
|
|
208
206
|
}
|
|
209
207
|
};
|
|
210
208
|
if (q.singleCell.geneExpression) {
|
|
211
209
|
q2.singleCell.geneExpression = {};
|
|
212
210
|
}
|
|
211
|
+
if (q.singleCell.DEgenes) {
|
|
212
|
+
q2.singleCell.DEgenes = { columnName: q.singleCell.DEgenes.columnName };
|
|
213
|
+
}
|
|
213
214
|
}
|
|
214
215
|
if (q.images) {
|
|
215
216
|
q2.images = {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { gdc_validate_query_singleCell_DEgenes } from "#src/mds3.gdc.js";
|
|
2
|
+
const api = {
|
|
3
|
+
endpoint: "termdb/singlecellDEgenes",
|
|
4
|
+
methods: {
|
|
5
|
+
all: {
|
|
6
|
+
init,
|
|
7
|
+
request: {
|
|
8
|
+
typeId: "TermdbSinglecellDEgenesRequest"
|
|
9
|
+
},
|
|
10
|
+
response: {
|
|
11
|
+
typeId: "TermdbSinglecellDEgenesResponse"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
function init({ genomes }) {
|
|
17
|
+
return async (req, res) => {
|
|
18
|
+
const q = req.query;
|
|
19
|
+
let result;
|
|
20
|
+
try {
|
|
21
|
+
const g = genomes[q.genome];
|
|
22
|
+
if (!g)
|
|
23
|
+
throw "invalid genome name";
|
|
24
|
+
const ds = g.datasets[q.dslabel];
|
|
25
|
+
if (!ds)
|
|
26
|
+
throw "invalid dataset name";
|
|
27
|
+
if (!ds.queries?.singleCell?.DEgenes)
|
|
28
|
+
throw "not supported on this dataset";
|
|
29
|
+
result = await ds.queries.singleCell.DEgenes.get(q);
|
|
30
|
+
} catch (e) {
|
|
31
|
+
if (e.stack)
|
|
32
|
+
console.log(e.stack);
|
|
33
|
+
result = {
|
|
34
|
+
status: e.status || 400,
|
|
35
|
+
error: e.message || e
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
res.send(result);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async function validate_query_singleCell_DEgenes(ds) {
|
|
42
|
+
if (ds.queries.singleCell.DEgenes.src == "gdcapi") {
|
|
43
|
+
gdc_validate_query_singleCell_DEgenes(ds);
|
|
44
|
+
} else {
|
|
45
|
+
throw "unknown singleCell.DEgenes.src";
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
api,
|
|
50
|
+
validate_query_singleCell_DEgenes
|
|
51
|
+
};
|
|
@@ -3,11 +3,12 @@ import path from "path";
|
|
|
3
3
|
import { read_file } from "#src/utils.js";
|
|
4
4
|
import run_R from "#src/run_R.js";
|
|
5
5
|
import serverconfig from "#src/serverconfig.js";
|
|
6
|
+
import { validate_query_singleCell_DEgenes } from "./termdb.singlecellDEgenes.ts";
|
|
6
7
|
import { gdc_validate_query_singleCell_samples, gdc_validate_query_singleCell_data } from "#src/mds3.gdc.js";
|
|
7
8
|
const api = {
|
|
8
9
|
endpoint: "termdb/singlecellSamples",
|
|
9
10
|
methods: {
|
|
10
|
-
|
|
11
|
+
all: {
|
|
11
12
|
init,
|
|
12
13
|
request: {
|
|
13
14
|
typeId: "TermdbSinglecellsamplesRequest"
|
|
@@ -15,10 +16,6 @@ const api = {
|
|
|
15
16
|
response: {
|
|
16
17
|
typeId: "TermdbSinglecellsamplesResponse"
|
|
17
18
|
}
|
|
18
|
-
},
|
|
19
|
-
post: {
|
|
20
|
-
alternativeFor: "get",
|
|
21
|
-
init
|
|
22
19
|
}
|
|
23
20
|
}
|
|
24
21
|
};
|
|
@@ -73,6 +70,9 @@ async function validate_query_singleCell(ds, genome) {
|
|
|
73
70
|
throw "unknown singleCell.geneExpression.src";
|
|
74
71
|
}
|
|
75
72
|
}
|
|
73
|
+
if (q.DEgenes) {
|
|
74
|
+
validate_query_singleCell_DEgenes(ds);
|
|
75
|
+
}
|
|
76
76
|
}
|
|
77
77
|
async function validateSamplesNative(S, ds) {
|
|
78
78
|
const samples = {};
|