@sjcrh/proteinpaint-server 2.121.0 → 2.121.1-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 +1 -1
- package/routes/genesetEnrichment.js +9 -2
- package/src/app.js +185 -63
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ import path from "path";
|
|
|
4
4
|
import serverconfig from "#src/serverconfig.js";
|
|
5
5
|
import { run_python } from "@sjcrh/proteinpaint-python";
|
|
6
6
|
import { mayLog } from "#src/helpers.ts";
|
|
7
|
+
import { DeleteCacheFiles } from "#src/DeleteCacheFiles.ts";
|
|
7
8
|
const api = {
|
|
8
9
|
endpoint: "genesetEnrichment",
|
|
9
10
|
methods: {
|
|
@@ -47,13 +48,19 @@ function init({ genomes }) {
|
|
|
47
48
|
async function run_genesetEnrichment_analysis(q, genomes) {
|
|
48
49
|
if (!genomes[q.genome].termdbs)
|
|
49
50
|
throw "termdb database is not available for " + q.genome;
|
|
51
|
+
const cache = new DeleteCacheFiles({
|
|
52
|
+
cachedir: serverconfig.cachedir_gsea,
|
|
53
|
+
fileExtensions: [".pkl"],
|
|
54
|
+
maxSize: 1e6
|
|
55
|
+
});
|
|
56
|
+
await cache.mayResetCacheCheckTimeout(cache.checkWait);
|
|
50
57
|
const genesetenrichment_input = {
|
|
51
58
|
genes: q.genes,
|
|
52
59
|
fold_change: q.fold_change,
|
|
53
60
|
db: genomes[q.genome].termdbs.msigdb.cohort.db.connection.name,
|
|
54
61
|
// For now msigdb has been added, but later databases other than msigdb may be used
|
|
55
62
|
geneset_group: q.geneSetGroup,
|
|
56
|
-
cachedir: serverconfig.
|
|
63
|
+
cachedir: serverconfig.cachedir_gsea,
|
|
57
64
|
geneset_name: q.geneset_name,
|
|
58
65
|
pickle_file: q.pickle_file,
|
|
59
66
|
num_permutations: q.num_permutations,
|
|
@@ -78,7 +85,7 @@ async function run_genesetEnrichment_analysis(q, genomes) {
|
|
|
78
85
|
if (data_found)
|
|
79
86
|
return result;
|
|
80
87
|
if (image_found)
|
|
81
|
-
return path.join(serverconfig.
|
|
88
|
+
return path.join(serverconfig.cachedir_gsea, result.image_file);
|
|
82
89
|
throw "data or image not found in gsea output; this should not happen";
|
|
83
90
|
}
|
|
84
91
|
export {
|