query_variants

read-onlyidempotent

Query genetic variants in authorized samples.

Use this tool to retrieve genotyped loci and public annotations by gene, HGVS notation, genomic region, GWAS Catalog trait, or BRaVa rare-variant association. Results include per-sample genotype calls (dosage: 0=genotyped without the allele, 1=one copy, 2=two copies), plus public ClinVar annotations, GWAS Catalog trait associations and BRaVa rare-variant associations at each locus when available (hgvs/region queries return all three; clinvar, gwas and brava queries return their own). BRaVa covers rare coding variants (allele frequency <= 0.001) and keeps only results with p <= 0.01, so a locus without BRaVa results has no nominal BRaVa signal; it may still have been studied. A brava query leaves out the variants every sample is called at without the allele (counted in not_carried), and HaploHub reports no variant where no sample has a call. Each BRaVa result names BRaVa as its source with the citation URL: cite it when you report one. This is for educational, research, and wellness information workflows, not clinical determinations.

Alleles: a locus line lists every alternate allele of the genotype record. When an entry has allele, its dosage counts that one allele, and two entries can share a locus with different alleles. Region and gwas entries have no allele, and their dosage counts any alternate allele.

Batch lookups: put up to 20 loci in one call (positions, or a list of hgvs strings) rather than looping one locus per call. Each call is a full upstream query, so the batch is both faster and far cheaper.

Parameters

query_type
string
required

The type of variant query. "clinvar" — search public ClinVar annotations by gene names and ClinVar significance labels. "hgvs" — look up a specific variant by HGVS notation (e.g. "NC_000013.11:g.32356461T>G"). "region" — scan a genomic region by chromosome and position range, or look up a batch of loci via positions. "gwas" — find GWAS Catalog trait/allele associations at the authorized genotyped loci, by gene (gene_symbols), rs id (rs_ids), or trait (trait_id). Use for published trait-association lookup and biomarker context, not diagnosis. "brava" — check the authorized samples at BRaVa rare coding variants (allele frequency <= 0.001, results with p <= 0.01). It takes the limit most significant BRaVa variants (default and max 1000) matching gene_symbols (first non-blank symbol), trait_id and p_value_max, and genotypes the samples there. A variant where every sample is called without the allele (dosage 0) is left out and counted in not_carried. A variant where no sample has a call is not reported at all: sparse genotype data (arrays, many imputed files) rarely covers variants this rare. So an empty result means none of the checked variants is called with the allele in the samples, not that the samples carry no BRaVa variant. Give both a gene and a trait for a focused question; list_brava_traits gives the trait codes. The filters only choose the variants: each returned variant comes with all its BRaVa associations, for every trait.

One of: "clinvar", "hgvs", "region", "gwas", "brava"

chromosome
string | null
optional

Chromosome accession (e.g. "chr13", "NC_000013.11"). Required when query_type is "region" and positions is not given.

clinical_significance
string[] | null
optional

ClinVar significance-label filter. Defaults to ["Pathogenic", "Likely_pathogenic"]. Other useful values: "Uncertain_significance", "Benign", "Likely_benign", "drug_response". These labels come from public ClinVar records and are used for reference-database search, not determinations about any person or sample. Case-insensitive substring match.

end
integer | null
optional

1-based end position. Required when query_type is "region" and positions is not given.

gene_symbols
string[] | null
optional

Gene symbols to query (e.g. ["APOE", "TCF7L2"]). Required when query_type is "clinvar". Use known gene symbols from the user's request or from a prior public reference search; for broad trait questions, identify relevant genes or trait ids with the reference tools first.

hgvs
string | string[] | null
optional

HGVS notation (e.g. "NC_000013.11:g.32356461T>G"), one string or a list of up to 20 to look up in one call. Required when query_type is "hgvs". Supports both c. and g. notation.

intent
string | null
optional

One or two sentences on what the user is trying to learn and why this query serves it, under 400 characters. Describe the goal in general terms (e.g. "Checking known pathogenic variants in hereditary cancer genes the user asked about"). Do not include names, ages, relatives, symptoms, diagnoses, medications, locations, or genotypes. Stored with the query to review whether queries match what users ask for.

limit
integer
optional, default 1000

Only used when query_type is "brava": how many of the most significant matching BRaVa variants to check (default and max 1000).

p_value_max
number | null
optional

Maximum association p-value (e.g. 5e-8 for genome-wide significance). Only used when query_type is "gwas" or "brava".

positions
string[] | null
optional

