Skip to content

Add local event collapsing to avoid inflated counts from adjacent LoF-like indel/MNV fragments #107

Description

@berntpopp

Problem

VariantCentrifuge currently reports/counts each VCF row independently. For high-impact / LoF-oriented analyses this can inflate gene-level counts when a local complex allele is represented as several adjacent indel/SNV rows in the same sample and gene.

This is not the same as common/benign leakage, low QUAL leakage, or low-complexity BED filtering. The residual artifact is a representation problem: multiple adjacent rows often describe one local haplotype / complex allele, but unique_variants and especially allele-count style summaries treat them as independent events.

Example patterns observed

No sample identifiers are included here. These are same-sample, same-gene local clusters from a high-impact/LoF-style output. The examples show only gene, locus span, row count, and retained annotations.

FLCN chr17:17224007-17224014, 5 rows across 8 bp
T>TCTGATCTGTA; A>AGCGC; T>TGTAC; A>AGCGC; T>TG
all annotated as frameshift_variant
HGVS.c examples: c.532_533insTACAGATCAG; c.529_530insGCGC; c.528_529insGTAC; c.526_527insGCGC; c.525dupC
COL4A4 chr2:227060181-227060186, 2 rows across 6 bp
CTT>C; T>TAAAG
both annotated as frameshift_variant
HGVS.c examples: c.2117_2118delAA; c.2113_2114insCTTT
NPHP1 chr2:110129185-110129190, 2 rows across 6 bp
CCCTG>C; AGAGCATC>A
annotated as frameshift_variant/splice_region and frameshift_variant
PARG chr10:49885201-49885205, 2 rows across 5 bp
A>T; G>A
annotated as splice_donor_variant and stop_gained/splice_region_variant
PGAM5 chr12:132717986-132717987, 2 rows across 2 bp
G>T; C>T
annotated as splice_acceptor_variant and stop_gained/splice_region_variant

In a gene count plot or burden-style table, these look like multiple independent LoF variants/alleles, although they may represent one complex local event in one sample.

Expected behavior / requested feature

Please add an optional local event collapsing mode before gene-level summarization and burden/association counting, for example:

--collapse-local-events
--collapse-local-events-window-bp 10
--collapse-local-events-by sample,gene,chrom

Suggested behavior:

  • Sort qualifying rows by sample, gene, chromosome, position.
  • Merge rows into one event when adjacent qualifying variants in the same sample/gene/chromosome are within N bp of each other, default perhaps 10 bp.
  • Count the merged event once for per-gene sample-event or burden-like summaries.
  • Keep an audit table listing the collapsed rows and original variant IDs/loci/HGVS/consequences.
  • Make the mode explicit, because for some use cases users may still want raw row/allele counts.

Possible output columns:

local_event_id
local_event_start
local_event_end
local_event_span_bp
local_event_n_rows
local_event_positions
local_event_ref_alt
local_event_effects

Why this matters

For rare high-impact analyses, these adjacent rows can dominate unique_variants or allele-count summaries and make genes appear stronger than they are. A sample-event mode is often more robust for exploratory gene discovery figures and gene-level burden screens, while still preserving the raw rows for review.

This would also make VariantCentrifuge outputs easier to use downstream without each project having to implement its own local-complex-allele triage layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions