gnomad.utils.reference_genome
Create a reference Table with locus and alleles (containing only the reference allele by default) from the given reference genome. |
|
Add the fasta sequence to a Hail reference genome. |
|
Get the primary contigs (autosomes, optionally sex chromosomes and MT) for a build. |
|
Return the reference genome associated with the input Locus expression. |
- gnomad.utils.reference_genome.get_reference_ht(ref, contigs=None, excluded_intervals=None, add_all_substitutions=False, filter_n=True)[source]
Create a reference Table with locus and alleles (containing only the reference allele by default) from the given reference genome.
Note
If the contigs argument is not provided, all contigs (including obscure ones) will be added to the table. This can be slow as contigs are added one by one.
- Parameters:
ref (
ReferenceGenome) – Input reference genomecontigs (
Optional[List[str]]) – An optional list of contigs that the Table should includeexcluded_intervals (
Optional[List[Interval]]) – An optional list of intervals to excludeadd_all_substitutions (
bool) – If set, then all possible substitutions are added in the alleles arrayfilter_n (
bool) – If set, bases where the reference is unknown (n) are filtered.
- Return type:
- Returns:
- gnomad.utils.reference_genome.add_reference_sequence(ref)[source]
Add the fasta sequence to a Hail reference genome.
Only GRCh37 and GRCh38 references are supported.
- Parameters:
ref (
ReferenceGenome) – Input reference genome.- Return type:
- Returns:
- gnomad.utils.reference_genome.get_primary_contigs(build='GRCh38', include_sex=True, include_chrM=False)[source]
Get the primary contigs (autosomes, optionally sex chromosomes and MT) for a build.
Requires an initialized Hail context. Only GRCh37 and GRCh38 are supported, since autosomes are taken positionally as the first 22 contigs.
- Parameters:
build (
str) – Reference genome build. Default is “GRCh38”.include_sex (
bool) – Whether to include the X and Y contigs. Default is True.include_chrM (
bool) – Whether to include the MT contig. Default is False.
- Return type:
List[str]- Returns:
List of contig names in reference order.
- gnomad.utils.reference_genome.get_reference_genome(locus, add_sequence=False)[source]
Return the reference genome associated with the input Locus expression.
- Parameters:
locus (
Union[LocusExpression,IntervalExpression]) – Input locusadd_sequence (
bool) – If set, the fasta sequence is added to the reference genome
- Return type:
- Returns:
Reference genome