Batch of loci for query_type "region", up to 20 per call, each "<chromosome>:<position>" or "<chromosome>:<start>-<end>" (e.g. ["chr4:67031670", "chr5:103743441-103743500"]). Use this instead of one call per SNP: every call is a full upstream query, so 20 loci in one call cost far less than 20 calls. Takes precedence over chromosome/start/end.

rs_ids
string[] | null
optional

SNP rs ids to look up (e.g. ["rs7903146"]). Only used when query_type is "gwas".

sample_id
string | null
optional

Optional: query only this sample instead of all user samples. Use a sample_id from list_samples.

start
integer | null
optional

1-based start position. Required when query_type is "region" and positions is not given.

trait_id
string | null
optional

GWAS Catalog / EFO trait id (e.g. an EFO id) to filter associations when query_type is "gwas". When query_type is "brava", a BRaVa trait code from list_brava_traits (e.g. "LDLC").

Response

samples
object
required

Label of each queried sample, keyed as in calls.

variants
object[]
required
variants[].calls
object
required

Dosage per sample, keyed like samples: 0 means the sample was genotyped here and does not carry the allele, 1 one copy, 2 two. A sample with no call at the locus is left out. With allele or query, the dosage counts that allele only. Without them (region and gwas queries) it counts any alternate allele of the record.

variants[].locus
string
required

accession:position, followed by :ref>alt when both alleles are known, e.g. "NC_000019.10:44908684:T>C". A record with several alternate alleles lists them all, e.g. "...:T>C,G".

variants[].allele
string
optional

The one alternate allele calls counts, as ref>alt, e.g. "T>C". Present when the result is pinned to one allele: brava and clinvar queries, and any result whose target named its allele. Two entries can share a locus with different alleles.

variants[].brava
object[]
optional

Present only when BRaVa has results for an allele at this locus.

variants[].brava[].allele
string
required

The allele BRaVa tested, as ref>alt, e.g. "G>A". When the entry has allele, the annotation matching it is the one the dosage counts. Otherwise the dosage counts any alternate allele of the record.

variants[].brava[].beta
number | null
required

Effect size.

variants[].brava[].citation
string | null
required

URL of the BRaVa publication to cite.

variants[].brava[].n
integer | null
required

Sample size.

variants[].brava[].n_cases
integer | null
required

Cases. Null for quantitative traits.

variants[].brava[].p
number
required

Association p-value.

variants[].brava[].release
string | null
required

The BRaVa release.

variants[].brava[].se
number | null
required
variants[].brava[].source
string
required

Always "BRaVa".

variants[].brava[].trait
object
required

The BRaVa trait an association belongs to.

variants[].brava[].trait.code
string
required

Trait code, e.g. "LDLC". Pass it as a trait filter.

variants[].brava[].trait.kind
string
required

"binary" (case/control) or "quantitative" (a measurement, e.g. LDL cholesterol).

variants[].brava[].trait.name
string
required
variants[].clinvar
object[]
optional

Present only when ClinVar has records here.

variants[].clinvar[].conditions
string | null
required
variants[].clinvar[].gene
string
required
variants[].clinvar[].review
string
required

ClinVar review status.

variants[].clinvar[].significance
string
required

ClinVar significance label, e.g. "Pathogenic".

variants[].error
string
optional
variants[].gwas
object[]
optional

Present only when the GWAS Catalog has records here.

variants[].gwas[].gene
string
required
variants[].gwas[].or_beta
number | null
required

Odds ratio or beta coefficient.

variants[].gwas[].p
number | null
required

Association p-value.

variants[].gwas[].pmid
string | null
required

PubMed id of the study.

variants[].gwas[].raf
string
required

Risk allele frequency, as the catalog reports it.

variants[].gwas[].reported_allele
string
required

The strongest reported risk allele, e.g. "rs7903146-T".

variants[].gwas[].rs
string
required
variants[].gwas[].study
string | null
required

GWAS Catalog study accession.

variants[].gwas[].trait
string
required
variants[].query
string
optional

hgvs queries only: the HGVS string this entry answers. calls counts the allele it names.

variants[].rs
string
optional
not_carried
integer
optional

brava queries only: checked BRaVa variants where every sample is called without the allele (dosage 0). They are left out of variants. Variants where no sample has a call are not counted or reported.

unresolved
object[]
optional

Present only when some items did not resolve.

unresolved[].query
string
required

The item as it was sent.

unresolved[].error
string
optional
unresolved[].resolved
string
optional

What the item resolved to, when it did.