Skip to content

Commit 41e50f4

Browse files
Add heterozygous skewed allele count to VA
1 parent 759148c commit 41e50f4

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

graphql-api/src/graphql/resolvers/va.spec.ts

+17-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ describe('resolveVACohortAlleleFrequency', () => {
6161
ancestry_groups: [],
6262
filters: ['AC0'],
6363
flags: ['monoallelic'],
64+
quality_metrics: {
65+
allele_balance: {
66+
alt: { bin_freq: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] },
67+
},
68+
},
6469
}
6570

6671
const genomeEsDocument = {
@@ -72,6 +77,16 @@ describe('resolveVACohortAlleleFrequency', () => {
7277
filters: ['AC0'],
7378
ancestry_groups: [],
7479
flags: ['monoallelic'],
80+
quality_metrics: {
81+
allele_balance: {
82+
alt: {
83+
bin_freq: [
84+
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
85+
117, 118, 119,
86+
],
87+
},
88+
},
89+
},
7590
}
7691

7792
const variantESDocument = {
@@ -117,7 +132,7 @@ describe('resolveVACohortAlleleFrequency', () => {
117132
lowComplexityRegion: true,
118133
lowConfidenceLossOfFunctionError: true,
119134
lossOfFunctionWarning: true,
120-
heterozygousSkewedAlleleCount: null,
135+
heterozygousSkewedAlleleCount: 37,
121136
},
122137
},
123138
]
@@ -158,7 +173,7 @@ describe('resolveVACohortAlleleFrequency', () => {
158173
lowComplexityRegion: true,
159174
lowConfidenceLossOfFunctionError: true,
160175
lossOfFunctionWarning: true,
161-
heterozygousSkewedAlleleCount: null,
176+
heterozygousSkewedAlleleCount: 237,
162177
},
163178
},
164179
]

graphql-api/src/graphql/resolvers/va.ts

+20-1
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,25 @@ const addSubcohorts = (
381381
return Object.values(subcohortMap)
382382
}
383383

384+
type ESFrequencies = {
385+
quality_metrics: {
386+
allele_balance: {
387+
alt?: {
388+
bin_freq: number[]
389+
}
390+
}
391+
}
392+
}
393+
394+
const calculateHeterozygousSkewedAlleleCount = (frequencies: ESFrequencies): number | null => {
395+
const { alt } = frequencies.quality_metrics.allele_balance
396+
if (!alt) {
397+
return null
398+
}
399+
400+
return alt.bin_freq[18] + alt.bin_freq[19]
401+
}
402+
384403
const resolveVACohortAlleleFrequencies = async (
385404
obj: any,
386405
args: any,
@@ -406,7 +425,7 @@ const resolveVACohortAlleleFrequencies = async (
406425
lowComplexityRegion: obj.flags.includes('lcr'),
407426
lowConfidenceLossOfFunctionError: obj.flags.includes('lc_lof'),
408427
lossOfFunctionWarning: obj.flags.includes('lof_flag'),
409-
heterozygousSkewedAlleleCount: null,
428+
heterozygousSkewedAlleleCount: calculateHeterozygousSkewedAlleleCount(frequencies),
410429
}
411430

412431
const fullSet: Subset = {

0 commit comments

Comments
 (0)