Overview

SelectSim (implemented here as ssimpy) detects statistically significant pairwise somatic co-mutations in cancer genomics data. For every gene pair it tests two hypotheses:

  • Co-occurrence — the two genes are mutated together more frequently than expected by chance (e.g. synergistic driver combinations).
  • Mutual exclusivity — the two genes are mutated together less frequently than expected (e.g. genes in the same pathway where a single hit suffices).

The algorithm simulates a null distribution via rcRAS (row-sum-corrected rejection-acceptance sampling), which exactly preserves each gene's observed mutation frequency. An FDR is then estimated separately for co-occurrence and mutual exclusivity by comparing observed effect sizes against the null.

ssimpy corrects for tumor mutational burden (TMB) by down-weighting hypermutated samples, and supports sample class covariates (e.g. LUAD vs LUSC) and multiple mutation-type covariates (e.g. missense vs truncating).

GAM — Gene Alteration Matrix

The GAM is a binary genes × samples matrix stored as a tab-separated file. Each cell is 1 if the gene is mutated in that sample, and 0 otherwise.

Format

  • First column header: Gene (gene names, one per row)
  • Remaining column headers: sample identifiers
  • Values: 0 or 1 only
Example: lung_gam_missense.tsv (396 genes × 966 samples) ⬇ Download example
Gene	TCGA-05-4244-01	TCGA-05-4249-01	TCGA-05-4250-01	TCGA-05-4382-01	…
AKT1	0	0	0	0	…
EGFR	0	0	0	0	…
KRAS	1	1	1	0	…
STK11	0	0	0	0	…
TP53	0	1	0	0	…

When to use multiple GAM files

When you want to model different mutation types separately (e.g. missense and truncating), you provide one GAM per type. All GAMs must share the same set of genes and samples in the same order — they are not concatenated. ssimpy computes the expected mutation probability matrix for each type independently, then takes the element-wise maximum to obtain the combined expected matrix E. The observed mutation matrix used for testing is the element-wise union (OR) of all GAMs.

TMB — Tumor Mutational Burden

The TMB file provides the total number of non-silent somatic mutations per sample, used to penalise hypermutated samples so they do not dominate the signal. TMB should be computed from all non-silent mutations genome-wide, not limited to the genes retained in the GAM.

Format

  • Column sample: sample identifier (must match GAM column headers)
  • Column tmb or mutation: integer mutation count
  • Optional column class: sample subtype label (e.g. LUAD, LUSC). When present, ssimpy computes separate expected matrices per class.
Example: lung_tmb_missense.tsv (966 samples, two tumour classes) ⬇ Download example
sample	mutation	class
TCGA-05-4244-01	163	LUAD
TCGA-05-4249-01	253	LUAD
TCGA-05-4250-01	270	LUAD
TCGA-18-3406-01	341	LUSC
TCGA-18-3407-01	189	LUSC
TMB files are optional. If omitted, ssimpy derives per-sample mutation burden directly from the column sums of the GAM, which is less accurate but sufficient for exploratory analyses.

MAF — Mutation Annotation Format

A MAF file is the standard output of somatic variant callers (e.g. MuTect2 via TCGA pipelines). Instead of preparing GAM and TMB files manually, you can upload a MAF directly and the web service will convert it automatically using the maf_to_ssimpy converter.

Required columns

  • Hugo_Symbol — HGNC gene symbol
  • Tumor_Sample_Barcode — sample identifier
  • Variant_Classification — mutation type (see table below)
Example MAF (first rows)
Hugo_Symbol	Tumor_Sample_Barcode	Variant_Classification	…
KRAS	TCGA-05-4244-01	Missense_Mutation	…
TP53	TCGA-05-4249-01	Nonsense_Mutation	…
EGFR	TCGA-05-4250-01	Missense_Mutation	…
STK11	TCGA-05-4250-01	Frame_Shift_Del	…

Mutation type classification

