Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
VariantCentrifuge 0.5.0 documentation

User Guide

  • Installation
  • Usage Guide
  • Configuration
  • Practical Guides
    • Annotation Strategies
    • Cohort Analysis Guide
    • Rare Disease Analysis Workflow
    • Cancer Genomics Analysis
    • Variant Scoring Guide
    • Custom Filter Development
    • Performance Optimization

API Reference

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

Development

  • Development Guide
  • Contributing to VariantCentrifuge
  • 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”.

For example, if you have a link defined as: “links”: {

System Message: ERROR/3 (/home/runner/work/variantcentrifuge/variantcentrifuge/variantcentrifuge/links.py:docstring of variantcentrifuge.links, line 9)

Unexpected indentation.

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

System Message: WARNING/2 (/home/runner/work/variantcentrifuge/variantcentrifuge/variantcentrifuge/links.py:docstring of variantcentrifuge.links, line 10)

Block quote ends without a blank line; unexpected unindent.

}

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.add_links_to_table(lines, link_configs)[source]¶

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

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

  • link_configs (dict of str to 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 of 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, Bernt Popp
Made with Sphinx and @pradyunsg's Furo
On this page
  • Links Module
    • add_links_to_table()