Annotator API

Core Annotator

Core Variant Annotator - Functional annotation engine

class varannote.core.annotator.VariantAnnotator(genome='hg38')[source]

Bases: object

Core variant annotation engine

Provides functional annotations for genomic variants including gene symbols, consequences, and pathogenicity scores.

__init__(genome='hg38')[source]

Initialize variant annotator

Parameters:

genome (str) – Reference genome version

get_functional_annotations(variant)[source]

Get functional annotations for a variant

Parameters:

variant (Dict) – Variant dictionary with CHROM, POS, REF, ALT

Return type:

Dict

Returns:

Dictionary with functional annotations

annotate_batch(variants)[source]

Annotate a batch of variants

Parameters:

variants (List[Dict]) – List of variant dictionaries

Return type:

List[Dict]

Returns:

List of annotated variants

Tools Annotator

Variant Annotator Tool - Main annotation interface

class varannote.tools.annotator.VariantAnnotatorTool(genome='hg38', databases=None, verbose=False, use_real_db=False, cache_dir=None, use_parallel=False, max_workers=4)[source]

Bases: object

Enhanced variant annotation tool

Provides comprehensive variant annotation using either mock or real databases with advanced features like parallel processing and confidence scoring.

__init__(genome='hg38', databases=None, verbose=False, use_real_db=False, cache_dir=None, use_parallel=False, max_workers=4)[source]

Initialize enhanced variant annotator tool

Parameters:
  • genome (str) – Reference genome version

  • databases (Optional[List[str]]) – List of databases to use

  • verbose (bool) – Enable verbose output

  • use_real_db (bool) – Use real databases instead of mock data

  • cache_dir (Optional[str]) – Cache directory for real database results

  • use_parallel (bool) – Enable parallel processing

  • max_workers (int) – Maximum number of parallel workers

annotate_file(input_file, output_file, output_format='vcf')[source]

Annotate variants from a VCF file with enhanced features

Parameters:
  • input_file (str) – Input VCF file path

  • output_file (str) – Output file path

  • output_format (str) – Output format (vcf, tsv, json)

Return type:

Dict

Returns:

Dictionary with annotation statistics including confidence scores

get_annotation_summary(variants)[source]

Get enhanced summary statistics for annotations

Return type:

Dict

varannote.tools.annotator.main()[source]

Command line interface for enhanced variant annotator