@sjcrh/proteinpaint-server 2.44.0 → 2.46.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.
Files changed (82) hide show
  1. package/dataset/clinvar.hg19.js +53 -52
  2. package/dataset/clinvar.hg38.js +74 -73
  3. package/dataset/clinvar.js +164 -47
  4. package/dataset/termdb.test.js +257 -0
  5. package/genome/CriGri.js +1859 -27
  6. package/genome/cgc.js +743 -7
  7. package/genome/danRer10.js +1108 -46
  8. package/genome/dm3.js +71 -44
  9. package/genome/dm6.js +1926 -45
  10. package/genome/galGal5.js +23522 -46
  11. package/genome/galGal6.js +512 -46
  12. package/genome/hg19.js +293 -198
  13. package/genome/hg38.js +472 -105
  14. package/genome/hg38.test.js +406 -40
  15. package/genome/hgvirus.js +45 -20
  16. package/genome/mm10.js +135 -67
  17. package/genome/mm9.js +116 -79
  18. package/genome/rn6.js +1002 -47
  19. package/package.json +31 -35
  20. package/routes/_template_.js +30 -0
  21. package/routes/burden.js +149 -0
  22. package/routes/dataset.js +266 -0
  23. package/routes/dsdata.js +127 -0
  24. package/routes/gdc.maf.js +120 -0
  25. package/routes/gdc.mafBuild.js +106 -0
  26. package/routes/gdc.topMutatedGenes.js +465 -0
  27. package/routes/gene2canonicalisoform.js +41 -0
  28. package/routes/genelookup.js +52 -0
  29. package/routes/genomes.js +144 -0
  30. package/routes/healthcheck.js +30 -0
  31. package/routes/hicdata.js +98 -0
  32. package/routes/hicstat.js +55 -0
  33. package/routes/isoformlst.js +57 -0
  34. package/routes/ntseq.js +43 -0
  35. package/routes/pdomain.js +61 -0
  36. package/routes/snp.js +107 -0
  37. package/routes/termdb.categories.js +209 -0
  38. package/routes/termdb.cluster.js +228 -0
  39. package/routes/termdb.cohort.summary.js +38 -0
  40. package/routes/termdb.cohorts.js +49 -0
  41. package/routes/termdb.config.js +202 -0
  42. package/routes/termdb.getdescrstats.js +102 -0
  43. package/routes/termdb.getnumericcategories.js +92 -0
  44. package/routes/termdb.getpercentile.js +108 -0
  45. package/routes/termdb.getrootterm.js +65 -0
  46. package/routes/termdb.gettermchildren.js +67 -0
  47. package/routes/termdb.singleSampleMutation.js +80 -0
  48. package/routes/termdb.singlecellData.js +46 -0
  49. package/routes/termdb.singlecellSamples.js +160 -0
  50. package/routes/termdb.termsbyids.js +59 -0
  51. package/routes/termdb.topVariablyExpressedGenes.js +171 -0
  52. package/routes/termdb.violin.js +77 -0
  53. package/src/app.js +41500 -0
  54. package/src/serverconfig.js +14 -8
  55. package/start.js +3 -3
  56. package/routes/README.md +0 -84
  57. package/routes/burden.ts +0 -143
  58. package/routes/gdc.maf.ts +0 -195
  59. package/routes/gdc.mafBuild.ts +0 -114
  60. package/routes/gdc.topMutatedGenes.ts +0 -586
  61. package/routes/genelookup.ts +0 -50
  62. package/routes/healthcheck.ts +0 -29
  63. package/routes/hicdata.ts +0 -111
  64. package/routes/hicstat.ts +0 -55
  65. package/routes/termdb.categories.ts +0 -245
  66. package/routes/termdb.cluster.ts +0 -248
  67. package/routes/termdb.getdescrstats.ts +0 -102
  68. package/routes/termdb.getnumericcategories.ts +0 -99
  69. package/routes/termdb.getpercentile.ts +0 -118
  70. package/routes/termdb.getrootterm.ts +0 -73
  71. package/routes/termdb.gettermchildren.ts +0 -82
  72. package/routes/termdb.singleSampleMutation.ts +0 -87
  73. package/routes/termdb.singlecellData.ts +0 -49
  74. package/routes/termdb.singlecellSamples.ts +0 -175
  75. package/routes/termdb.termsbyids.ts +0 -63
  76. package/routes/termdb.topVariablyExpressedGenes.ts +0 -214
  77. package/routes/termdb.violin.ts +0 -77
  78. package/server.js +0 -2
  79. package/server.js.map +0 -1
  80. package/shared/common.js +0 -1080
  81. package/shared/termdb.initbinconfig.js +0 -96
  82. package/shared/vcf.js +0 -629
