Skip to content

Commit c19d81a

Browse files
Add variant QA flags to VA
1 parent 30228bd commit c19d81a

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

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

+13-9
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ describe('resolveVACohortAlleleFrequency', () => {
6060
faf95: { popmax: 0.123, popmax_population: 'afr' },
6161
ancestry_groups: [],
6262
filters: ['AC0'],
63+
flags: ['monoallelic'],
6364
}
6465

6566
const genomeEsDocument = {
@@ -68,7 +69,9 @@ describe('resolveVACohortAlleleFrequency', () => {
6869
hemizygote_count: 4,
6970
homozygote_count: 5,
7071
faf95: { popmax: 0.234, popmax_population: 'eas' },
72+
filters: ['AC0'],
7173
ancestry_groups: [],
74+
flags: ['monoallelic'],
7275
}
7376

7477
const variantESDocument = {
@@ -78,6 +81,7 @@ describe('resolveVACohortAlleleFrequency', () => {
7881
genome: genomeEsDocument,
7982
joint: { fafmax: { faf95_max: 0.234, faf95_max_gen_anc: 'amr' } },
8083
coverage: { exome: { mean: 0.345, over_20: 0.456 }, genome: { mean: 0.111, over_20: 0.222 } },
84+
flags: ['lcr', 'lc_lof', 'lof_flag'],
8185
}
8286

8387
test('parses a single CohortAlleleFrequency exome correctly', async () => {
@@ -109,10 +113,10 @@ describe('resolveVACohortAlleleFrequency', () => {
109113
meanDepth: 0.345,
110114
fractionCoverage20x: 0.456,
111115
qcFilters: ['AC0'],
112-
monoallelic: null,
113-
lowComplexityRegion: null,
114-
lowConfidenceLossOfFunctionError: null,
115-
lossOfFunctionWarning: null,
116+
monoallelic: true,
117+
lowComplexityRegion: true,
118+
lowConfidenceLossOfFunctionError: true,
119+
lossOfFunctionWarning: true,
116120
heterozygousSkewedAlleleCount: null,
117121
},
118122
},
@@ -149,11 +153,11 @@ describe('resolveVACohortAlleleFrequency', () => {
149153
qualityMeasures: {
150154
meanDepth: 0.111,
151155
fractionCoverage20x: 0.222,
152-
monoallelic: null,
153-
qcFilters: null,
154-
lowComplexityRegion: null,
155-
lowConfidenceLossOfFunctionError: null,
156-
lossOfFunctionWarning: null,
156+
monoallelic: true,
157+
qcFilters: ['AC0'],
158+
lowComplexityRegion: true,
159+
lowConfidenceLossOfFunctionError: true,
160+
lossOfFunctionWarning: true,
157161
heterozygousSkewedAlleleCount: null,
158162
},
159163
},

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,10 @@ const resolveVACohortAlleleFrequencies = async (
402402
meanDepth: coverage && coverage.mean ? coverage.mean : null,
403403
fractionCoverage20x: coverage && coverage.over_20 ? coverage.over_20 : null,
404404
qcFilters: frequencies.filters,
405-
monoallelic: null,
406-
lowComplexityRegion: null,
407-
lowConfidenceLossOfFunctionError: null,
408-
lossOfFunctionWarning: null,
405+
monoallelic: frequencies.flags.includes('monoallelic'),
406+
lowComplexityRegion: obj.flags.includes('lcr'),
407+
lowConfidenceLossOfFunctionError: obj.flags.includes('lc_lof'),
408+
lossOfFunctionWarning: obj.flags.includes('lof_flag'),
409409
heterozygousSkewedAlleleCount: null,
410410
}
411411

0 commit comments

Comments
 (0)