benchmate.variant
benchmate.variant.variant
BaseVariant Objects
@dataclass(slots=True)
class BaseVariant()
base variant class to be subclassed below, contains the bare minimun information of a variant
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
@dataclass(slots=True)
class SequenceVariant(BaseVariant)
simple sequence variation, snps, small dels, ins and indels
__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
@dataclass(slots=True)
class StructuralVariant(BaseVariant)
larger variations including translocation or transversions
svlen
length of the sv
__len__
def __len__()
Return the length of the variant.
reciprocal_overlap
def reciprocal_overlap(other)
find overlaps between variants
Arguments:
other: other StructuralVariant
Returns:
fraction overlap
__str__
def __str__()
Return a string representation of the variant.
__repr__
def __repr__()
Return a detailed string representation of the variant.
TandemRepeatVariant Objects
@dataclass(slots=True)
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.
benchmate.variant.utils
infer_variant_type
def infer_variant_type(ref_allele, alt_allele)
:param ref_allele: what the reference is
:param alt_allele: what the alternative is :return 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.
:param variant, a type of variant instance :return hgvs, a HGVS notation