@sjcrh/proteinpaint-server 2.87.1 → 2.88.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/package.json +2 -2
- package/routes/termdb.config.js +0 -1
- package/routes/termdb.singlecellSamples.js +13 -4
- package/src/app.js +475 -467
- package/utils/regression.utils.R +32 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjcrh/proteinpaint-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.88.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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@sjcrh/augen": "2.87.0",
|
|
62
62
|
"@sjcrh/proteinpaint-rust": "2.84.0",
|
|
63
63
|
"@sjcrh/proteinpaint-shared": "2.87.1",
|
|
64
|
-
"@sjcrh/proteinpaint-types": "2.
|
|
64
|
+
"@sjcrh/proteinpaint-types": "2.88.0",
|
|
65
65
|
"better-sqlite3": "^9.4.1",
|
|
66
66
|
"body-parser": "^1.15.2",
|
|
67
67
|
"canvas": "~2.11.2",
|
package/routes/termdb.config.js
CHANGED
|
@@ -44,7 +44,6 @@ function make(q, res, ds, genome) {
|
|
|
44
44
|
selectCohort: tdb.selectCohort,
|
|
45
45
|
// optional
|
|
46
46
|
supportedChartTypes: tdb.q?.getSupportedChartTypes(auth),
|
|
47
|
-
hiddenChartTypes: ds.cohort.hiddenChartTypes,
|
|
48
47
|
renamedChartTypes: ds.cohort.renamedChartTypes,
|
|
49
48
|
allowedTermTypes: getAllowedTermTypes(ds),
|
|
50
49
|
termMatch2geneSet: tdb.termMatch2geneSet,
|
|
@@ -2,6 +2,7 @@ import fs from "fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { read_file } from "#src/utils.js";
|
|
4
4
|
import run_R from "#src/run_R.js";
|
|
5
|
+
import { joinUrl, mayLog } from "#src/helpers.ts";
|
|
5
6
|
import { run_rust } from "@sjcrh/proteinpaint-rust";
|
|
6
7
|
import serverconfig from "#src/serverconfig.js";
|
|
7
8
|
import { termdbSingleCellSamplesPayload } from "#types/checkers";
|
|
@@ -226,17 +227,25 @@ function gdc_validateGeneExpression(G, ds, genome) {
|
|
|
226
227
|
G.sample2gene2expressionBins = {};
|
|
227
228
|
G.get = async (q) => {
|
|
228
229
|
try {
|
|
229
|
-
const uuid = ds.__gdc.map2caseid.get(q.sample.sID);
|
|
230
230
|
const fileid = q.sample.eID;
|
|
231
|
+
const hdf5id = ds.__gdc.scrnaAnalysis2hdf5.get(fileid);
|
|
232
|
+
if (!hdf5id)
|
|
233
|
+
throw "cannot map eID to hdf5 id";
|
|
231
234
|
const aliasLst = genome.genedb.getAliasByName.all(q.gene);
|
|
232
235
|
const gencodeId = aliasLst.find((a) => a?.alias.toUpperCase().startsWith("ENSG"))?.alias;
|
|
236
|
+
if (!gencodeId)
|
|
237
|
+
throw "cannot map gene symbol to GENCODE";
|
|
233
238
|
const body = {
|
|
234
|
-
case_id: uuid,
|
|
235
239
|
gene_ids: [gencodeId],
|
|
236
|
-
file_id:
|
|
240
|
+
file_id: hdf5id
|
|
237
241
|
};
|
|
238
242
|
const { host } = ds.getHostHeaders(q);
|
|
239
|
-
const
|
|
243
|
+
const t = Date.now();
|
|
244
|
+
const response = await ky.post(joinUrl(host.rest, "scrna_seq/gene_expression"), { timeout: false, json: body });
|
|
245
|
+
if (!response.ok)
|
|
246
|
+
throw `HTTP Error: ${response.status} ${response.statusText}`;
|
|
247
|
+
const out = await response.json();
|
|
248
|
+
mayLog("gdc scrna gene exp", q.gene, Date.now() - t);
|
|
240
249
|
const result = out.data[0].cells;
|
|
241
250
|
const data = {};
|
|
242
251
|
for (const r of result) {
|