Skip to content

Commit

Permalink
Add variant QA flags to VA
Browse files Browse the repository at this point in the history
  • Loading branch information
phildarnowsky-broad committed Oct 1, 2024
1 parent 7357962 commit 7f30988
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
22 changes: 13 additions & 9 deletions graphql-api/src/graphql/resolvers/va.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ describe('resolveVACohortAlleleFrequency', () => {
faf95: { popmax: 0.123, popmax_population: 'afr' },
ancestry_groups: [],
filters: ['AC0'],
flags: ['monoallelic'],
}

const genomeEsDocument = {
Expand All @@ -68,7 +69,9 @@ describe('resolveVACohortAlleleFrequency', () => {
hemizygote_count: 4,
homozygote_count: 5,
faf95: { popmax: 0.234, popmax_population: 'eas' },
filters: ['AC0'],
ancestry_groups: [],
flags: ['monoallelic'],
}

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

test('parses a single CohortAlleleFrequency exome correctly', async () => {
Expand Down Expand Up @@ -109,10 +113,10 @@ describe('resolveVACohortAlleleFrequency', () => {
meanDepth: 0.345,
fractionCoverage20x: 0.456,
qcFilters: ['AC0'],
monoallelic: null,
lowComplexityRegion: null,
lowConfidenceLossOfFunctionError: null,
lossOfFunctionWarning: null,
monoallelic: true,
lowComplexityRegion: true,
lowConfidenceLossOfFunctionError: true,
lossOfFunctionWarning: true,
heterozygousSkewedAlleleCount: null,
},
},
Expand Down Expand Up @@ -149,11 +153,11 @@ describe('resolveVACohortAlleleFrequency', () => {
qualityMeasures: {
meanDepth: 0.111,
fractionCoverage20x: 0.222,
monoallelic: null,
qcFilters: null,
lowComplexityRegion: null,
lowConfidenceLossOfFunctionError: null,
lossOfFunctionWarning: null,
monoallelic: true,
qcFilters: ['AC0'],
lowComplexityRegion: true,
lowConfidenceLossOfFunctionError: true,
lossOfFunctionWarning: true,
heterozygousSkewedAlleleCount: null,
},
},
Expand Down
8 changes: 4 additions & 4 deletions graphql-api/src/graphql/resolvers/va.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,10 @@ const resolveVACohortAlleleFrequencies = async (
meanDepth: coverage && coverage.mean ? coverage.mean : null,
fractionCoverage20x: coverage && coverage.over_20 ? coverage.over_20 : null,
qcFilters: frequencies.filters,
monoallelic: null,
lowComplexityRegion: null,
lowConfidenceLossOfFunctionError: null,
lossOfFunctionWarning: null,
monoallelic: frequencies.flags.includes('monoallelic'),
lowComplexityRegion: obj.flags.includes('lcr'),
lowConfidenceLossOfFunctionError: obj.flags.includes('lc_lof'),
lossOfFunctionWarning: obj.flags.includes('lof_flag'),
heterozygousSkewedAlleleCount: null,
}

Expand Down

0 comments on commit 7f30988

Please sign in to comment.