@sjcrh/proteinpaint-server 2.30.2 → 2.30.4
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/gdc.maf.ts +5 -3
- package/routes/gdc.mafBuild.ts +5 -0
- package/server.js +1 -1
- package/src/serverconfig.js +11 -0
package/package.json
CHANGED
package/routes/gdc.maf.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { GdcMafResponse, File } from '#shared/types/routes/gdc.maf.ts'
|
|
2
|
-
import { fileSize } from '#shared/fileSize.js'
|
|
3
2
|
import path from 'path'
|
|
4
3
|
import got from 'got'
|
|
4
|
+
import serverconfig from '#src/serverconfig.js'
|
|
5
5
|
|
|
6
6
|
const apihost = process.env.PP_GDC_HOST || 'https://api.gdc.cancer.gov'
|
|
7
7
|
const maxFileNumber = 1000
|
|
8
8
|
const allowedWorkflowType = 'Aliquot Ensemble Somatic Variant Merging and Masking'
|
|
9
9
|
const allowedExpStrategy = new Set(['WXS', 'Targeted Sequencing'])
|
|
10
|
+
const maxTotalSizeCompressed = serverconfig.features.gdcMafMaxFileSize || 50000000 // 50Mb
|
|
10
11
|
|
|
11
12
|
export const api = {
|
|
12
13
|
endpoint: 'gdc/maf',
|
|
@@ -146,7 +147,7 @@ async function listMafFiles(req: any) {
|
|
|
146
147
|
const file = {
|
|
147
148
|
id: h.id,
|
|
148
149
|
project_id: c.project.project_id,
|
|
149
|
-
file_size:
|
|
150
|
+
file_size: h.file_size
|
|
150
151
|
} as File
|
|
151
152
|
|
|
152
153
|
file.case_submitter_id = c.submitter_id
|
|
@@ -161,7 +162,8 @@ async function listMafFiles(req: any) {
|
|
|
161
162
|
|
|
162
163
|
const result = {
|
|
163
164
|
files,
|
|
164
|
-
filesTotal: re.data.pagination.total
|
|
165
|
+
filesTotal: re.data.pagination.total,
|
|
166
|
+
maxTotalSizeCompressed
|
|
165
167
|
} as GdcMafResponse
|
|
166
168
|
|
|
167
169
|
return result
|
package/routes/gdc.mafBuild.ts
CHANGED
|
@@ -42,7 +42,10 @@ req.query {
|
|
|
42
42
|
res{}
|
|
43
43
|
*/
|
|
44
44
|
async function buildMaf(req: any, res: any) {
|
|
45
|
+
const t0 = new Date()
|
|
46
|
+
|
|
45
47
|
const fileLst2 = (await getFileLstUnderSizeLimit(req.query.fileIdLst)) as string[]
|
|
48
|
+
console.log('test gdc maf sizes', new Date() - t0)
|
|
46
49
|
|
|
47
50
|
const outFile = path.join(serverconfig.cachedir, 'gdcMaf.' + Math.random().toString()) // should be a gzipped file. does it need to end with '.gz' or it's auto-added?
|
|
48
51
|
|
|
@@ -54,6 +57,8 @@ async function buildMaf(req: any, res: any) {
|
|
|
54
57
|
|
|
55
58
|
await run_rust('gdcmaf', JSON.stringify(arg))
|
|
56
59
|
|
|
60
|
+
console.log('rust gdcmaf', new Date() - t0)
|
|
61
|
+
|
|
57
62
|
const data = await fs.promises.readFile(outFile)
|
|
58
63
|
|
|
59
64
|
// by directly returning a blob, it won't tell client how many files are used
|