Variant Calling and Statistics: parameters and notes¶
See the tutorial for usage and examples.
Each function includes its purpose, API, inputs, outputs, example code and result description. Prepare any required credentials, local files and optional dependencies; remote results vary with database releases and query time.
Calculate the fraction of coding variants matching filters¶
dnakit.databases.coding_variant_fraction(*, file, vaf_threshold=None, annotation=None, header_rows=None, vaf_col=None, so_col=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
file |
string | Required | Path to variant Excel (.xlsx) or CSV file. |
vaf_threshold |
number | None | Keep variants with VAF strictly less than this value. Default 0.3. |
annotation |
string | None | Sequence Ontology term to count in numerator. Default 'synonymous_variant'. |
header_rows |
integer | None | 1 for flat headers, 2 for MultiIndex (common in Excel variant reports). Default 1. |
vaf_col |
string | null | None | Explicit VAF column name. If empty, auto-detect from 'variant allele freq' or 'vaf'. |
so_col |
string | null | None | Explicit Sequence Ontology column name. If empty, auto-detect from 'sequence ontology'. |
verbose |
bool | True | Progress flag. |
Count filtered variants in a VCF or BCF file¶
dnakit.databases.vcf_count_variants(*, operation=None, vcf_path, pass_only=None, regions=None, min_qual=None, include_expr=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
operation |
object | None | None | Operation (fixed) |
vcf_path |
string | Required | Path to a local .vcf, .vcf.gz, or .bcf file |
pass_only |
boolean | null | None | If true, count only FILTER=PASS or '.' records |
regions |
string | null | None | Restrict to a region, e.g. 'chr1' or 'chr1:1-1000000' |
min_qual |
number | null | None | Keep only records with QUAL >= this value |
include_expr |
string | null | None | Extra bcftools -i include expression, e.g. 'INFO/AF>0.01' |
verbose |
bool | True | Progress flag. |
Normalize VCF variants and multiallelic sites¶
dnakit.databases.vcf_normalize(*, operation=None, vcf_path, multiallelics=None, reference_fasta=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
operation |
object | None | None | Operation (fixed) |
vcf_path |
string | Required | Path to a local .vcf, .vcf.gz, or .bcf file |
multiallelics |
string | null | None | 'split' (default) breaks multiallelic records into biallelic; 'join' merges; 'none' leaves as-is |
reference_fasta |
string | null | None | Optional reference FASTA path; enables indel left-alignment (-f) |
verbose |
bool | True | Progress flag. |
Summarize VCF variant types and sample genotype statistics¶
dnakit.databases.vcf_summary_stats(*, operation=None, vcf_path, pass_only=None, regions=None, min_qual=None, include_expr=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
operation |
object | None | None | Operation (fixed) |
vcf_path |
string | Required | Path to a local .vcf, .vcf.gz, or .bcf file |
pass_only |
boolean | null | None | If true, count only FILTER=PASS or '.' records |
regions |
string | null | None | Restrict to a region, e.g. 'chr1' or 'chr1:1-1000000' (streamed, no index needed) |
min_qual |
number | null | None | Keep only records with QUAL >= this value |
include_expr |
string | null | None | Extra bcftools -i include expression, e.g. 'INFO/DP>10' |
verbose |
bool | True | Progress flag. |