gnomad_qc.v5.resources.annotations
Script containing annotation related resources.
Module Functions
Get gnomAD v5 (AoU genomes only) trio stats VersionedTableResource. |
|
Get the gnomAD v5 (AoU genomes only) sibling stats VersionedTableResource. |
|
|
Get the downsampling annotation table. |
Get the group membership Table for coverage, AN, quality histograms, and frequency calculations. |
|
Get the quality histograms annotation table. |
|
|
Fetch filepath for all sites coverage or allele number Table. |
Get the frequency annotation Table for v5. |
|
Get the gnomAD v5 (AoU genomes only) info VersionedTableResource. |
|
|
Get checkpoint path for the AC info table written by --generate-ac-info-ht. |
|
Get checkpoint path for the reformatted sites VCF HT (--create-sites-vcf-ht). |
Path to sites VCF (input information for running VQSR). |
|
|
Get path to AoU annotation sites-only VCF header. |
|
Get path to AoU sites-only VCF with annotations needed for variant QC. |
|
Return the VersionedTableResource to the variant QC annotation Table. |
|
Provide the path to the true positive VCF used as input to VQSR. |
Get the gnomAD v5 VEP annotation VersionedTableResource. |
|
Get the gnomAD v5 VEP annotation VersionedTableResource for validation counts. |
Script containing annotation related resources.
- gnomad_qc.v5.resources.annotations.get_trio_stats(test=False, environment='batch', chrom=None)[source]
Get gnomAD v5 (AoU genomes only) trio stats VersionedTableResource.
- Parameters:
test (
bool) – Whether to use a temporary path for testing.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb” or “batch”.chrom (
Optional[str]) – Optional single chromosome for a per-chromosome trio stats HT (trio stats are computed one chromosome at a time). Default is None (combined HT).
- Return type:
VersionedTableResource- Returns:
AoU trio stats VersionedTableResource.
- gnomad_qc.v5.resources.annotations.get_sib_stats(test=False, environment='batch')[source]
Get the gnomAD v5 (AoU genomes only) sibling stats VersionedTableResource.
- Parameters:
test (
bool) – Whether to use a tmp path for testing.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb” or “batch”.
- Return type:
VersionedTableResource- Returns:
AoU sibling stats VersionedTableResource.
- gnomad_qc.v5.resources.annotations.get_aou_downsampling(test=False, environment='batch')[source]
Get the downsampling annotation table.
v5 downsamplings only applies to the AoU dataset.
- Parameters:
test (
bool) – Whether to use a tmp path for tests. Default is False.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb” or “batch”.
- Return type:
VersionedTableResource- Returns:
Hail Table containing downsampling annotations.
- gnomad_qc.v5.resources.annotations.group_membership(test=False, data_set='aou', environment='batch')[source]
Get the group membership Table for coverage, AN, quality histograms, and frequency calculations.
- Parameters:
test (
bool) – Whether to use a tmp path for tests. Default is False.data_set (
str) – Data set of annotation resource. Default is “aou”.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb” or “batch”.
- Return type:
VersionedTableResource- Returns:
Hail Table containing group membership annotations.
- gnomad_qc.v5.resources.annotations.qual_hists(test=False, environment='batch')[source]
Get the quality histograms annotation table.
- Parameters:
test (
bool) – Whether to use a tmp path for tests. Default is False.environment (
str) – Environment to use for quality histograms. Default is “batch”. Must be one of “rwb” or “batch”.
- Return type:
VersionedTableResource- Returns:
Hail Table containing quality histogram annotations.
- gnomad_qc.v5.resources.annotations.coverage_and_an_path(test=False, data_set='aou', environment='batch')[source]
Fetch filepath for all sites coverage or allele number Table.
Note
If data_set is ‘gnomAD’, the returned table only contains coverage and AN for consent drop samples.
- Parameters:
test (
bool) – Whether to use a tmp path for testing. Default is False.data_set (
str) – Dataset identifier. Must be one of “aou” or “gnomad”. Default is “aou”.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb”, “batch”, or “dataproc”.
- Return type:
VersionedTableResource- Returns:
Coverage and allele number Hail Table.
- gnomad_qc.v5.resources.annotations.get_freq(version='5.0', data_type='genomes', test=False, data_set='aou', environment='batch')[source]
Get the frequency annotation Table for v5.
- Parameters:
version (
str) – Version of annotation path to return.data_type (
str) – Data type of annotation resource (“genomes” or “exomes”).test (
bool) – Whether to use a tmp path for testing.data_set (
str) – Data set of annotation resource. Default is “aou”.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb”, “batch”, or “dataproc”.
- Return type:
TableResource- Returns:
Hail Table containing frequency annotations.
- gnomad_qc.v5.resources.annotations.get_info_ht(test=False, environment='batch')[source]
Get the gnomAD v5 (AoU genomes only) info VersionedTableResource.
- Parameters:
test (
bool) – Whether to use a tmp path for testing.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb” or “batch”.
- Return type:
VersionedTableResource- Returns:
Info VersionedTableResource.
- gnomad_qc.v5.resources.annotations.get_ac_info_ht_checkpoint_path(version='5.0', add_test_suffix=False, environment='batch', test=False, test_n_partitions=None, contig=None, chunk_start=None, chunk_stop=None, min_alleles=None, max_alleles=None, union=False)[source]
Get checkpoint path for the AC info table written by –generate-ac-info-ht.
Uses the durable annotations bucket (30-day temp bucket when test is True) and a filename derived from the run’s parameters (each component included only when set), so per-stratum and per-chunk runs get distinct paths without manual overrides, e.g.
ac_info_ht_test_3p_min10_max100.htorac_info_ht_chunk0_2000_max9.ht. This helper only returns the checkpoint path and does not imply that reruns will automatically reuse existing data.- Parameters:
version (
str) – Version of annotation path to return.add_test_suffix (
bool) – Whether the filename should include the test suffix.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb” or “batch”.test (
bool) – If True, place the checkpoint under the 30-day temp bucket (–use-tmp-info-paths or test runs); default False places it under the durable annotations bucket, so production AC info HTs are kept.test_n_partitions (
int) – Optional number of test partitions used for the run.contig (
str) – Optional contig the run was restricted to.chunk_start (
int) – Optional chunk start partition index used for the run.chunk_stop (
int) – Optional chunk stop partition index used for the run.min_alleles (
int) – Optional minimum allele count used for the run.max_alleles (
int) – Optional maximum allele count used for the run.union (
bool) – Whether this is the unioned (all-strata) AC info HT, i.e. the –union-ac-info-hts output that –create-final-info-ht reads.
- Return type:
str- Returns:
Path to AC info checkpoint HT.
- gnomad_qc.v5.resources.annotations.get_vcf_ht_checkpoint_path(version='5.0', add_test_suffix=False, environment='batch', test=False)[source]
Get checkpoint path for the reformatted sites VCF HT (–create-sites-vcf-ht).
- Parameters:
version (
str) – Version of annotation path to return.add_test_suffix (
bool) – Whether the filename should include the test suffix. A test sites VCF HT holds only the first two partitions of the VCF, so it is a distinct file.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb” or “batch”.test (
bool) – If True, place the checkpoint under the 30-day temp bucket (–use-tmp-info-paths or test runs); default False places it under the durable annotations bucket.
- Return type:
str- Returns:
Path to the reformatted sites VCF HT checkpoint.
- gnomad_qc.v5.resources.annotations.info_vcf_path(version='5.0', test=False, environment='batch')[source]
Path to sites VCF (input information for running VQSR).
- Parameters:
version (
str) – Version of annotation path to return.test (
bool) – Whether to use a tmp path for testing.environment (
str) – Environment to use. Must be one of “rwb” or “batch”. Default is “batch”.
- Return type:
str- Returns:
String for the path to the info VCF.
- gnomad_qc.v5.resources.annotations.get_aou_vcf_header(environment='batch')[source]
Get path to AoU annotation sites-only VCF header.
This is needed for proper import of the sites-only VCF as the QUALapprox annotation is stated in the previous header as an int but is actually a float.
- Parameters:
environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb” or “batch”.- Return type:
str- Returns:
Path to the VCF header file.
- gnomad_qc.v5.resources.annotations.get_aou_annotated_sites_only_vcf(environment='batch')[source]
Get path to AoU sites-only VCF with annotations needed for variant QC.
- Parameters:
environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb” or “batch”.- Return type:
str- Returns:
Path to the annotated sites-only VCF.
- gnomad_qc.v5.resources.annotations.get_variant_qc_annotations(test=False, environment='batch')[source]
Return the VersionedTableResource to the variant QC annotation Table.
Annotations that are included in the Table:
- Features for RF:
variant_type
allele_type
n_alt_alleles
has_star
AS_QD
AS_pab_max
AS_MQRankSum
AS_SOR
AS_ReadPosRankSum
- Training sites (bool):
transmitted_singleton
sibling_singleton
fail_hard_filters - (ht.AS_QD < 0.5) | (ht.AS_FS > 60) | (ht.AS_MQ < 30)
- Parameters:
test (
bool) – Whether to use a tmp path for testing.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb”, “batch”, or “dataproc”.
- Return type:
VersionedTableResource- Returns:
Table with variant QC annotations.
- gnomad_qc.v5.resources.annotations.get_true_positive_vcf_path(version='5.0', test=False, adj=False, true_positive_type='transmitted_singleton', environment='batch')[source]
Provide the path to the true positive VCF used as input to VQSR.
- Parameters:
version (
str) – Version of true positive VCF path to return. Default is CURRENT_ANNOTATION_VERSION.test (
bool) – Whether to use a tmp path for testing. Default is False.adj (
bool) – Whether to use adj genotypes. Default is False.true_positive_type (
str) – Type of true positive VCF path to return. Should be one of “transmitted_singleton”, “sibling_singleton”, or “transmitted_singleton.sibling_singleton”. Default is “transmitted_singleton”.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb”, “batch”, or “dataproc”.
- Return type:
str- Returns:
String for the path to the true positive VCF.
- gnomad_qc.v5.resources.annotations.get_vep(test=False, vep_version='105', environment='batch')[source]
Get the gnomAD v5 VEP annotation VersionedTableResource.
- Parameters:
test (
bool) – Whether to use a tmp path for analysis of the test Table instead of the full v5 Table.vep_version (
str) – VEP version to use (e.g., “105”, “115”). Default is “105”.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb”, “batch”, or “dataproc”.
- Return type:
VersionedTableResource- Returns:
gnomAD v5 VEP VersionedTableResource.
- gnomad_qc.v5.resources.annotations.validate_vep_path(test=False, vep_version='105', environment='batch')[source]
Get the gnomAD v5 VEP annotation VersionedTableResource for validation counts.
- Parameters:
test (
bool) – Whether to use a tmp path for analysis of the test VDS instead of the full v5 VDS.vep_version (
str) – VEP version to use (e.g., “105”, “115”). Default is “105”.environment (
str) – Environment to use. Default is “batch”. Must be one of “rwb”, “batch”, or “dataproc”.
- Return type:
VersionedTableResource- Returns:
gnomAD v5 VEP VersionedTableResource containing validity check.