CategoryVariant_Classification values
Silent (excluded)Silent, Synonymous_Mutation
MissenseMissense_Mutation, In_Frame_Del, In_Frame_Ins
TruncatingNonsense_Mutation, Frame_Shift_Del, Frame_Shift_Ins, Splice_Site, Splice_Region, Nonstop_Mutation, Translation_Start_Site
Other non-silentAll remaining — counted in TMB and combined GAM, excluded from per-type files when split-by-type is enabled

Optional companion files

  • Sample metadata TSV — two columns: sample and class. Adds subtype labels to the TMB file, enabling class-stratified expected matrices.
  • Gene list TXT — one gene symbol per line (lines starting with # are ignored). Restricts the GAM to the listed genes only.

Using the web service

1 Choose your input format
Click either GAM / TMB Files (if you already have processed mutation matrices) or MAF File (if you are starting from raw variant calls). The page resets each time you click a mode card, so you can safely switch between them.
Screenshot
Step 1 — Mode selector cards
2 Upload your files
GAM / TMB mode: each row represents one mutation type. Click or drag a GAM file into the left drop zone and the matching TMB into the right. Click + Add mutation type for additional types (e.g. missense and truncating). All GAMs must contain the same genes and samples.

MAF mode: upload your MAF file. Optionally add a sample metadata TSV (for subtype covariates) and/or a gene list to restrict the analysis. Set the minimum number of mutated samples and minimum mutation count per gene before a gene is included.
Screenshot
Step 2 — GAM / TMB file upload (two mutation types)
Screenshot
Step 2 — MAF file upload with optional metadata
3 Set analysis parameters
Adjust the number of simulations, FDR threshold, and other ssimpy parameters (see the Parameters section below). Defaults are suitable for most analyses.
4 Run and explore results
Click Run ssimpy. The table shows significant pairs sorted by FDR. Toggle Show all pairs to include non-significant results. Click any column header to re-sort. Download the full results as a TSV with the ⬇ Download TSV button.

Direction badges: co-occurrence (green) and mutual exclusivity (violet).
Screenshot
Results table — significant pairs sorted by FDR

Parameters

MAF conversion (MAF mode only)

ParameterDefaultDescription
min_samples2Minimum number of distinct samples mutated in a gene for it to be retained in the GAM
min_mutations1Minimum total mutation count across all samples for a gene to be retained
split_by_typeoffIf enabled, separate missense and truncating GAM/TMB files are generated and passed to ssimpy as per-type covariates

ssimpy analysis

ParameterDefaultDescription
N1000Number of rcRAS null simulations. Higher values give more stable FDR estimates; 10 000 is recommended for publication figures.
FDR threshold0.1Maximum FDR for a pair to be called significant
min_mut5Genes mutated in fewer samples than this threshold are excluded before testing
τ (tau)1.0TMB fold-change above which a sample is considered hypermutated and penalised
λ (lam)0.3Rate of penalisation applied to hypermutated samples (0 = no penalisation, 1 = full down-weighting)
filter_pct0.10Fraction of simulations with the most extreme statistics to discard before FDR calibration
seednoneRandom seed for reproducibility. Leave blank for a different result on each run.

Output

Results are available as a sortable table in the browser and as a downloadable TSV. Each row corresponds to one gene pair. Key columns:

ColumnDescription
gene1, gene2The two genes forming the pair
n_mut_gene1, n_mut_gene2Number of samples mutated in each gene
n_comutNumber of samples mutated in both genes simultaneously
freq_gene1, freq_gene2Mutation frequency (fraction of samples) for each gene
nESNormalised effect size: positive = co-occurrence, negative = mutual exclusivity. Larger absolute value means stronger signal.
directionco-occurrence or mutual_exclusivity
FDREstimated false discovery rate for this pair
significantTrue if FDR is below the chosen threshold
Data privacy: uploaded files are deleted from the server immediately after ssimpy finishes running. The result TSV is deleted as soon as you download it. Any job not downloaded within one hour is automatically purged.