@sjcrh/proteinpaint-server 2.27.1 → 2.28.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/cards/hic.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "ribbonMessage": "Versions 7, 8 and 9 Hi-C files are accepted.",
2
+ "ribbonMessage": "Versions 7, 8 and 9 Hi-C files are accepted.<br> See the new example for displaying a hic data across two chromosomes.",
3
3
  "ppcalls": [
4
4
  {
5
5
  "label": "Hi-C",
@@ -12,19 +12,61 @@
12
12
  "genome": "hg19",
13
13
  "position": "chr7:13749862-20841903",
14
14
  "nativetracks": "RefGene",
15
- "tracks": [{
16
- "type": "hicstraw",
17
- "file": "proteinpaint_demo/hg19/hic/hic_demo.hic",
18
- "name": "Hi-C Demo",
19
- "percentile_max": 95,
20
- "mincutoff": 1,
21
- "pyramidup": 1,
22
- "enzyme": "MboI",
23
- "normalizationmethod":"VC"
24
- }]
15
+ "tracks": [
16
+ {
17
+ "type": "hicstraw",
18
+ "file": "proteinpaint_demo/hg19/hic/hic_demo.hic",
19
+ "name": "Hi-C Demo",
20
+ "percentile_max": 95,
21
+ "mincutoff": 1,
22
+ "pyramidup": 1,
23
+ "enzyme": "MboI",
24
+ "normalizationmethod": "VC"
25
+ }
26
+ ]
25
27
  },
26
28
  "testSpec": {
27
- "expected": {"image": 1 }
29
+ "expected": {
30
+ "image": 1
31
+ }
32
+ }
33
+ },
34
+ {
35
+ "label": "Two chromosome view",
36
+ "runargs": {
37
+ "parseurl": true,
38
+ "block": true,
39
+ "nobox": true,
40
+ "noheader": true,
41
+ "genome": "hg19",
42
+ "position": "chr8:128688997-128888997",
43
+ "nativetracks": "RefGene",
44
+ "width": 300,
45
+ "subpanels": [
46
+ {
47
+ "chr": "chr4",
48
+ "start": 174408608,
49
+ "stop": 175268609,
50
+ "width": 600,
51
+ "leftborder": "rgba(200,0,0,.1)"
52
+ }
53
+ ],
54
+ "tracks": [
55
+ {
56
+ "type": "hicstraw",
57
+ "file": "files/hg19/nbl-hic/hic_NB69.inter.hic",
58
+ "name": "SJNBL046418_C1/NB69 Hi-C",
59
+ "percentile_max": 95,
60
+ "mincutoff": 1,
61
+ "pyramidup": 1,
62
+ "enzyme": "MboI"
63
+ }
64
+ ]
65
+ },
66
+ "testSpec": {
67
+ "expected": {
68
+ "image": 1
69
+ }
28
70
  }
29
71
  }
30
72
  ],
@@ -34,4 +76,4 @@
34
76
  "link": "https://docs.google.com/document/d/1MQ0Z_AD5moDmaSx2tcn7DyVKGp49TS63pO0cceGL_Ns/edit"
35
77
  }
36
78
  ]
37
- }
79
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjcrh/proteinpaint-server",
3
- "version": "2.27.1",
3
+ "version": "2.28.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",
@@ -74,7 +74,7 @@
74
74
  "micromatch": "^4.0.5",
75
75
  "minimatch": "^3.1.2",
76
76
  "node-fetch": "^2.6.1",
77
- "partjson": "^0.58.1",
77
+ "partjson": "^0.58.2",
78
78
  "tiny-async-pool": "^1.2.0",
79
79
  "typedoc-plugin-missing-exports": "^2.0.1"
80
80
  },
@@ -0,0 +1,80 @@
1
+ // import { getgetCategoriesRequest, getgetCategoriesResponse } from '#shared/types/routes/termdb.getCategories'
2
+ import { trigger_getcategories } from '#src/termdb.js'
3
+
4
+ export const api: any = {
5
+ endpoint: 'termdb/getCategories',
6
+ methods: {
7
+ get: {
8
+ init,
9
+ request: {
10
+ typeId: 'getgetCategoriesRequest'
11
+ },
12
+ response: {
13
+ typeId: 'getgetCategoriesResponse'
14
+ },
15
+ examples: [
16
+ {
17
+ request: {
18
+ body: {
19
+ genome: 'hg38-test',
20
+ dslabel: 'TermdbTest',
21
+ embedder: 'localhost',
22
+ getcategories: 1,
23
+ tid: 'diaggrp',
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
+ post: {
55
+ alternativeFor: 'get',
56
+ init
57
+ }
58
+ }
59
+ }
60
+
61
+ function init({ genomes }) {
62
+ return async (req: any, res: any): Promise<void> => {
63
+ const q = req.query // as getgetCategoriesRequest
64
+ try {
65
+ const g = genomes[req.query.genome]
66
+ const ds = g.datasets[req.query.dslabel]
67
+ const tdb = ds.cohort.termdb
68
+
69
+ if (!g) throw 'invalid genome name'
70
+ if (!ds) throw 'invalid dataset name'
71
+ if (!tdb) throw 'invalid termdb object'
72
+ await trigger_getcategories(q, res, tdb, ds, g) // as getgetCategoriesResponse
73
+ } catch (e) {
74
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
75
+ // @ts-ignore
76
+ res.send({ error: e?.message || e })
77
+ if (e instanceof Error && e.stack) console.log(e)
78
+ }
79
+ }
80
+ }
@@ -1,5 +1,5 @@
1
- import { trigger_getViolinPlotData } from '#src/termdb.violin.js'
2
1
  // import { getViolinRequest, getViolinResponse } from '#shared/types/routes/termdb.violin'
2
+ import { trigger_getViolinPlotData } from '#src/termdb.violin.js'
3
3
 
4
4
  export const api: any = {
5
5
  endpoint: 'termdb/violin',