Variant Annotation and Identifier Conversion: 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.
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.
Retrieve Ensembl variant consequences and annotations¶
dnakit.databases.ensembl_var_get_variant_consequences(*, variant_id, species=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
variant_id |
string | Required | dbSNP rsID of the variant. Examples: 'rs429358' (APOE), 'rs7903146' (TCF7L2), 'rs1042779'. |
species |
string | None | Species name. Default 'human'. Examples: 'human', 'homo_sapiens'. |
verbose |
bool | True | Progress flag. |
Annotate HGVS variants with Ensembl VEP¶
dnakit.databases.ensembl_vep_annotate_hgvs(*, hgvs_notation, species=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
hgvs_notation |
string | Required | Variant in HGVS notation. Supports protein (p.), coding DNA (c.), and genomic (g.) notation. Examples: 'BRAF:p.Val600Glu', 'ENST00000366667:c.803C>T', 'NC_000007.14:g.140753336A>T'. |
species |
string | None | Species name. Default: 'human'. Other options: 'mouse', 'rat', 'zebrafish', etc. |
verbose |
bool | True | Progress flag. |
Annotate rsID variants with Ensembl VEP¶
dnakit.databases.ensembl_vep_annotate_rsid(*, variant_id=None, rsid=None, rs_id=None, species=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
variant_id |
string | None | dbSNP rs identifier. Examples: 'rs7903146' (TCF7L2, type 2 diabetes), 'rs429358' (APOE, Alzheimer's), 'rs1801133' (MTHFR C677T). Aliases: rsid, rs_id. |
rsid |
string | None | Alias for variant_id. dbSNP rs identifier (e.g., 'rs7903146'). |
rs_id |
string | None | Alias for variant_id. dbSNP rs identifier (e.g., 'rs7903146'). |
species |
string | None | Species name. Default: 'human'. |
verbose |
bool | True | Progress flag. |
Annotate genomic variants with Ensembl VEP¶
dnakit.databases.ensembl_vep_region(*, species, region, allele=None, AncestralAllele=None, Blosum62=None, CADD=None, Conservation=None, DisGeNET=None, GeneSplicer=None, GO=None, LoF=None, MaxEntScan=None, Phenotypes=None, SIFT=None, PolyPhen=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
species |
string | Required | Species (e.g., 'human', 'homo_sapiens') |
region |
string | Required | Genomic region with variant (e.g., '21:25891796-25891796') |
allele |
string | None | Allele argument for a region variant in Ensembl VEP format. |
AncestralAllele |
integer | None | Include ancestral allele information |
Blosum62 |
integer | None | Include BLOSUM62 protein conservation score |
CADD |
integer | None | Include CADD scores |
Conservation |
integer | None | Include conservation scores |
DisGeNET |
integer | None | Include DisGeNET disease associations |
GeneSplicer |
integer | None | Include GeneSplicer predictions |
GO |
integer | None | Include Gene Ontology terms |
LoF |
integer | None | Include Loss-of-Function predictions |
MaxEntScan |
integer | None | Include MaxEntScan splice predictions |
Phenotypes |
integer | None | Include phenotype annotations |
SIFT |
string | None | SIFT prediction: p=prediction, s=score, b=both |
PolyPhen |
string | None | PolyPhen prediction: p=prediction, s=score, b=both |
verbose |
bool | True | Progress flag. |
Convert variant identifiers and HGVS representations¶
dnakit.databases.ensembl_vep_variant_recoder(*, variant_id, species=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
variant_id |
string | Required | Variant identifier to recode. Accepts: rsID (e.g., 'rs429358'), HGVS notation (e.g., 'AGT:c.803T>C'), SPDI (e.g., 'NC_000019.10:44908683:T:C'). |
species |
string | None | Species name. Default: 'human'. |
verbose |
bool | True | Progress flag. |
Annotate GRCh38 variants with FAVOR¶
dnakit.databases.favor_annotate_variant(*, variant, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
variant |
string | Required | GRCh38 SNV/indel as chr-pos-ref-alt. Accepts '19-44908822-C-T', 'chr19:44908822:C:T', etc. |
verbose |
bool | True | Progress flag. |
Retrieve variant annotations by HGVS or rsID¶
dnakit.databases.my_variant_get_variant_annotation(*, variant_id, fields=None, assembly=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
variant_id |
string | Required | HGVS variant ID (e.g., 'chr1:g.2186318G>A') or rsID (e.g., 'rs123'). An HGVS id must be expressed in the assembly given by the 'assembly' parameter. |
fields |
string | None | Fields to return. Useful fields: dbsnp, clinvar, cadd, gnomad_genome, gnomad_exome, dbnsfp (functional predictions). |
assembly |
string | None | Reference genome assembly for both the HGVS variant_id and the returned coordinates: 'hg19' (GRCh37, the default) or 'hg38' (GRCh38). |
verbose |
bool | True | Progress flag. |
Search variants by gene, position or clinical significance¶
dnakit.databases.my_variant_query_variants(*, query=None, fields=None, size=None, assembly=None, variant_id=None, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
query |
string | None | Search query. Examples: 'rs58991260' (rsID), 'chr7:g.55249071G>A' (HGVS), 'clinvar.gene.symbol:BRCA1' (gene in ClinVar), 'cadd.phred:>30' (high CADD score). |
fields |
string | None | Comma-separated fields to return. Common: dbsnp, clinvar, cadd, gnomad_genome, dbnsfp. |
size |
integer | None | Maximum number of results (1-100). |
assembly |
string | None | Reference genome assembly for the coordinates in the query and in the results: 'hg19' (GRCh37, the default) or 'hg38' (GRCh38). |
variant_id |
string | None | DNAKit optional alias for query |
verbose |
bool | True | Progress flag. |
Validate and convert HGVS variant descriptions¶
dnakit.databases.variant_validator_validate_variant(*, genome_build, variant_description, select_transcripts, verbose=True)
| Parameter | Type | Required / default | Description and constraints |
|---|---|---|---|
genome_build |
string | Required | Reference genome assembly: 'GRCh37' (hg19) or 'GRCh38' (hg38) |
variant_description |
string | Required | HGVS variant description (e.g., 'NM_007294.4:c.5266dup' for BRCA1 c.5266dupC, 'NM_000179.3:c.943C>T', 'chr17:g.43092919del') |
select_transcripts |
string | Required | Transcript to validate against (e.g., 'NM_007294.4'). Use 'all' to get all transcripts for a genomic variant. |
verbose |
bool | True | Progress flag. |