跳转至

变异检测与统计:参数与补充说明

用法和示例见功能教程。

各功能按作用、API、输入、输出、示例代码和结果说明介绍。运行前按说明准备凭据、本地文件与可选依赖;远程结果随数据库版本与查询时间变化。

计算满足注释与频率条件的编码变异比例

dnakit.databases.coding_variant_fraction(*, file, vaf_threshold=None, annotation=None, header_rows=None, vaf_col=None, so_col=None, verbose=True)

参数 类型 必填 / 默认值 说明与约束
file string 必填 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 运行提示开关。

按过滤条件统计 VCF 变异数量

dnakit.databases.vcf_count_variants(*, operation=None, vcf_path, pass_only=None, regions=None, min_qual=None, include_expr=None, verbose=True)

参数 类型 必填 / 默认值 说明与约束
operation object | None None Operation (fixed)
vcf_path string 必填 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 运行提示开关。

规范化 VCF 变异表示与多等位位点

dnakit.databases.vcf_normalize(*, operation=None, vcf_path, multiallelics=None, reference_fasta=None, verbose=True)

参数 类型 必填 / 默认值 说明与约束
operation object | None None Operation (fixed)
vcf_path string 必填 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 运行提示开关。

汇总 VCF 变异类型与样本基因型统计

dnakit.databases.vcf_summary_stats(*, operation=None, vcf_path, pass_only=None, regions=None, min_qual=None, include_expr=None, verbose=True)

参数 类型 必填 / 默认值 说明与约束
operation object | None None Operation (fixed)
vcf_path string 必填 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 运行提示开关。