gnomad_qc.v5.annotations.annotation_utils

AoU-specific annotation utilities.

Module Functions

gnomad_qc.v5.annotations.annotation_utils.annotate_adj_no_dp(mt)

Annotate genotypes with adj criteria.

gnomad_qc.v5.annotations.annotation_utils.get_adj_expr(...)

Get adj genotype annotation.

AoU-specific annotation utilities.

gnomad_qc.v5.annotations.annotation_utils.annotate_adj_no_dp(mt, adj_gq=20, adj_dp=10, adj_ab=0.2, haploid_adj_dp=5)[source]

Annotate genotypes with adj criteria.

Defaults correspond to gnomAD values. DP is approximated as the sum of the allele depths. Hom-ref calls with no allele depths (reference blocks) are filtered on GQ only; every other call uses the gnomAD cutoffs. See the module comment for details.

Accepts three entry layouts:

  • LGT and LAD (VDS variant data): full adj criteria.

  • GT and AD (split or dense data): full adj criteria.

  • GT without allele depths (VDS reference data, e.g. the AoU reference blocks with only GT, GQ, END and LEN): every call must be hom-ref and adj is GQ >= adj_gq. A non-hom-ref call raises at runtime rather than being silently marked non-adj.

GQ is required in all three cases.

Parameters:
  • mt (MatrixTable) – Input MatrixTable.

  • adj_gq (int) – Minimum GQ. Default is 20.

  • adj_dp (int) – Minimum DP (sum of allele depths) for calls with allele depths. Default is 10.

  • adj_ab (float) – Minimum allele balance for het calls. Default is 0.2.

  • haploid_adj_dp (int) – Minimum DP (sum of allele depths) for haploid calls with allele depths. Default is 5.

Return type:

MatrixTable

Returns:

MatrixTable with adj annotation.

gnomad_qc.v5.annotations.annotation_utils.get_adj_expr(gt_expr, gq_expr, ad_expr, adj_gq=20, adj_dp=10, adj_ab=0.2, haploid_adj_dp=5)[source]

Get adj genotype annotation.

Defaults correspond to gnomAD values. Hom-ref calls with a missing ad_expr (reference blocks) are filtered on GQ only. All other calls, including hom-ref calls with defined allele depths, use the standard gnomAD adj criteria (GQ, DP, and AB for het calls) with DP approximated as the sum of ad_expr.

Note

Assumes that the genotype expression is already adjusted for sex ploidy.

Parameters:
  • gt_expr (CallExpression) – Genotype expression.

  • gq_expr (Union[Int32Expression, Int64Expression]) – GQ expression.

  • ad_expr (ArrayNumericExpression) – Allele depth expression.

  • adj_gq (int) – Minimum GQ. Default is 20.

  • adj_dp (int) – Minimum DP (sum of allele depths) for calls with allele depths. Default is 10.

  • adj_ab (float) – Minimum allele balance for het calls. Default is 0.2.

  • haploid_adj_dp (int) – Minimum DP (sum of allele depths) for haploid calls with allele depths. Default is 5.

Return type:

BooleanExpression

Returns:

Expression for adj genotype annotation.