Variants CLI Documentation¶
The Variants CLI allows users to search for and retrieve genetic variant information using the MyVariant.info API.
API Documentation: For details about the underlying API, see the MyVariant.info API Documentation.
Tip: Use the
--help
flag with any command (e.g.,biomcp variant search --help
) to see the most up-to-date options directly from the tool.
Search Command (search
)¶
Search for genetic variants using multiple parameters and filters. At least one search parameter (like gene, hgvsp, rsid, region) is required.
Usage¶
Basic Search Parameters¶
-g, --gene TEXT
: Gene symbol to search for (e.g., BRAF, TP53).--hgvsp TEXT
: Protein change notation using HGVS format (e.g., "p.Val600Glu", "p.V600E"). Often used with--gene
.--hgvsc TEXT
: cDNA change notation using HGVS format (e.g., "c.1799T>A"). Often used with--gene
.--rsid TEXT
: dbSNP rsID (e.g., "rs113488022").--region TEXT
: Genomic region in format chr:start-end (e.g., "chr7:140453100-140453200").
Clinical and Functional Filters¶
-s, --significance [pathogenic|likely_pathogenic|uncertain_significance|likely_benign|benign]
: Filter by ClinVar clinical significance. Case-insensitive.--min-frequency FLOAT
: Minimum gnomAD exome allele frequency (0.0 to 1.0).--max-frequency FLOAT
: Maximum gnomAD exome allele frequency (0.0 to 1.0).--cadd FLOAT
: Minimum CADD phred score (e.g., 15, 20). Filters for variants with score >= value.--polyphen [D|P|B]
: Filter by PolyPhen-2 prediction (D: Probably damaging, P: Possibly damaging, B: Benign). Case-insensitive.--sift [D|T]
: Filter by SIFT prediction (D: Deleterious, T: Tolerated). Case-insensitive.
Output and Source Options¶
--sources TEXT
: Comma-separated list of specific data sources to include in the results (e.g., "clinvar,dbsnp,cosmic"). See MyVariant.info docs for source names. Adding sources can increase the detail in the output.--size INTEGER
: Maximum number of results to return [default: 40].--offset INTEGER
: Result offset for pagination [default: 0]. Use with--size
for paging.--sort TEXT
: Field to sort results by, using MyVariant.info syntax (e.g., "cadd.phred:desc").-j, --json
: Render output in JSON format instead of Markdown.--help
: Show help message and exit.
Examples¶
Search for a variant by gene and protein change:
Search for pathogenic variants in TP53:
Search for rare (max freq 0.1%) BRAF variants with high CADD score:
Search by genomic region:
Search by rsID and request extra data from COSMIC:
Get results as JSON:
Get Command (get
)¶
Retrieve detailed information about a single specific variant by its identifier.
Usage¶
Arguments¶
VARIANT_ID
: The variant identifier. This can be a MyVariant.info ID (HGVS format, e.g., "chr7:g.140453136A>T") or a dbSNP rsID (e.g., "rs113488022"). [required]
Options¶
-j, --json
: Render output in JSON format instead of Markdown.--help
: Show help message and exit.
Examples¶
Get a variant by HGVS ID:
Get a variant by rsID:
Get a variant by rsID as JSON:
Output Format¶
By default, both search and get output variant information in Markdown format, designed for readability. This includes key annotations and automatically generated links to external databases like dbSNP, ClinVar, Ensembl, UCSC Genome Browser, etc., where applicable.
Use the --json
flag to get the raw data (with injected URLs) as a JSON object, which is useful for scripting or integration with other tools. The specific fields returned by default in a search focus on common identifiers and annotations; use --sources
to request more comprehensive data for specific databases. The get command retrieves all available default fields plus database links.