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.
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:
0or1only
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
tmbormutation: integer mutation count - Optional column
class: sample subtype label (e.g. LUAD, LUSC). When present, ssimpy computes separate expected matrices per class.
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
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 symbolTumor_Sample_Barcode— sample identifierVariant_Classification— mutation type (see table below)
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
| Category | Variant_Classification values |
|---|---|
| Silent (excluded) | Silent, Synonymous_Mutation |
| Missense | Missense_Mutation, In_Frame_Del, In_Frame_Ins |
| Truncating | Nonsense_Mutation, Frame_Shift_Del, Frame_Shift_Ins, Splice_Site, Splice_Region, Nonstop_Mutation, Translation_Start_Site |
| Other non-silent | All 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:
sampleandclass. 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
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.
Direction badges: co-occurrence (green) and mutual exclusivity (violet).
Parameters
MAF conversion (MAF mode only)
| Parameter | Default | Description |
|---|---|---|
min_samples | 2 | Minimum number of distinct samples mutated in a gene for it to be retained in the GAM |
min_mutations | 1 | Minimum total mutation count across all samples for a gene to be retained |
split_by_type | off | If enabled, separate missense and truncating GAM/TMB files are generated and passed to ssimpy as per-type covariates |
ssimpy analysis
| Parameter | Default | Description |
|---|---|---|
N | 1000 | Number of rcRAS null simulations. Higher values give more stable FDR estimates; 10 000 is recommended for publication figures. |
FDR threshold | 0.1 | Maximum FDR for a pair to be called significant |
min_mut | 5 | Genes mutated in fewer samples than this threshold are excluded before testing |
τ (tau) | 1.0 | TMB fold-change above which a sample is considered hypermutated and penalised |
λ (lam) | 0.3 | Rate of penalisation applied to hypermutated samples (0 = no penalisation, 1 = full down-weighting) |
filter_pct | 0.10 | Fraction of simulations with the most extreme statistics to discard before FDR calibration |
seed | none | Random 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:
| Column | Description |
|---|---|
gene1, gene2 | The two genes forming the pair |
n_mut_gene1, n_mut_gene2 | Number of samples mutated in each gene |
n_comut | Number of samples mutated in both genes simultaneously |
freq_gene1, freq_gene2 | Mutation frequency (fraction of samples) for each gene |
nES | Normalised effect size: positive = co-occurrence, negative = mutual exclusivity. Larger absolute value means stronger signal. |
direction | co-occurrence or mutual_exclusivity |
FDR | Estimated false discovery rate for this pair |
significant | True if FDR is below the chosen threshold |