diff --git a/app/models/reports/mutationBurden.js b/app/models/reports/mutationBurden.js index 995cef299..fc8134107 100644 --- a/app/models/reports/mutationBurden.js +++ b/app/models/reports/mutationBurden.js @@ -112,6 +112,16 @@ module.exports = (sequelize, Sq) => { description: 'somatic indels and SNVs per megabase in the genome', }, }, + svBurdenHidden: { + name: 'svBurdenHidden', + field: 'sv_burden_hidden', + type: Sq.BOOLEAN, + defaultValue: false, + allowNull: false, + jsonSchema: { + description: 'SV Burden Hidden', + }, + }, }, { ...DEFAULT_REPORT_OPTIONS, tableName: 'reports_mutation_burden', diff --git a/migrations/20241021211045-DEVSU-2473-hide-sv-burden-by-default.js b/migrations/20241021211045-DEVSU-2473-hide-sv-burden-by-default.js new file mode 100644 index 000000000..92d507e63 --- /dev/null +++ b/migrations/20241021211045-DEVSU-2473-hide-sv-burden-by-default.js @@ -0,0 +1,22 @@ +const TABLE = 'reports_mutation_burden'; + +module.exports = { + async up(queryInterface, Sq) { + return queryInterface.sequelize.transaction(async (transaction) => { + await queryInterface.addColumn( + TABLE, + 'sv_burden_hidden', + { + type: Sq.BOOLEAN, + defaultValue: false, + allowNull: false, + }, + {transaction}, + ); + }); + }, + + async down() { + throw new Error('Not Implemented!'); + }, +}; diff --git a/test/routes/report/mutationBurden.test.js b/test/routes/report/mutationBurden.test.js index 6d5812d0b..85b2ac861 100644 --- a/test/routes/report/mutationBurden.test.js +++ b/test/routes/report/mutationBurden.test.js @@ -23,7 +23,7 @@ const mutationBurdenProperties = [ 'ident', 'createdAt', 'updatedAt', 'role', 'codingSnvCount', 'truncatingSnvCount', 'codingIndelsCount', 'frameshiftIndelsCount', 'qualitySvCount', 'qualitySvExpressedCount', 'codingSnvPercentile', 'codingIndelPercentile', 'qualitySvPercentile', - 'totalSnvCount', 'totalIndelCount', 'totalMutationsPerMb', + 'totalSnvCount', 'totalIndelCount', 'totalMutationsPerMb', 'svBurdenHidden', ]; const checkMutationBurden = (mutationObject) => { diff --git a/test/testData/mockReportData.json b/test/testData/mockReportData.json index 0eab83b4e..1846a7162 100644 --- a/test/testData/mockReportData.json +++ b/test/testData/mockReportData.json @@ -190,7 +190,8 @@ "role": "primary", "totalSnvCount": 120, "totalIndelCount": 80, - "totalMutationsPerMb": 56.24 + "totalMutationsPerMb": 56.24, + "svBurdenHidden": true }, { "codingSnvCount": 4, @@ -205,7 +206,8 @@ "role": "primary", "totalSnvCount": 120, "totalIndelCount": 80, - "totalMutationsPerMb": 56.24 + "totalMutationsPerMb": 56.24, + "svBurdenHidden": true }, { "codingSnvCount": 4, @@ -220,7 +222,8 @@ "role": null, "totalSnvCount": 120, "totalIndelCount": 80, - "totalMutationsPerMb": 56.24 + "totalMutationsPerMb": 56.24, + "svBurdenHidden": true } ], "tmburMutationBurden": {