Analyze Variants Module¶
The analyze_variants module provides variant-level analysis and gene burden testing.
Variant analysis module for gene burden and other statistics.
Modular design: - Basic and comprehensive stats computations moved to stats.py. - Gene burden analysis moved to gene_burden.py. - Helper functions moved to helpers.py.
This module now: - Reads a TSV of variants and their annotations (including a GT column listing sample genotypes). - Classifies samples into case/control sets based on user input (sample lists or phenotype terms). - If no case/control criteria are provided, defaults to making all samples controls. - Invokes external modules (stats.py, gene_burden.py) for computations. - Orchestrates flow and writes or yields output lines.
Maintains previous functionality, CLI interface, and output format.
- variantcentrifuge.analyze_variants.analyze_variants(lines, cfg)[source]¶
Analyze variants and optionally perform gene burden analysis.
Steps¶
Parse input TSV into a DataFrame.
Compute counts and stats via analyze_variants_df.
If requested, perform gene burden (Fisher’s exact test + correction).