@@ -1,102 +0,0 @@
1
- import { getdescrstatsRequest, getdescrstatsResponse } from '#shared/types/routes/termdb.getdescrstats.ts'
2
- import { get_rows_by_one_key } from '../src/termdb.sql.js'
3
- import Summarystats from '../shared/descriptive.stats.js'
4
-
5
- export const api: any = {
6
- endpoint: 'termdb/descrstats',
7
- methods: {
8
- all: {
9
- init,
10
- request: {
11
- typeId: 'getdescrstatsRequest'
12
- },
13
- response: {
14
- typeId: 'getdescrstatsResponse'
15
- },
16
- examples: [
17
- {
18
- request: {
19
- body: {
20
- genome: 'hg38-test',
21
- dslabel: 'TermdbTest',
22
- embedder: 'localhost',
23
- tid: 'hrtavg',
24
- filter: {
25
- type: 'tvslst',
26
- in: true,
27
- join: '',
28
- lst: [
29
- {
30
- tag: 'cohortFilter',
31
- type: 'tvs',
32
- tvs: {
33
- term: {
34
- name: 'Cohort',
35
- type: 'categorical',
36
- values: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },
37
- id: 'subcohort',
38
- isleaf: false,
39
- groupsetting: { disabled: true }
40
- },
41
- values: [{ key: 'ABC', label: 'ABC' }]
42
- }
43
- }
44
- ]
45
- }
46
- }
47
- },
48
- response: {
49
- header: { status: 200 }
50
- }
51
- }
52
- ]
53
- }
54
- }
55
- }
56
-
57
- function init({ genomes }) {
58
- return async (req: any, res: any): Promise<void> => {
59
- const q = req.query as getdescrstatsRequest
60
- try {
61
- const g = genomes[req.query.genome]
62
- if (!g) throw 'invalid genome name'
63
- const ds = g.datasets[req.query.dslabel]
64
- if (!ds) throw 'invalid dataset name'
65
- const tdb = ds.cohort.termdb
66
- if (!tdb) throw 'invalid termdb object'
67
-
68
- await trigger_getdescrstats(q, res, ds) // as getdescrstatsResponse
69
- } catch (e) {
70
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
71
- // @ts-ignore
72
- res.send({ error: e?.message || e })
73
- if (e instanceof Error && e.stack) console.log(e)
74
- }
75
- }
76
- }
77
-
78
- async function trigger_getdescrstats(q: any, res: any, ds: any) {
79
- const term = ds.cohort.termdb.q.termjsonByOneid(q.tid)
80
- if (!term) throw 'invalid termid'
81
- if (term.type != 'float' && term.type != 'integer') throw 'not numerical term'
82
- const rows = await get_rows_by_one_key({
83
- ds,
84
- key: q.tid,
85
- filter: q.filter
86
- })
87
- const values: number[] = []
88
- for (const { value } of rows) {
89
- if (term.values?.[value]?.uncomputable) {
90
- // skip uncomputable values
91
- continue
92
- }
93
- //skip computing for zeros if scale is log.
94
- if (q.settings?.violin?.unit === 'log') {
95
- if (value === 0) {
96
- continue
97
- }
98
- }
99
- values.push(value)
100
- }
101
- res.send(Summarystats(values) as getdescrstatsResponse)
102
- }
@@ -1,99 +0,0 @@
1
- import {
2
- getnumericcategoriesRequest,
3
- getnumericcategoriesResponse
4
- } from '#shared/types/routes/termdb.getnumericcategories.ts'
5
- import * as termdbsql from '#src/termdb.sql.js'
6
-
7
- export const api: any = {
8
- endpoint: 'termdb/numericcategories',
9
- methods: {
10
- get: {
11
- init,
12
- request: {
13
- typeId: 'getnumericcategoriesRequest'
14
- },
15
- response: {
16
- typeId: 'getnumericcategoriesResponse'
17
- },
18
- examples: [
19
- {
20
- request: {
21
- body: {
22
- genome: 'hg38-test',
23
- dslabel: 'TermdbTest',
24
- embedder: 'localhost',
25
- tid: 'aaclassic_5',
26
- filter: {
27
- type: 'tvslst',
28
- in: true,
29
- join: '',
30
- lst: [
31
- {
32
- tag: 'cohortFilter',
33
- type: 'tvs',
34
- tvs: {
35
- term: {
36
- name: 'Cohort',
37
- type: 'categorical',
38
- values: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },
39
- id: 'subcohort',
40
- isleaf: false,
41
- groupsetting: { disabled: true }
42
- },
43
- values: [{ key: 'ABC', label: 'ABC' }]
44
- }
45
- }
46
- ]
47
- }
48
- }
49
- },
50
- response: {
51
- header: { status: 200 }
52
- }
53
- }
54
- ]
55
- },
56
- post: {
57
- alternativeFor: 'get',
58
- init
59
- }
60
- }
61
- }
62
-
63
- function init({ genomes }) {
64
- return async (req: any, res: any): Promise<void> => {
65
- const q = req.query as getnumericcategoriesRequest
66
- try {
67
- const g = genomes[req.query.genome]
68
- if (!g) throw 'invalid genome name'
69
- const ds = g.datasets[req.query.dslabel]
70
- if (!ds) throw 'invalid dataset name'
71
- const tdb = ds.cohort.termdb
72
- if (!tdb) throw 'invalid termdb object'
73
-
74
- await trigger_getnumericcategories(q, res, tdb, ds) // as getnumericcategoriesResponse
75
- } catch (e) {
76
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
77
- // @ts-ignore
78
- res.send({ error: e?.message || e })
79
- if (e instanceof Error && e.stack) console.log(e)
80
- }
81
- }
82
- }
83
-
84
- async function trigger_getnumericcategories(
85
- q: { tid: any; filter?: any },
86
- res: { send: (arg0: { lst: any }) => void },
87
- tdb: { q: { termjsonByOneid: (arg0: any) => any } },
88
- ds: any
89
- ) {
90
- if (!q.tid) throw '.tid missing'
91
- const term = tdb.q.termjsonByOneid(q.tid)
92
- const arg = {
93
- ds,
94
- term_id: q.tid,
95
- filter: q.filter
96
- }
97
- const lst = await termdbsql.get_summary_numericcategories(arg)
98
- res.send({ lst } as getnumericcategoriesResponse)
99
- }
@@ -1,118 +0,0 @@
1
- import { getpercentileRequest, getpercentileResponse } from '#shared/types/routes/termdb.getpercentile.ts'
2
- import * as termdbsql from '../src/termdb.sql.js'
3
- import computePercentile from '../shared/compute.percentile.js'
4
- import { Filter } from '../shared/types/filter'
5
-
6
- export const api: any = {
7
- endpoint: 'termdb/getpercentile',
8
- methods: {
9
- get: {
10
- init,
11
- request: {
12
- typeId: 'getpercentileRequest'
13
- },
14
- response: {
15
- typeId: 'getpercentileResponse'
16
- },
17
- examples: [
18
- {
19
- request: {
20
- body: {
21
- genome: 'hg38-test',
22
- dslabel: 'TermdbTest',
23
- embedder: 'localhost',
24
- getpercentile: [50],
25
- tid: 'agedx',
26
- filter: {
27
- type: 'tvslst',
28
- in: true,
29
- join: '',
30
- lst: [
31
- {
32
- tag: 'cohortFilter',
33
- type: 'tvs',
34
- tvs: {
35
- term: {
36
- name: 'Cohort',
37
- type: 'categorical',
38
- values: { ABC: { label: 'ABC' }, XYZ: { label: 'XYZ' } },
39
- id: 'subcohort',
40
- isleaf: false,
41
- groupsetting: { disabled: true }
42
- },
43
- values: [{ key: 'ABC', label: 'ABC' }]
44
- }
45
- }
46
- ]
47
- }
48
- }
49
- },
50
- response: {
51
- header: { status: 200 }
52
- }
53
- }
54
- ]
55
- },
56
- post: {
57
- alternativeFor: 'get',
58
- init
59
- }
60
- }
61
- }
62
-
63
- function init({ genomes }) {
64
- return async (req: any, res: any): Promise<void> => {
65
- const q = req.query as getpercentileRequest
66
- try {
67
- const g = genomes[req.query.genome]
68
- if (!g) throw 'invalid genome name'
69
- const ds = g.datasets[req.query.dslabel]
70
- if (!ds) throw 'invalid dataset name'
71
- await trigger_getpercentile(q, res, ds) // as getpercentileResponse
72
- } catch (e) {
73
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
74
- // @ts-ignore
75
- res.send({ error: e?.message || e })
76
- if (e instanceof Error && e.stack) console.log(e)
77
- }
78
- }
79
- }
80
-
81
- async function trigger_getpercentile(
82
- q: { tid: string; getpercentile: number[]; filter: Filter },
83
- res: { send: (arg0: { values: number[] }) => void },
84
- ds: { cohort: { termdb: { q: { termjsonByOneid: (arg0: any) => any } } } }
85
- ) {
86
- const term = ds.cohort.termdb.q.termjsonByOneid(q.tid)
87
- if (!term) throw 'invalid termid'
88
- if (term.type != 'float' && term.type != 'integer') throw 'not numerical term'
89
- const percentile_lst = q.getpercentile
90
- const perc_values = [] as number[]
91
- const values = [] as number[]
92
- const rows = await termdbsql.get_rows_by_one_key({
93
- ds,
94
- key: q.tid,
95
- filter: q.filter ? (typeof q.filter == 'string' ? JSON.parse(q.filter) : q.filter) : null
96
- })
97
- for (const { value } of rows) {
98
- if (term.values && term.values[value] && term.values[value].uncomputable) {
99
- // skip uncomputable values
100
- continue
101
- }
102
-
103
- if (term.skip0forPercentile && value == 0) {
104
- // quick fix: when the flag is true, will exclude 0 values from percentile computing
105
- // to address an issue with computing knots
106
- continue
107
- }
108
-
109
- values.push(Number(value))
110
- }
111
-
112
- // compute percentiles
113
- for (const percentile of percentile_lst) {
114
- const perc_value = computePercentile(values, percentile)
115
- perc_values.push(perc_value)
116
- }
117
- res.send({ values: perc_values } as getpercentileResponse)
118
- }
@@ -1,73 +0,0 @@
1
- import { getroottermRequest, getroottermResponse } from '#shared/types/routes/termdb.getrootterm.ts'
2
- import { get_ds_tdb } from '#src/termdb.js'
3
-
4
-
5
- export const api: any = {
6
- endpoint: 'termdb/rootterm',
7
- methods: {
8
- get: {
9
- init,
10
- request: {
11
- typeId: 'getroottermRequest'
12
- },
13
- response: {
14
- typeId: 'getroottermResponse'
15
- },
16
- examples: [
17
- {
18
- request: {
19
- body: {
20
- genome: 'hg38-test',
21
- dslabel: 'TermdbTest',
22
- embedder: 'localhost',
23
- default_rootterm: 1,
24
- cohortValues: 'ABC'
25
- }
26
- },
27
- response: {
28
- header: { status: 200 }
29
- }
30
- }
31
- ]
32
- },
33
- post: {
34
- alternativeFor: 'get',
35
- init
36
- }
37
- }
38
- }
39
-
40
- function init({ genomes }) {
41
- return async (req: any, res: any): Promise<void> => {
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
-
47
- try {
48
- const g = genomes[req.query.genome]
49
- if (!g) throw 'invalid genome name'
50
-
51
- const [ds, tdb] = get_ds_tdb(g, q)
52
- if (!ds) throw 'invalid dataset name'
53
- if (!tdb) throw 'invalid termdb object'
54
-
55
- await trigger_rootterm(q, res, tdb) // as getroottermResponse
56
- } catch (e) {
57
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
58
- // @ts-ignore
59
- res.send({ error: e?.message || e })
60
- if (e instanceof Error && e.stack) console.log(e)
61
- }
62
- }
63
- }
64
-
65
- async function trigger_rootterm(
66
- q: { cohortValues: any; treeFilter: any },
67
- res: { send: (arg0: { lst: any }) => void },
68
- tdb: { q: { getRootTerms: (arg0: any, arg1: any) => any } }
69
- ) {
70
- const cohortValues = q.cohortValues ? q.cohortValues : ''
71
- const treeFilter = q.treeFilter ? q.treeFilter : ''
72
- res.send({ lst: await tdb.q.getRootTerms(cohortValues, treeFilter) } as getroottermResponse)
73
- }
@@ -1,82 +0,0 @@
1
- import { gettermchildrenRequest, gettermchildrenResponse } from '#shared/types/routes/termdb.gettermchildren.ts'
2
- import { copy_term, get_ds_tdb } from '#src/termdb.js'
3
-
4
- export const api: any = {
5
- endpoint: 'termdb/termchildren',
6
- methods: {
7
- get: {
8
- init,
9
- request: {
10
- typeId: 'gettermchildrenRequest'
11
- },
12
- response: {
13
- typeId: 'gettermchildrenResponse'
14
- },
15
- examples: [
16
- {
17
- request: {
18
- body: {
19
- genome: 'hg38-test',
20
- dslabel: 'TermdbTest',
21
- embedder: 'localhost',
22
- get_children: 1,
23
- cohortValues: 'ABC',
24
- tid: 'GO:0000001'
25
- }
26
- },
27
- response: {
28
- header: { status: 200 }
29
- }
30
- }
31
- ]
32
- },
33
- post: {
34
- alternativeFor: 'get',
35
- init
36
- }
37
- }
38
- }
39
-
40
- function init({ genomes }) {
41
- return async (req: any, res: any): Promise<void> => {
42
- const q = req.query as gettermchildrenRequest
43
- try {
44
- const g = genomes[req.query.genome]
45
- if (!g) throw 'invalid genome name'
46
- const [ds, tdb] =await get_ds_tdb(g, q)
47
- if (!ds) throw 'invalid dataset name'
48
- if (!tdb) throw 'invalid termdb object'
49
-
50
-
51
- await trigger_children(q, res, tdb)
52
- } catch (e) {
53
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
54
- // @ts-ignore
55
- res.send({ error: e?.message || e })
56
- if (e instanceof Error && e.stack) console.log(e)
57
- }
58
- }
59
- }
60
-
61
- async function trigger_children(
62
- q: {
63
- genome?: string
64
- dslabel?: string
65
- embedder?: string
66
- get_children?: number
67
- tid: any
68
- cohortValues?: any
69
- treeFilter?: any
70
- },
71
- res: { send: (arg0: gettermchildrenResponse) => void },
72
- tdb: { q: { getTermChildren: (arg0: any, arg1: any, arg2: any) => any } }
73
- ) {
74
- /* get children terms
75
- may apply ssid: a premade sample set
76
- */
77
- if (!q.tid) throw 'no parent term id'
78
- const cohortValues = q.cohortValues ? q.cohortValues : ''
79
- const treeFilter = q.treeFilter ? q.treeFilter : ''
80
- const terms = await tdb.q.getTermChildren(q.tid, cohortValues, treeFilter)
81
- res.send({ lst: terms.map(copy_term) } as gettermchildrenResponse)
82
- }
@@ -1,87 +0,0 @@
1
- import fs from 'fs'
2
- import path from 'path'
3
- import { read_file } from '#src/utils.js'
4
- import serverconfig from '#src/serverconfig.js'
5
- import {
6
- TermdbSingleSampleMutationRequest,
7
- TermdbSingleSampleMutationResponse
8
- } from '#shared/types/routes/termdb.singleSampleMutation.ts'
9
- import { gdcValidate_query_singleSampleMutation } from '#src/mds3.gdc.js'
10
-
11
- export const api: any = {
12
- endpoint: 'termdb/singleSampleMutation',
13
- methods: {
14
- get: {
15
- init,
16
- request: {
17
- typeId: 'TermdbSingleSampleMutationRequest'
18
- },
19
- response: {
20
- typeId: 'TermdbSingleSampleMutationResponse'
21
- }
22
- }
23
- }
24
- }
25
-
26
- function init({ genomes }) {
27
- return async (req: any, res: any): Promise<void> => {
28
- const q: TermdbSingleSampleMutationRequest = req.query
29
- let result
30
- try {
31
- const g = genomes[q.genome]
32
- if (!g) throw 'invalid genome name'
33
- const ds = g.datasets[q.dslabel]
34
- if (!ds) throw 'invalid dataset name'
35
- if (!ds.queries?.singleSampleMutation) throw 'not supported on this dataset'
36
- result = (await ds.queries.singleSampleMutation.get(q)) as TermdbSingleSampleMutationResponse
37
- } catch (e: any) {
38
- if (e.stack) console.log(e.stack)
39
- result = {
40
- status: e.status || 400,
41
- error: e.message || e
42
- } as TermdbSingleSampleMutationResponse
43
- }
44
- res.send(result)
45
- }
46
- }
47
-
48
- /////////////////// ds query validator
49
- export async function validate_query_singleSampleMutation(ds: any, genome: any) {
50
- const _q = ds.queries.singleSampleMutation
51
- if (!_q) return
52
- if (_q.src == 'gdcapi') {
53
- gdcValidate_query_singleSampleMutation(ds, genome)
54
- } else if (_q.src == 'native') {
55
- // using a folder to store text files for individual samples
56
- // file names are integer sample id
57
- _q.get = async (q: TermdbSingleSampleMutationRequest) => {
58
- /* as mds3 client may not be using integer sample id for now,
59
- the argument is string id and has to be mapped to integer id
60
- */
61
- let fileName = q.sample
62
- if (ds.cohort?.termdb?.q?.sampleName2id) {
63
- // has name-to-id converter
64
- fileName = ds.cohort.termdb.q.sampleName2id(q.sample)
65
- if (fileName == undefined) {
66
- // unable to convert string id to integer
67
- return []
68
- }
69
- }
70
-
71
- const file = path.join(serverconfig.tpmasterdir, _q.folder, fileName.toString())
72
- try {
73
- await fs.promises.stat(file)
74
- } catch (e: any) {
75
- if (e.code == 'EACCES') throw 'cannot read file, permission denied'
76
- if (e.code == 'ENOENT') throw 'no data for this sample'
77
- throw 'failed to load data'
78
- }
79
-
80
- const data = await read_file(file)
81
- // object wraps around mlst[] so it's possible to add other attr e.g. total number of mutations that exceeds viewing limit
82
- return { mlst: JSON.parse(data) }
83
- }
84
- } else {
85
- throw 'unknown singleSampleMutation.src'
86
- }
87
- }
@@ -1,49 +0,0 @@
1
- import {
2
- TermdbSinglecellDataRequest,
3
- TermdbSinglecellDataResponse
4
- } from '#shared/types/routes/termdb.singlecellData.ts'
5
-
6
- /*
7
- given a sample, return it's singlecell data from dataset
8
- */
9
-
10
- export const api: any = {
11
- endpoint: 'termdb/singlecellData',
12
- methods: {
13
- get: {
14
- init,
15
- request: {
16
- typeId: 'TermdbSinglecellDataRequest'
17
- },
18
- response: {
19
- typeId: 'TermdbSinglecellDataResponse'
20
- }
21
- },
22
- post: {
23
- alternativeFor: 'get',
24
- init
25
- }
26
- }
27
- }
28
-
29
- function init({ genomes }) {
30
- return async (req: any, res: any): Promise<void> => {
31
- const q = req.query as TermdbSinglecellDataRequest
32
- let result
33
- try {
34
- const g = genomes[q.genome]
35
- if (!g) throw 'invalid genome name'
36
- const ds = g.datasets[q.dslabel]
37
- if (!ds) throw 'invalid dataset name'
38
- if (!ds.queries?.singleCell) throw 'no singlecell data on this dataset'
39
- result = (await ds.queries.singleCell.data.get(q)) as TermdbSinglecellDataResponse
40
- } catch (e: any) {
41
- if (e.stack) console.log(e)
42
- result = {
43
- status: e.status || 400,
44
- error: e.message || e
45
- } as TermdbSinglecellDataResponse
46
- }
47
- res.send(result)
48
- }
49
- }