@sjcrh/proteinpaint-server 2.36.0 → 2.37.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.termbyid.ts → termdb.termsbyids.ts} +21 -26
- package/server.js +1 -1
- package/server.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjcrh/proteinpaint-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.37.0",
|
|
4
4
|
"description": "a genomics visualization tool for exploring a cohort's genotype and phenotype data",
|
|
5
5
|
"main": "server.js",
|
|
6
6
|
"bin": "start.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@sjcrh/augen": "2.35.0",
|
|
60
|
-
"@sjcrh/proteinpaint-rust": "2.
|
|
60
|
+
"@sjcrh/proteinpaint-rust": "2.37.0",
|
|
61
61
|
"better-sqlite3": "^7.5.3",
|
|
62
62
|
"body-parser": "^1.15.2",
|
|
63
63
|
"canvas": "~2.9.3",
|
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { gettermsbyidsRequest, gettermsbyidsResponse } from '#shared/types/routes/termdb.termsbyids.js'
|
|
2
2
|
import { copy_term } from '#src/termdb.js'
|
|
3
3
|
|
|
4
4
|
export const api: any = {
|
|
5
|
-
endpoint: 'termdb/
|
|
5
|
+
endpoint: 'termdb/termsbyids',
|
|
6
6
|
methods: {
|
|
7
7
|
get: {
|
|
8
8
|
init,
|
|
9
9
|
request: {
|
|
10
|
-
typeId: '
|
|
10
|
+
typeId: 'gettermsbyidsRequest'
|
|
11
11
|
},
|
|
12
12
|
response: {
|
|
13
|
-
typeId: '
|
|
14
|
-
}
|
|
15
|
-
examples: [
|
|
16
|
-
{
|
|
17
|
-
request: {
|
|
18
|
-
body: {
|
|
19
|
-
genome: 'hg38-test',
|
|
20
|
-
dslabel: 'TermdbTest',
|
|
21
|
-
embedder: 'localhost',
|
|
22
|
-
gettermbyid: 'subcohort'
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
response: {
|
|
26
|
-
header: { status: 200 }
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
]
|
|
13
|
+
typeId: 'gettermsbyidsResponse'
|
|
14
|
+
}
|
|
30
15
|
},
|
|
31
16
|
post: {
|
|
32
17
|
alternativeFor: 'get',
|
|
@@ -46,7 +31,7 @@ function init({ genomes }) {
|
|
|
46
31
|
const tdb = ds.cohort.termdb
|
|
47
32
|
if (!tdb) throw 'invalid termdb object'
|
|
48
33
|
|
|
49
|
-
await
|
|
34
|
+
await trigger_gettermsbyid(q, res, tdb) // as getcategoriesResponse
|
|
50
35
|
} catch (e) {
|
|
51
36
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
52
37
|
// @ts-ignore
|
|
@@ -56,13 +41,23 @@ function init({ genomes }) {
|
|
|
56
41
|
}
|
|
57
42
|
}
|
|
58
43
|
|
|
59
|
-
async function
|
|
60
|
-
q: {
|
|
61
|
-
res: { send: (arg0: {
|
|
44
|
+
async function trigger_gettermsbyid(
|
|
45
|
+
q: { ids: any },
|
|
46
|
+
res: { send: (arg0: { terms: any }) => void },
|
|
62
47
|
tdb: { q: { termjsonByOneid: (arg0: any) => any } }
|
|
63
48
|
) {
|
|
64
|
-
const
|
|
49
|
+
const terms = {}
|
|
50
|
+
for (const id of q.ids) {
|
|
51
|
+
const term = tdb.q.termjsonByOneid(id)
|
|
52
|
+
if (term) {
|
|
53
|
+
if (term.type == 'categorical' && !term.values && !term.groupsetting?.inuse) {
|
|
54
|
+
term.values = {}
|
|
55
|
+
term.samplecount = {}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
terms[id] = term ? copy_term(term) : undefined
|
|
59
|
+
}
|
|
65
60
|
res.send({
|
|
66
|
-
|
|
61
|
+
terms
|
|
67
62
|
})
|
|
68
63
|
}
|