HTML Report Module

Interactive HTML report generation

HTML report generation for VariantCentrifuge.

variantcentrifuge.generate_html_report.is_safe_url(url)[source]

Check if a URL uses a safe scheme (http, https, or relative path).

Parameters:

url (Any)

Return type:

bool

variantcentrifuge.generate_html_report.compute_variant_key(v)[source]

Generate a stable allele-aware key for a variant record.

Incorporates CHROM, POS, REF, ALT, and transcript FEATUREID when available. Duplicate annotation rows share the key, while distinct alternate alleles or missing/repeated VAR_ID values produce distinct keys.

Parameters:

v (dict[str, Any])

Return type:

str

variantcentrifuge.generate_html_report.compute_report_id(variants_data, vcf_source='Unknown', reference_genome='Unknown', filter_expression='None', cfg_report_id=None)[source]

Generate a deterministic report dataset ID / fingerprint.

If an explicit report_id is provided in configuration, it is used directly. Otherwise, a deterministic SHA256 hex digest is derived from provenance and the variants data.

Parameters:
Return type:

str

variantcentrifuge.generate_html_report.generate_html_report(variants_json, summary_json, output_dir, cfg)[source]

Generate an interactive HTML report of variants and summary statistics.

Parameters:
  • variants_json (str) – Path to the variants JSON file containing detailed variant records.

  • summary_json (str) – Path to the summary JSON file containing summary metrics.

  • output_dir (str) – Directory to write the generated HTML report and assets.

  • cfg (dict[str, Any]) – The main configuration dictionary containing report settings.

Return type:

None