Skip to content

Commit da13987

Browse files
Merge pull request #150 from bcgsc/release/v7.4.0
v7.4.0
2 parents 6fdd491 + f6f33ca commit da13987

27 files changed

+239
-139
lines changed

app/api/graphkb.js

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -59,48 +59,6 @@ const graphkbAutocomplete = async (targetType, graphkbToken, keyword = null) =>
5959
});
6060
};
6161

62-
/**
63-
* Get review status of entries from GraphKB
64-
*
65-
* @param {string} graphkbToken the Authorization token for the connection to GraphKB
66-
* @param {array} graphkbEntries array of graphkb results from IPR database
67-
*
68-
* @returns {object} response body from graphkb
69-
*/
70-
const graphkbReviewStatus = async (graphkbToken, graphkbEntries) => {
71-
const {uri} = CONFIG.get('graphkb');
72-
73-
const filters = {
74-
'@rid': graphkbEntries
75-
.reduce((filtered, {kbStatementId}) => {
76-
if (kbStatementId.match(/^#\d+:\d+$/)) {
77-
filtered.push(kbStatementId);
78-
}
79-
return filtered;
80-
}, []),
81-
operator: 'IN',
82-
};
83-
const query = {
84-
target: 'Statement',
85-
filters,
86-
returnProperties: ['@class', '@rid', 'reviewStatus'],
87-
orderBy: ['@rid'],
88-
};
89-
90-
const {result} = await request({
91-
url: `${uri}/query`,
92-
method: 'POST',
93-
body: JSON.stringify(query),
94-
json: true,
95-
headers: {
96-
Authorization: graphkbToken,
97-
'Content-Type': 'application/json',
98-
},
99-
});
100-
101-
return result;
102-
};
103-
10462
/* Get IPR evidence level descriptions from GraphKB
10563
*
10664
* @param {string} graphkbToken the Authorization token for the connection to GraphKB
@@ -138,5 +96,4 @@ const graphkbEvidenceLevels = async (graphkbToken) => {
13896
module.exports = {
13997
graphkbAutocomplete,
14098
graphkbEvidenceLevels,
141-
graphkbReviewStatus,
14299
};

app/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
'mutationBurden\\.(barplot|density|legend)_(sv|snv|indel|snv_indel)\\.(primary|secondary|tertiary|quaternary)',
2727
'circosSv\\.(genome|transcriptome)',
2828
'expDensity\\.(histogram|violin\\.(tcga|gtex|cser|hartwig|pediatric))\\.\\S+',
29-
'expression\\.(chart|legend|spearman\\.(tcga|gtex|cser|hartwig|target))',
29+
'expression\\.(chart|legend|spearman\\.(tcga|gtex|cser|hartwig|target|pediatric))',
3030
'microbial\\.circos\\.(genome|transcriptome)',
3131
'cibersort\\.(cd8_positive|combined)_t-cell_scatter',
3232
'mixcr\\.circos_trb_vj_gene_usage',

app/libs/image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const db = require('../models');
1515
*/
1616
const processImage = async (image, width, height, format = 'png') => {
1717
const imageData = await sharp(image)
18-
.resize(width, height, {fit: 'inside'})
18+
.resize(width, height, {fit: 'inside', withoutEnlargement: true})
1919
.toFormat(format.toLowerCase())
2020
.toBuffer();
2121

app/models/clearCache.js

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,28 @@ module.exports = async (instance, method) => {
169169
case 'signatures':
170170
return removeKeys(`/reports/${report.ident}/signatures`);
171171
case 'smallMutations':
172-
return removeKeys(`/reports/${report.ident}/small-mutations`);
172+
return Promise.all([
173+
batchDeleteKeysByPattern(`/reports/${report.ident}/kb-matches*`),
174+
removeKeys(`/reports/${report.ident}/small-mutations`),
175+
]);
173176
case 'copyVariants':
174177
case 'expressionVariants':
175178
case 'structuralVariants':
179+
case 'proteinVariants':
176180
case 'kbMatches':
177-
return removeKeys([
178-
`/reports/${report.ident}/copy-variants`,
179-
`/reports/${report.ident}/expression-variants`,
180-
`/reports/${report.ident}/small-mutations`,
181-
`/reports/${report.ident}/structural-variants`,
181+
return Promise.all([
182+
batchDeleteKeysByPattern(`/reports/${report.ident}/kb-matches*`),
183+
removeKeys([
184+
`/reports/${report.ident}/copy-variants`,
185+
`/reports/${report.ident}/expression-variants`,
186+
`/reports/${report.ident}/small-mutations`,
187+
`/reports/${report.ident}/structural-variants`,
188+
]),
182189
]);
183190
case 'genes':
184191
return Promise.all([
185192
batchDeleteKeysByPattern(`/reports/${report.ident}/genes*`),
193+
batchDeleteKeysByPattern(`/reports/${report.ident}/kb-matches*`),
186194
removeKeys([
187195
`/reports/${report.ident}/copy-variants`,
188196
`/reports/${report.ident}/expression-variants`,

app/models/reports/copyVariants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ module.exports = (sequelize, Sq) => {
6464
cna: {
6565
type: Sq.NUMERIC,
6666
},
67+
germline: {
68+
type: Sq.BOOLEAN,
69+
},
6770
}, {
6871
...DEFAULT_REPORT_OPTIONS,
6972
tableName: 'reports_copy_variants',

app/models/reports/expressionVariants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ module.exports = (sequelize, Sq) => {
140140
field: 'kb_category',
141141
type: Sq.TEXT,
142142
},
143+
germline: {
144+
type: Sq.BOOLEAN,
145+
},
143146
}, {
144147
...DEFAULT_REPORT_OPTIONS,
145148
tableName: 'reports_expression_variants',

app/models/reports/genomic/summary/genomicAlterationsIdentified.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ module.exports = (sequelize, Sq) => {
1616
type: Sq.TEXT,
1717
allowNull: false,
1818
},
19+
germline: {
20+
type: Sq.BOOLEAN,
21+
},
1922
}, {
2023
...DEFAULT_REPORT_OPTIONS,
2124
tableName: 'reports_summary_genomic_alterations_identified',

app/models/reports/kbMatches.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ module.exports = (sequelize, Sq) => {
116116
field: 'external_statement_id',
117117
type: Sq.TEXT,
118118
},
119+
reviewStatus: {
120+
name: 'reviewStatus',
121+
field: 'review_status',
122+
type: Sq.TEXT,
123+
},
119124
}, {
120125
...DEFAULT_REPORT_OPTIONS,
121126
tableName: 'reports_kb_matches',

app/models/reports/probeTestInformation.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,20 @@ module.exports = (sequelize, Sq) => {
5454
allowNull: false,
5555
defaultValue: -1,
5656
},
57+
cancerGenes: {
58+
name: 'cancerGenes',
59+
field: 'cancer_genes',
60+
type: Sq.INTEGER,
61+
allowNull: false,
62+
defaultValue: -1,
63+
},
64+
cancerVars: {
65+
name: 'cancerVars',
66+
field: 'cancer_vars',
67+
type: Sq.INTEGER,
68+
allowNull: false,
69+
defaultValue: -1,
70+
},
5771
pharmacogenomicGenes: {
5872
name: 'pharmacogenomicGenes',
5973
field: 'pharmacogenomic_genes',

app/models/reports/proteinVariants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ module.exports = (sequelize, Sq) => {
6666
field: 'kb_category',
6767
type: Sq.TEXT,
6868
},
69+
germline: {
70+
type: Sq.BOOLEAN,
71+
},
6972
}, {
7073
...DEFAULT_REPORT_OPTIONS,
7174
tableName: 'reports_protein_variants',

0 commit comments

Comments
 (0)