@sjcrh/proteinpaint-server 2.109.0 → 2.109.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.
- package/dataset/termdb.test.js +7 -12
- package/package.json +7 -6
- package/routes/termdb.cluster.js +8 -3
- package/routes/termdb.singleSampleMutation.js +1 -8
- package/routes/termdb.violin.js +1 -1
- package/src/app.js +58 -47
- package/src/serverconfig.js +14 -8
package/dataset/termdb.test.js
CHANGED
|
@@ -7,18 +7,13 @@ var termdb_test_default = {
|
|
|
7
7
|
cohort: {
|
|
8
8
|
massNav: {
|
|
9
9
|
tabs: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
// },
|
|
18
|
-
// charts: {
|
|
19
|
-
// top: 'test charts',
|
|
20
|
-
// mid: 'mid test'
|
|
21
|
-
// }
|
|
10
|
+
about: {
|
|
11
|
+
dataRelease: {
|
|
12
|
+
version: "?",
|
|
13
|
+
link: "testLink"
|
|
14
|
+
},
|
|
15
|
+
additionalInfo: "<a href=testLink>Tutorial</a> <a href=testLink>Get help</a>"
|
|
16
|
+
}
|
|
22
17
|
}
|
|
23
18
|
},
|
|
24
19
|
db: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjcrh/proteinpaint-server",
|
|
3
|
-
"version": "2.109.
|
|
3
|
+
"version": "2.109.1",
|
|
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",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dev": "npm run start",
|
|
18
18
|
"prestart": "tsx emitImports.js dev > server.js",
|
|
19
19
|
"start": "tsx watch . /start.js",
|
|
20
|
-
"test:unit": "tsx emitImports.js unit > serverTests.js && tsx serverTests.js && rm -rf ./cache",
|
|
20
|
+
"test:unit": "tsx emitImports.js unit > serverTests.js && c8 tsx serverTests.js && rm -rf ./cache",
|
|
21
21
|
"getconf": "../build/getConfigProp.js",
|
|
22
22
|
"doc": "../augen/build.sh routes shared/types/routes shared/checkers ../public/docs/server",
|
|
23
23
|
"mjs": "esbuild \"$DIR/*.ts\" --platform=node --outdir=\"$DIR\" --format=esm",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@types/tough-cookie": "^4.0.5",
|
|
47
47
|
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
|
48
48
|
"babel-loader": "^8.2.2",
|
|
49
|
+
"c8": "^10.1.3",
|
|
49
50
|
"esbuild": "^0.19.12",
|
|
50
51
|
"glob": "^10.4.5",
|
|
51
52
|
"node-watch": "^0.7.1",
|
|
@@ -58,10 +59,10 @@
|
|
|
58
59
|
"typescript": "^5.6.3"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
|
-
"@sjcrh/augen": "2.
|
|
62
|
+
"@sjcrh/augen": "2.109.1-0",
|
|
62
63
|
"@sjcrh/proteinpaint-rust": "2.99.0",
|
|
63
|
-
"@sjcrh/proteinpaint-shared": "2.109.
|
|
64
|
-
"@sjcrh/proteinpaint-types": "2.109.
|
|
64
|
+
"@sjcrh/proteinpaint-shared": "2.109.1",
|
|
65
|
+
"@sjcrh/proteinpaint-types": "2.109.1",
|
|
65
66
|
"@types/express": "^5.0.0",
|
|
66
67
|
"@types/express-session": "^1.18.1",
|
|
67
68
|
"better-sqlite3": "^9.4.1",
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
"ky": "^1.2.1",
|
|
83
84
|
"lazy": "^1.0.11",
|
|
84
85
|
"micromatch": "^4.0.5",
|
|
85
|
-
"minimatch": "^
|
|
86
|
+
"minimatch": "^10.0.1",
|
|
86
87
|
"node-fetch": "^2.6.1",
|
|
87
88
|
"partjson": "^0.58.2",
|
|
88
89
|
"redis": "^4.7.0",
|
package/routes/termdb.cluster.js
CHANGED
|
@@ -10,6 +10,7 @@ import { getResult as getResultGene } from "#src/gene.js";
|
|
|
10
10
|
import { TermTypes, NUMERIC_DICTIONARY_TERM } from "#shared/terms.js";
|
|
11
11
|
import { getData } from "#src/termdb.matrix.js";
|
|
12
12
|
import { termType2label } from "#shared/terms.js";
|
|
13
|
+
import { mayLog } from "#src/helpers.ts";
|
|
13
14
|
const api = {
|
|
14
15
|
endpoint: "termdb/cluster",
|
|
15
16
|
methods: {
|
|
@@ -74,8 +75,10 @@ async function getResult(q, ds, genome) {
|
|
|
74
75
|
;
|
|
75
76
|
({ term2sample2value, byTermId, bySampleId } = await ds.queries[q.dataType].get(_q));
|
|
76
77
|
}
|
|
78
|
+
const removedHierClusterTerms = [];
|
|
77
79
|
for (const [term, obj] of term2sample2value) {
|
|
78
80
|
if (Object.keys(obj).length === 0) {
|
|
81
|
+
removedHierClusterTerms.push(term);
|
|
79
82
|
term2sample2value.delete(term);
|
|
80
83
|
delete byTermId[term];
|
|
81
84
|
}
|
|
@@ -88,9 +91,11 @@ async function getResult(q, ds, genome) {
|
|
|
88
91
|
}
|
|
89
92
|
const t = Date.now();
|
|
90
93
|
const clustering = await doClustering(term2sample2value, q, Object.keys(bySampleId).length);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
+
mayLog("clustering done:", Date.now() - t, "ms");
|
|
95
|
+
const result = { clustering, byTermId, bySampleId };
|
|
96
|
+
if (removedHierClusterTerms.length)
|
|
97
|
+
result.removedHierClusterTerms = removedHierClusterTerms;
|
|
98
|
+
return result;
|
|
94
99
|
}
|
|
95
100
|
async function getNumericDictTermAnnotation(q, ds, genome) {
|
|
96
101
|
const getDataArgs = {
|
|
@@ -46,14 +46,7 @@ async function validate_query_singleSampleMutation(ds, genome) {
|
|
|
46
46
|
gdcValidate_query_singleSampleMutation(ds, genome);
|
|
47
47
|
} else if (_q.src == "native") {
|
|
48
48
|
_q.get = async (q) => {
|
|
49
|
-
|
|
50
|
-
if (ds.cohort?.termdb?.q?.sampleName2id) {
|
|
51
|
-
fileName = ds.cohort.termdb.q.sampleName2id(q.sample);
|
|
52
|
-
if (fileName == void 0) {
|
|
53
|
-
return [];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
const file = path.join(serverconfig.tpmasterdir, _q.folder, fileName.toString());
|
|
49
|
+
const file = path.join(serverconfig.tpmasterdir, _q.folder, q.sample);
|
|
57
50
|
try {
|
|
58
51
|
await fs.promises.stat(file);
|
|
59
52
|
} catch (e) {
|
package/routes/termdb.violin.js
CHANGED
|
@@ -220,7 +220,7 @@ function createCanvasImg(q, result, ds) {
|
|
|
220
220
|
ctx.stroke();
|
|
221
221
|
});
|
|
222
222
|
plot.src = canvas.toDataURL();
|
|
223
|
-
plot.density = getBinsDensity(
|
|
223
|
+
plot.density = getBinsDensity(plot, q.isKDE, q.ticks);
|
|
224
224
|
plot.summaryStats = summaryStats(plot.values).values;
|
|
225
225
|
delete plot.values;
|
|
226
226
|
}
|