Reanalyzing Somatic Indels on Locally Personalized Genomes for Indel Signature Analysis
indelinside is a command-line tool that resolves mapping ambiguities for indel signature analysis by realigning variants against a locally personalized germline background.
-
Harmonization Unifies inconsistent indel representations across different variant callers.
-
Local Haplotype Assembly Constructs local diploid germline haplotypes (
hap1&hap2) from the normal BAM file, alongside the somatic indel haplotype (hap0) from the tumor BAM file. -
Origin Inference Determines which germline haplotype (
hap1orhap2) the somatic indel was derived from. -
Personalized Realignment Realigns the somatic haplotype (
hap0) to its inferred parent germline background. Depending on the context, the indel may be personalized to a substitute, a different indel class, or a complex indel—delivering a polished input for downstream signature analysis.
indelinside is distributed as a command-line utility within the variantPost package:
pip install variantpostThe pipeline consists of two steps: local personalization of somatic indels followed by feature extraction into an indel signature matrix.
Input BAM files and arbitrary numbers of VCFs from different variant callers into personalize. Variants are automatically consolidated, harmonized, and realigned against inferred germline haplotypes.
indelinside personalize \
-t tumor.wgs.bam \
-n normal.wgs.bam \
-r reference.fa \
-v caller_a.vcf caller_b.vcf caller_c.vcf \
-o indelinside.out.txt \
-p 12 # for faster analysisGenerate a COSMIC-compatible indel signature matrix from the personalized output. Filter consensus calls across callers using -c / --consensus_level. -c N selects indels called by N or more callers (-c 1 is the union of all callers).
indelinside matrix \
-i indelinside.out.txt \
-c 2 \
--sample_name my_sampleThe output matrix can be used as input for external signature analysis tools such as SigProfilerAssignment.
from SigProfilerAssignment import Analyzer
Analyzer.cosmic_fit(
samples="my_sample.indel_83_matrix.txt", # COSMIC-compatible 83-indel channel matrix
output="/path/to/output_dir",
input_type="matrix",
context_type="ID",
collapse_to_SBS96=False,
signature_database="/path/to/COSMIC_signature_database" # restrict IDs as needed
)variantPost internally uses the following packages. I thank the developers for making them freely available.