Skip to content

CLI reference ​

Run npx variant-linker --help, or npm install --global variant-linker. Node.js 22.14+ is required. For integration, see the API and browser/package guide.

Inputs and basic usage ​

Supply one of --variant, --variants, --variants-file or --vcf-input. Without these, redirected stdin is read as one variant per line.

bash
variant-linker --variant "rs6025" --output JSON
variant-linker --variant "ENST00000366667:c.803C>T" --output CSV
variant-linker --variant "1-65568-A-C" --output TSV
variant-linker --variant "7:117559600-117559609:DEL" --output VCF
variant-linker --variants "rs6025,rs1799963" --output JSON
variant-linker --variants-file variants.txt --output TSV
variant-linker --vcf-input family.vcf --output VCF --output-file annotated.vcf
cat variants.txt | variant-linker --output TSV --chunk-size 100

Supported inputs include rsIDs, HGVS, VCF-style coordinates, and CNVs expressed as chrom:start-end:DEL, DUP or CNV. Use --vcf-input for a complete VCF with headers and sample genotypes. Variant text files contain one input per line.

All options ​

OptionAliasPurpose
--variant-vSingle input.
--variants-vsComma-separated inputs.
--variants-file-vfVariant text file.
--vcf-input-viVCF file path.
--output-oJSON (default), CSV, TSV, SCHEMA, VCF.
--output-file-ofOutput path.
--save-sFilename to save results (alternative to --output-file).
--assemblyhg38 (default), hg19, hg19tohg38.
--vep_params-vpComma-separated VEP key=value options.
--recoder_params-rpComma-separated Recoder key=value options.
--filter-fJSON-encoded result filter.
--pick-output-poRetain selected transcript output.
--scoring_config_path-scpScoring configuration directory.
--ped-pPED pedigree file.
--calculate-inheritance-ciInfer inheritance using genotype and pedigree/trio context.
--sample-map-smThree sample IDs in index,mother,father order.
--bed-file-bfBED path; repeat for multiple files.
--gene-list-glGene-list path; repeat for multiple files.
--json-genes-jgJSON gene path; repeat for multiple files.
--json-gene-mappingJSON object with identifier and optional dataFields.
--streamProcess a VCF in bounded record chunks.
--chunk-size-csLogical streaming chunk size (default 100).
--spreadsheet-safeProtect CSV/TSV text cells for spreadsheet import.
--cache-CEnable request caching.
--api-base-urlExplicit Ensembl-compatible endpoint.
--api-timeoutPer-attempt timeout in milliseconds (default 60,000).
--api-concurrencySimultaneous POST batches: 1 (default) or 2.
--proxyHTTP proxy URL.
--proxy-authusername:password; requires --proxy.
--config-cJSON config; explicit CLI options take precedence.
--debug-dRepeat for diagnostic levels 1–3.
--log_file-lfDiagnostic log path.
--semver-svDisplay semantic-version details and exit.
--version-VDisplay version.
--help-hDisplay generated help.

Inputs are sent to the selected annotation service. Debug logs can contain variant and annotation data; review logs before sharing them.

Output and streaming ​

ModeContract
Complete JSONOne object with annotations and metadata.
Complete SCHEMAOne validated JSON-LD Dataset.
Streaming JSON/SCHEMANDJSON: one compact document per completed chunk.
CSV/TSVFixed column order; one header for streamed output.
VCFPreserved source records, headers and samples plus annotations. Direct coordinate/CNV inputs can also produce VCF.

CSV quotes delimiters and quotes. TSV escapes tabs, newlines and backslashes. --spreadsheet-safe protects potentially executable text cells; signed numbers remain numeric. Diagnostics go to stderr. Any failed input or chunk gives a nonzero exit status, even when partial output has been written. Check pipeline exit status before considering output complete.

bash
variant-linker --vcf-input large.vcf --stream --chunk-size 100 --output VCF > annotated.vcf
variant-linker --vcf-input large.vcf --stream --output JSON > annotations.ndjson

Streaming retains whole multiallelic records and respects output backpressure. One record can exceed the logical chunk size; duplicate records count toward it. Inheritance is rejected with --stream because it needs full-file context. Stdin chunks are also unsuitable for cohort-wide compound-heterozygous inference.

Enrichment and filtering ​

bash
variant-linker --vcf-input family.vcf --ped family.ped --calculate-inheritance --output JSON
variant-linker --vcf-input trio.vcf --calculate-inheritance --sample-map "child,mother,father" --output VCF
variant-linker --variants-file variants.txt --scoring_config_path scoring/nephro_variant_score --output CSV
variant-linker --vcf-input sample.vcf --bed-file regions.bed --gene-list panel.txt --output JSON
variant-linker --variant rs6025 --json-genes genes.json --json-gene-mapping '{"identifier":"gene_symbol","dataFields":["panel_name"]}' --output JSON
variant-linker --variant rs6025 --vep_params "flag_pick=1,hgvs=1" --pick-output --output TSV

Scoring directories contain variable_assignment_config.json and formula_config.json. Formulas use a restricted expression language; arbitrary JavaScript is rejected. See scoring, inheritance, and custom annotations for formats.

--filter takes the JSON filter syntax described in filtering. VCF filtering retains the complete original record and ALT list when any of its annotations survives. Transcript selection does not invent missing transcripts.

Assembly and request configuration ​

bash
variant-linker --assembly hg19 --variant "22-16050075-A-G" --output JSON
variant-linker --assembly hg19tohg38 --variant "chr17-7578406-C-A" --output JSON
variant-linker --variants-file variants.txt --api-timeout 60000 --api-concurrency 2 --cache
variant-linker --variant rs6025 --proxy http://proxy.example.org:8080

Liftover validates reference span, orientation and target reference. Ambiguous mappings fail explicitly. JSON metadata records original/lifted coordinates. Source VCF coordinates stay in their original assembly, while annotations may refer to the target assembly. CLI hg19tohg38 requires coordinate or VCF input.

Advanced per-fetch budgets can be supplied in --config config.json:

json
{
  "assembly": "hg19",
  "output": "JSON",
  "requestOptions": {
    "timeoutMs": 60000,
    "deadlineMs": 120000,
    "maxRetries": 2,
    "postConcurrency": 1
  }
}

The deadline includes retries and backoff for each fetch, not the entire analysis. --api-base-url or ENSEMBL_BASE_URL selects an explicit service; choose its intended assembly. Node environment proxies are supported. See API budgets, proxy settings, cache settings, and reliable processing.

Released under the MIT License.