@sjcrh/proteinpaint-server 2.138.2 → 2.138.3-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/dataset/protected.test.js +13 -0
- package/dataset/termdb.test.js +0 -1
- package/package.json +2 -2
- package/routes/samplewsimages.js +17 -10
- package/src/app.js +150 -100
- package/src/serverconfig.js +46 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import termdbTestInit from "./termdb.test.ts";
|
|
2
|
+
function protected_test_default() {
|
|
3
|
+
const ds = termdbTestInit();
|
|
4
|
+
if (!ds.cohort)
|
|
5
|
+
ds.cohort = { termdb: {} };
|
|
6
|
+
ds.cohort.termdb.hasMinSampleSize = (sampleCount) => {
|
|
7
|
+
return sampleCount >= 10;
|
|
8
|
+
};
|
|
9
|
+
return ds;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
protected_test_default as default
|
|
13
|
+
};
|
package/dataset/termdb.test.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjcrh/proteinpaint-server",
|
|
3
|
-
"version": "2.138.
|
|
3
|
+
"version": "2.138.3-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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@sjcrh/proteinpaint-r": "2.137.2-0",
|
|
65
65
|
"@sjcrh/proteinpaint-rust": "2.137.2-0",
|
|
66
66
|
"@sjcrh/proteinpaint-shared": "2.137.3",
|
|
67
|
-
"@sjcrh/proteinpaint-types": "2.138.
|
|
67
|
+
"@sjcrh/proteinpaint-types": "2.138.3-0",
|
|
68
68
|
"@types/express": "^5.0.0",
|
|
69
69
|
"@types/express-session": "^1.18.1",
|
|
70
70
|
"better-sqlite3": "^9.4.1",
|
package/routes/samplewsimages.js
CHANGED
|
@@ -49,24 +49,31 @@ function init({ genomes }) {
|
|
|
49
49
|
const featClass = ds.queries.WSImages?.classes?.find((f) => f.id == d.properties.class)?.label || d.properties.class;
|
|
50
50
|
return {
|
|
51
51
|
zoomCoordinates: d.properties.zoomCoordinates,
|
|
52
|
-
type: d.properties.type,
|
|
53
52
|
uncertainty: d.properties.uncertainty,
|
|
54
53
|
class: featClass
|
|
55
54
|
};
|
|
56
|
-
});
|
|
55
|
+
}).slice(15, 20);
|
|
57
56
|
wsimage.classes = ds.queries?.WSImages?.classes;
|
|
58
57
|
wsimage.uncertainty = ds.queries?.WSImages?.uncertainty;
|
|
59
|
-
wsimage.activePatchColor = ds.queries?.WSImages?.activePatchColor
|
|
58
|
+
wsimage.activePatchColor = ds.queries?.WSImages?.activePatchColor;
|
|
60
59
|
}
|
|
61
|
-
if (ds.queries.WSImages.
|
|
62
|
-
const
|
|
60
|
+
if (ds.queries.WSImages.getWSIPredictionPatches) {
|
|
61
|
+
const predictionsFile = await ds.queries.WSImages.getWSIPredictionPatches(sampleId, wsimage.filename);
|
|
62
|
+
const predictionsFilePath = path.join(
|
|
63
|
+
serverconfig.tpmasterdir,
|
|
64
|
+
ds.queries.WSImages.imageBySampleFolder,
|
|
63
65
|
sampleId,
|
|
64
|
-
|
|
65
|
-
query.index
|
|
66
|
+
predictionsFile[0]
|
|
66
67
|
);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
const predictionsData = JSON.parse(fs.readFileSync(predictionsFilePath, "utf8"));
|
|
69
|
+
wsimage.predictions = predictionsData.features.map((d) => {
|
|
70
|
+
const featClass = ds.queries.WSImages?.classes?.find((f) => f.id == d.properties.class)?.label || d.properties.class;
|
|
71
|
+
return {
|
|
72
|
+
zoomCoordinates: d.properties.zoomCoordinates,
|
|
73
|
+
uncertainty: d.properties.uncertainty,
|
|
74
|
+
class: featClass
|
|
75
|
+
};
|
|
76
|
+
}).slice(0, 15);
|
|
70
77
|
}
|
|
71
78
|
}
|
|
72
79
|
}
|