Variant#
- class alphagenome.data.genome.Variant(chromosome, position, reference_bases, alternate_bases, name='', info=<factory>)[source]#
Represents a genomic variant/mutation.
Differs from the Variant definition in a VCF file, which allows for multiple alternative bases and contains sample information. This
Variantclass does not include sample information or variant call quality information.- chromosome#
The chromosome name (e.g., ‘chr1’, ‘1’).
- position#
The 1-based position of the variant on the chromosome.
- reference_bases#
The reference base(s) at the variant position. Most frequently (not always!), these correspond to the sequence in the reference genome at positions: [position, …, position + len(reference_bases) - 1]
- alternate_bases#
The alternate base(s) that replace the reference. For example, if sequence=’ACT’, position=2, reference_bases=’C’, alternate_bases=’TG’, then the actual (alternate) sequence would be ATGT.
- name#
An optional name for the variant (e.g., a dbSNP ID like rs206437).
- info#
An optional dictionary for additional variant information.
- start#
The 0-based start position of the variant (
position - 1).
- end#
The 0-based end position (
start + len(reference_bases)).
- reference_interval#
Reference genomic
Intervalspanned by the variant.
- is_snv#
True if single-nucleotide variant (
len == 1for ref and alt).
- is_deletion#
True if deletion (
len(reference_bases) > len(alternate_bases)).
- is_insertion#
True if insertion (
len(reference_bases) < len(alternate_bases)).
- is_frameshift#
True if indel length is not a multiple of 3.
- is_indel#
True if insertion or deletion.
- is_structural#
True if indel length is at least 50 bp.
Methods
|
Checks if the variant's alternate overlaps with the interval. |
|
Truncates the variant str's ref and alt bases to the given max length. |
|
Returns a deep copy of the variant. |
|
Creates a |
|
Creates a |
|
Checks if the variant's reference overlaps with the interval. |
|
Splits the variant into two at the anchor point. |
|
Converts the variant to a dictionary. |