@sjcrh/proteinpaint-server 2.39.1 → 2.39.2
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.getrootterm.ts +8 -2
- package/routes/termdb.gettermchildren.ts +3 -3
- package/server.js +1 -1
- package/server.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { getroottermRequest, getroottermResponse } from '#shared/types/routes/termdb.getrootterm.ts'
|
|
2
|
+
import { get_ds_tdb } from '#src/termdb.js'
|
|
3
|
+
|
|
2
4
|
|
|
3
5
|
export const api: any = {
|
|
4
6
|
endpoint: 'termdb/rootterm',
|
|
@@ -38,12 +40,16 @@ export const api: any = {
|
|
|
38
40
|
function init({ genomes }) {
|
|
39
41
|
return async (req: any, res: any): Promise<void> => {
|
|
40
42
|
const q = req.query as getroottermRequest
|
|
43
|
+
const cohortValues = q.cohortValues ? q.cohortValues : ''
|
|
44
|
+
const treeFilter = q.treeFilter ? q.treeFilter : ''
|
|
45
|
+
//res.send({ lst: await tdb.q.getRootTerms(cohortValues, treeFilter) })
|
|
46
|
+
|
|
41
47
|
try {
|
|
42
48
|
const g = genomes[req.query.genome]
|
|
43
49
|
if (!g) throw 'invalid genome name'
|
|
44
|
-
|
|
50
|
+
|
|
51
|
+
const [ds, tdb] = get_ds_tdb(g, q)
|
|
45
52
|
if (!ds) throw 'invalid dataset name'
|
|
46
|
-
const tdb = ds.cohort.termdb
|
|
47
53
|
if (!tdb) throw 'invalid termdb object'
|
|
48
54
|
|
|
49
55
|
await trigger_rootterm(q, res, tdb) // as getroottermResponse
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { gettermchildrenRequest, gettermchildrenResponse } from '#shared/types/routes/termdb.gettermchildren.ts'
|
|
2
|
-
import { copy_term } from '#src/termdb.js'
|
|
2
|
+
import { copy_term, get_ds_tdb } from '#src/termdb.js'
|
|
3
3
|
|
|
4
4
|
export const api: any = {
|
|
5
5
|
endpoint: 'termdb/termchildren',
|
|
@@ -43,11 +43,11 @@ function init({ genomes }) {
|
|
|
43
43
|
try {
|
|
44
44
|
const g = genomes[req.query.genome]
|
|
45
45
|
if (!g) throw 'invalid genome name'
|
|
46
|
-
const ds = g
|
|
46
|
+
const [ds, tdb] =await get_ds_tdb(g, q)
|
|
47
47
|
if (!ds) throw 'invalid dataset name'
|
|
48
|
-
const tdb = ds.cohort.termdb
|
|
49
48
|
if (!tdb) throw 'invalid termdb object'
|
|
50
49
|
|
|
50
|
+
|
|
51
51
|
await trigger_children(q, res, tdb)
|
|
52
52
|
} catch (e) {
|
|
53
53
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|