variant
BaseVariant Objects
class BaseVariant()
Base class for all variant types.
show_annotations
def show_annotations() -> Dict[str, Any]
Return annotation types.
query_annotation
def query_annotation(key: str) -> Any
Query a specific annotation.
add_annotation
def add_annotation(key: str, value: Any) -> None
Add or update an annotation.
SequenceVariant Objects
class SequenceVariant(BaseVariant)
Class for SNV and Indel variants.
__len__
def __len__()
Return the length of the variant.
__str__
def __str__()
Return a string representation of the variant.
__repr__
def __repr__()
Return a detailed string representation of the variant.
StructuralVariant Objects
class StructuralVariant(BaseVariant)
Class for SV/CNV variants (INS, DEL, INV, DUP, BND, CNV).
__len__
def __len__()
Return the length of the variant.
__str__
def __str__()
Return a string representation of the variant.
__repr__
def __repr__()
Return a detailed string representation of the variant.
TandemRepeatVariant Objects
class TandemRepeatVariant(BaseVariant)
Class for Tandem Repeat variants (SRWGS and LRWGS).
__len__
def __len__()
Return the length of the variant.
__str__
def __str__()
Return a string representation of the variant.
__repr__
def __repr__()
Return a detailed string representation of the variant.
utils
infer_variant_type
def infer_variant_type(ref_allele, alt_allele)
Infer the variant type based on reference and alternative alleles.
Arguments:
ref_allelestr - Reference allele sequencealt_allelestr - Alternative allele sequence
Returns:
str- Inferred variant type (‘snv’, ‘deletion’, ‘insertion’, ‘indel’, ‘duplication’, ‘translocation’)
to_hgvs
def to_hgvs(variant)
Convert genomic coordinates and variant details to HGVS notation, inferring variant type.
Arguments:
chromosomestr - Chromosome name (e.g., ‘1’, ‘X’, ‘chr1’)positionint - Genomic position of the variantref_allelestr - Reference allele or sequencealt_allelestr - Alternative allele or sequence
Returns:
str- HGVS notation for the variant