@sjcrh/proteinpaint-server 2.137.2-0 → 2.137.2-2
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 +1 -1
- package/package.json +3 -3
- package/routes/profileFormScores.js +4 -2
- package/routes/profileScores.js +3 -4
- package/routes/termdb.config.js +2 -1
- package/src/app.js +28 -18
package/dataset/termdb.test.js
CHANGED
|
@@ -141,7 +141,7 @@ function termdb_test_default() {
|
|
|
141
141
|
{
|
|
142
142
|
chartType: "barchart",
|
|
143
143
|
term: { id: "diaggrp" },
|
|
144
|
-
settings: { barchart: { colorBars: true, showPercent: true } }
|
|
144
|
+
settings: { barchart: { colorBars: true, showPercent: true, colorUsing: "generated" } }
|
|
145
145
|
}
|
|
146
146
|
]
|
|
147
147
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjcrh/proteinpaint-server",
|
|
3
|
-
"version": "2.137.2-
|
|
3
|
+
"version": "2.137.2-2",
|
|
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",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"@sjcrh/proteinpaint-python": "2.135.2-0",
|
|
64
64
|
"@sjcrh/proteinpaint-r": "2.137.2-0",
|
|
65
65
|
"@sjcrh/proteinpaint-rust": "2.137.2-0",
|
|
66
|
-
"@sjcrh/proteinpaint-shared": "2.137.
|
|
67
|
-
"@sjcrh/proteinpaint-types": "2.137.2-
|
|
66
|
+
"@sjcrh/proteinpaint-shared": "2.137.2-2",
|
|
67
|
+
"@sjcrh/proteinpaint-types": "2.137.2-2",
|
|
68
68
|
"@types/express": "^5.0.0",
|
|
69
69
|
"@types/express-session": "^1.18.1",
|
|
70
70
|
"better-sqlite3": "^9.4.1",
|
|
@@ -29,7 +29,7 @@ function init({ genomes }) {
|
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
async function getScoresDict(query, ds, genome) {
|
|
32
|
-
const terms = [...query.scoreTerms];
|
|
32
|
+
const terms = [...query.scoreTerms, query.facilityTW];
|
|
33
33
|
if (query.scScoreTerms)
|
|
34
34
|
terms.push(...query.scScoreTerms);
|
|
35
35
|
const data = await getData(
|
|
@@ -70,7 +70,9 @@ async function getScoresDict(query, ds, genome) {
|
|
|
70
70
|
const percents = getSCPercentsDict(d, samples2);
|
|
71
71
|
term2Score[d.term.id] = percents;
|
|
72
72
|
}
|
|
73
|
-
const
|
|
73
|
+
const facilityValue = sampleData?.[query.facilityTW.$id];
|
|
74
|
+
const termValue = query.facilityTW.term.values[facilityValue?.value];
|
|
75
|
+
const hospital = termValue?.label || termValue?.key;
|
|
74
76
|
return { term2Score, sites, hospital, n: sampleData ? 1 : samples.length };
|
|
75
77
|
}
|
|
76
78
|
function getDict(key, sample) {
|
package/routes/profileScores.js
CHANGED
|
@@ -49,9 +49,6 @@ async function getScores(query, ds, genome) {
|
|
|
49
49
|
let sites = lst.map((s) => {
|
|
50
50
|
return { label: data.refs.bySampleId[s.sample].label, value: s.sample };
|
|
51
51
|
});
|
|
52
|
-
sites = lst.map((s) => {
|
|
53
|
-
return { label: data.refs.bySampleId[s.sample].label, value: s.sample };
|
|
54
|
-
});
|
|
55
52
|
if (query.userSites) {
|
|
56
53
|
sites = sites.filter((s) => query.userSites.includes(s.label));
|
|
57
54
|
}
|
|
@@ -70,7 +67,9 @@ async function getScores(query, ds, genome) {
|
|
|
70
67
|
for (const d of query.scoreTerms) {
|
|
71
68
|
term2Score[d.score.term.id] = getPercentage(d, samples, sampleData);
|
|
72
69
|
}
|
|
73
|
-
const
|
|
70
|
+
const facilityValue = sampleData?.[query.facilityTW.$id];
|
|
71
|
+
const termValue = query.facilityTW.term.values[facilityValue?.value];
|
|
72
|
+
const hospital = termValue?.label || termValue?.key;
|
|
74
73
|
return { term2Score, sites, hospital, n: sampleData ? 1 : samples.length };
|
|
75
74
|
}
|
|
76
75
|
function getPercentage(d, samples, sampleData) {
|
package/routes/termdb.config.js
CHANGED
|
@@ -61,7 +61,8 @@ function make(q, req, res, ds, genome) {
|
|
|
61
61
|
hasSampleAncestry: ds.cohort.termdb.hasSampleAncestry,
|
|
62
62
|
defaultChartType: ds.cohort.defaultChartType,
|
|
63
63
|
invalidTokenErrorHandling: tdb.invalidTokenErrorHandling,
|
|
64
|
-
colorMap: tdb.colorMap
|
|
64
|
+
colorMap: tdb.colorMap,
|
|
65
|
+
defaultTw4correlationPlot: tdb.defaultTw4correlationPlot
|
|
65
66
|
};
|
|
66
67
|
if (tdb.plotConfigByCohort)
|
|
67
68
|
c.plotConfigByCohort = tdb.plotConfigByCohort;
|