Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
VariantCentrifuge - Clinical Variant Analysis Tool

User Guide

  • Installation
  • Usage Guide
  • Configuration
  • Resume System
  • Frequently Asked Questions

Practical Guides

  • Annotation Strategies
  • Rare Disease Analysis Workflow
  • Cancer Genomics Analysis
  • Inheritance Analysis
  • Cohort Analysis Guide
  • Association Testing Guide
  • Cohort-Stratified Meta-Analysis
  • Variant Scoring Guide
  • Custom Filter Development
  • Privacy and Pseudonymization
  • Performance Optimization

API Reference

  • API Reference
    • CLI Module
    • Pipeline Module
    • Configuration Module
    • checkpoint
    • Analyze Variants Module
    • Gene Burden Module
    • Association Testing Module
    • Statistics Module
    • Scoring Module
    • Filters Module
    • Extractor Module
    • Converter Module
    • Utils Module
    • Helpers Module
    • Validators Module
    • HTML Report Module
    • IGV Report Module
    • Links Module
    • Phenotype Module
    • Gene BED Module

Development

  • Development Guide
  • Contributing to VariantCentrifuge
  • Citation and release archiving
  • Changelog
Back to top
View this page

Links Module¶

External database link generation

Module for adding configurable links to output tables.

This module provides functionality to add new columns containing URL links to each variant line in the final output. The URLs and their substitution logic are defined in the configuration file (config.json) under “links” or “links_by_build”.

For example, if you have a link defined as:

"links": {
    "SpliceAI": "https://spliceailookup.broadinstitute.org/#variant={CHROM}-{POS}-{REF}-{ALT}&hg=38&bc=basic&distance=500&mask=0&ra=0"
}

This will create a new column named “SpliceAI” with a URL where {CHROM}, {POS}, {REF}, {ALT} are replaced by the corresponding values from each row.

variantcentrifuge.links.normalize_reference(reference)[source]¶

Normalize a reference genome identifier to canonical assembly name.

Returns ‘GRCh37’ for hg19/GRCh37 references and ‘GRCh38’ for hg38/GRCh38 references, ignoring version suffixes (e.g., GRCh37.75, GRCh38.99). Returns None for unsupported or non-human assemblies.

Parameters:

reference (str | None)

Return type:

str | None

variantcentrifuge.links.resolve_links(config)[source]¶

Resolve external link configurations based on genome build and explicit configuration.

If ‘links’ is explicitly configured with custom templates (i.e. not matching the bundled defaults), those custom templates are preserved. Otherwise, links are resolved from ‘links_by_build’ based on ‘reference’. If the reference build is unsupported or unknown, bundled links return an empty dict to prevent silently generating hg19 links from GRCh38 or non-human coordinates.

Parameters:

config (dict[str, Any]) – Configuration dictionary containing ‘reference’, optional ‘links’, and optional ‘links_by_build’.

Returns:

The resolved link templates mapping link names to URL templates.

Return type:

dict[str, str]

variantcentrifuge.links.add_links_to_table(lines, link_configs)[source]¶

Add link columns to the table lines based on provided link configurations.

Parameters:
  • lines (list[str]) – The lines of the final table (including header).

  • link_configs (dict[str, str]) – A dictionary where keys are link column names and values are URL templates. URL templates contain placeholders like {CHROM}, {POS}, {REF}, {ALT} that are replaced with values from the corresponding columns.

Returns:

The modified lines with new link columns appended.

Return type:

list[str]

Notes

  • Assumes the first line is a header line.

  • Each link column is appended to the end of the table.

  • Placeholders in the link template must match header column names exactly (case-sensitive).

  • If a placeholder column doesn’t exist in the header, the link will be empty.

Next
Phenotype Module
Previous
IGV Report Module
Copyright © 2024-2026, Bernt Popp
Made with Sphinx and @pradyunsg's Furo
On this page
  • Links Module
    • normalize_reference()
    • resolve_links()
    • add_links_to_table()