@sjcrh/proteinpaint-server 2.48.1 → 2.49.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 +3 -3
- package/routes/burden.js +4 -7
- package/routes/termdb.cluster.js +4 -6
- package/src/app.js +201 -240
- package/src/run_R.js +66 -0
- package/utils/burden.R +10 -7
- package/utils/cuminc.R +25 -11
- package/utils/hclust.R +8 -6
- package/utils/lowess.R +4 -4
- package/utils/regression.R +8 -10
- package/utils/survival.R +8 -8
- package/src/lines2R.js +0 -62
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjcrh/proteinpaint-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.49.0",
|
|
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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@sjcrh/augen": "2.46.0",
|
|
64
|
-
"@sjcrh/proteinpaint-rust": "2.
|
|
64
|
+
"@sjcrh/proteinpaint-rust": "2.49.0",
|
|
65
65
|
"better-sqlite3": "^9.4.1",
|
|
66
66
|
"body-parser": "^1.15.2",
|
|
67
67
|
"canvas": "~2.11.2",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"start.js",
|
|
98
98
|
"src/app.js",
|
|
99
99
|
"src/serverconfig.js",
|
|
100
|
-
"src/
|
|
100
|
+
"src/run_R.js",
|
|
101
101
|
"src/mds3.gdc.filter.js",
|
|
102
102
|
"src/checkReadingFrame.js",
|
|
103
103
|
"src/bedj.parseBed.js",
|
package/routes/burden.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import run_R from "#src/run_R.js";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import serverconfig from "#src/serverconfig.js";
|
|
4
|
-
import { write_file } from "#src/utils.js";
|
|
5
4
|
const api = {
|
|
6
5
|
endpoint: "burden",
|
|
7
6
|
methods: {
|
|
@@ -69,23 +68,21 @@ const api = {
|
|
|
69
68
|
}
|
|
70
69
|
};
|
|
71
70
|
async function getBurdenEstimates(q, ds) {
|
|
72
|
-
const infile = path.join(serverconfig.cachedir, Math.random().toString() + ".json");
|
|
73
71
|
for (const k in q.query) {
|
|
74
72
|
q.query[k] = Number(q.query[k]);
|
|
75
73
|
}
|
|
76
74
|
const data = Object.assign({}, defaults, q.query);
|
|
77
|
-
await write_file(infile, JSON.stringify(data));
|
|
78
75
|
const { fit, surv, sample } = ds.cohort.cumburden.files;
|
|
79
76
|
if (!fit || !surv || !sample)
|
|
80
77
|
throw `missing one or more of ds.cohort.burden.files.{fit, surv, sample}`;
|
|
81
78
|
const args = [
|
|
82
|
-
infile,
|
|
83
79
|
`${serverconfig.tpmasterdir}/${fit}`,
|
|
84
80
|
`${serverconfig.tpmasterdir}/${surv}`,
|
|
85
81
|
`${serverconfig.tpmasterdir}/${sample}`
|
|
86
82
|
];
|
|
87
|
-
const
|
|
88
|
-
|
|
83
|
+
const estimates = JSON.parse(
|
|
84
|
+
await run_R(path.join(serverconfig.binpath, "utils", "burden.R"), JSON.stringify(data), args)
|
|
85
|
+
);
|
|
89
86
|
return estimates;
|
|
90
87
|
}
|
|
91
88
|
function formatPayload(estimates) {
|
package/routes/termdb.cluster.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
import
|
|
3
|
-
import lines2R from "#src/lines2R.js";
|
|
2
|
+
import run_R from "#src/run_R.js";
|
|
4
3
|
import * as utils from "#src/utils.js";
|
|
5
4
|
import serverconfig from "#src/serverconfig.js";
|
|
6
5
|
import { gdc_validate_query_geneExpression } from "#src/mds3.gdc.js";
|
|
@@ -90,10 +89,9 @@ async function doClustering(data, q) {
|
|
|
90
89
|
}
|
|
91
90
|
inputData.matrix.push(getZscore(row));
|
|
92
91
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
await fs.promises.unlink(Rinputfile);
|
|
92
|
+
const Routput = JSON.parse(
|
|
93
|
+
await run_R(path.join(serverconfig.binpath, "utils", "hclust.R"), JSON.stringify(inputData))
|
|
94
|
+
);
|
|
97
95
|
const row_names_index = Routput.RowOrder.map((row) => inputData.row_names.indexOf(row.name));
|
|
98
96
|
const col_names_index = Routput.ColOrder.map((col) => inputData.col_names.indexOf(col.name));
|
|
99
97
|
const output_matrix = [];
|