Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

SigMA2 - Mutational Signature Analysis in Python

SigMA2 detects mutational signatures and homologous-recombination deficiency (HRD) in tumours with few single nucleotide variants (SNVs): hybrid-capture panels, whole exomes and whole genomes. Trained classifiers ship with the package: install it, point it at your mutations, and say which question you are asking.

SigMA2 is the successor to SigMA; the original SigMA (v1) classifiers are included too, so earlier analyses stay reproducible.

Choose a classifier

Every question goes through one call, sg2.run(). The soi ("signature of interest") argument picks the classifier:

You want to know soi= Classifier Main output columns
Does the tumour carry Signature 3 (the HRD mutational signature)? "SBS3" SigMA2 SBS3 SBS3_mva, pass_mva, confidence
Is the tumour homologous-recombination deficient? "HRD" CSI-HRD: Signature 3 + deletions + copy number HRD_mva, hrd_call, confidence
Does it carry another signature (APOBEC, SBS4 tobacco, SBS7 UV, SBS8, SBS18)? that signature SigMA2 signature classifier <soi>_mva, pass_mva, confidence
Is it mismatch-repair (MMR) deficient, or POLE (DNA polymerase epsilon) mutated? – sg2.predict_mmrd_ppd() MMRD_category

Ask for HRD rather than SBS3 when the decision is about HR deficiency. On real MSK-IMPACT panels CSI-HRD finds 63 % of biallelic BRCA1/2 breast tumours at a 10 % false-positive rate, SigMA2 SBS3 33 % (see HRD).

Installation

SigMA2 is an alpha pre-release, so --pre is required:

pip install --pre sigma2

Python 3.9 or newer. One dependency, sorted-nearest, compiles during install, so a C toolchain is needed (build-essential on Debian/Ubuntu, base-devel on Arch, the Xcode command line tools on macOS).

Quickstart

import sigma2 as sg2

# Signature 3 on MSK-IMPACT breast panels
sbs3 = sg2.run(input="panels.maf", ref_genome="hg19", tumor_type="breast", seq_type="msk", soi="SBS3")

# HRD on the same panels, with their copy-number segments
hrd = sg2.run(input="panels.maf", ref_genome="hg19", tumor_type="breast", seq_type="msk", soi="HRD",
              segments="panels.seg")

hrd.df[["HRD_mva", "hrd_call", "confidence"]]

input is a MAF, a VCF (or a directory of them), or a 96-channel SNV matrix (CSV or DataFrame). seq_type is the sequencing platform:

seq_type Platform
msk MSK-IMPACT
fo FoundationOne
op OncoPanel
seqcap SeqCap EZ exome
tcga_mc3 TCGA whole exomes (MC3 calls)
wgs whole genome (signature reference models)

See what is installed

sg2.describe()                          # every classifier, its state and operating points
sg2.models(tumor_type="breast")         # names such as "breast/SBS3/msk", "breast/HRD/msk"
sg2.model("breast/HRD/msk")             # load one
sg2.verify_model("breast/HRD/msk")      # integrity check (SHA-256 fingerprint)

describe() shows two tables:

  • Signature classifiers. One row per tumour type, signature and platform, with the SNV floor, the state (● verified, ▲ experimental), and the cutoffs at a false-positive rate (FPR) of 10 % and 1 %.
  • HRD classifiers (CSI-HRD). One row per tumour type, one column per platform. Each cell says whether the tumour type has its own model (own) or shares the pooled one (pooled), with that model's cross-validated AUC (area under the ROC curve). A dash means that platform's model never saw the tumour type, and run() refuses it.

Mutational signatures

Signature classifiers bundled (released; every tumour type also has wgs reference models):

Tumour type Signature Platforms
breast SBS3, SBS8, SBS18, APOBEC fo, msk, op, seqcap, tcga_mc3
lung SBS4, APOBEC fo, msk, op, seqcap, tcga_mc3
lung SBS3, SBS18 fo, op, seqcap, tcga_mc3
prostate (prost) SBS3 seqcap, tcga_mc3
prostate (prost) SBS18 seqcap
skin SBS7 fo, msk, op, seqcap, tcga_mc3
colorectal (crc) SBS18, APOBEC fo, msk, op, seqcap, tcga_mc3
colorectal (crc) SBS8 seqcap, tcga_mc3

model="auto" (the default) picks the classifier for your tumour type, signature and platform.

Output. <soi>_mva is the score. pass_mva is a call at the cutoff for a 10 % false-positive rate and pass_mva_strict at 1 %. confidence is high (past 1 %), low (past 10 % only) or negative.

Experimental classifiers. Some combinations ship as experimental: lung SBS3 and SBS18 on msk, most prostate panel cells, and colorectal SBS8 on fo, msk and op. Their ranking is usable but their calls are not, so run() refuses them unless you pass force=True.

What a classifier calls is set by its training labels, recorded on its model card (label_curation).

  • The breast SBS3 classifiers on msk and tcga_mc3 call strong SBS3 only. They are not intended to call weak SBS3.
  • The colorectal SBS18 classifiers call the summed SBS18 + SBS36 process.

readjust=True re-derives a model's cutoffs for the SNV depth of the cohort you score, as SigMA did.

SigMA v1. model="legacy" runs the original SigMA classifiers (Signature 3 only), for reproducing earlier analyses:

sg2.run(input="...", model="legacy", soi="SBS3", tumor_type="breast", seq_type="msk")

Homologous-recombination deficiency (HRD)

soi="HRD" runs CSI-HRD (Gulhan et al., bioRxiv 10.1101/2025.10.13.681986). It combines three kinds of evidence:

  • SigMA's Signature 3 score, likelihood and exposure;
  • deletions of at least 5 bp with microhomology (mmej) and without (nhej);
  • copy-number instability.

CSI stands for copy number, single-base substitutions and indels. Each tumour gets a pan-cancer score and a tumour-type score. The call combines them:

hrd_call Rule pass_mva pass_mva_strict confidence
HRD both scores > 0.5 True True high
HRD-low one score > 0.5 True False low
HRP (HR-proficient) neither False False negative
MMRD / POLE hypermutated (MMR-deficient or POLE-mutated), set aside first – – –

HRD_mva is the mean of the two scores; hrd_score_pan and hrd_score_type are the parts. The Signature 3 run behind it stays in the output as SBS3_*.

What you pass.

  • Mutations. A VCF or MAF, so SigMA2 can count the deletions. With a matrix input, add mmej and nhej columns, or pass indels=.
  • Copy number, optional but strongly recommended. Pass segments=; SigMA2 picks the model variant from what the file holds:
    • Allele-specific segments (ASCAT, FACETS): the three parts of the genomic instability score (GIS) -- loss-of-heterozygosity regions (HRD-LOH), telomeric allelic imbalance (TAI) and large-scale state transitions (LST). On msk they are read on the IMPACT gene grid, as MSK's gene-level calls are.
    • Log-ratio segments (a panel .seg): fga (fraction of the genome with |log ratio| ≥ 0.2) and lst_lr (large-scale transitions).
    • None: a model without copy number, which is weaker.
  • hrd_loh / tai / lst or fga / lst_lr columns in a matrix input are used as given. A GIS sum alone is not enough for the allele-specific variant; SigMA2 warns and falls back.

What run() refuses, before computing anything:

  • seq_type="auto", or a platform without an HRD model;
  • a tumour type that platform's model never saw;
  • hrd=False, mva=False and readjust=True, which do not apply to HRD.

Platforms and tumour types. HRD models exist for msk, tcga_mc3, seqcap, fo and op. describe() lists which tumour types have their own model and which share the pooled one.

How it performs. Real MSK-IMPACT 50K panels, biallelic BRCA1/2 truth, scored out of fold; AUC:

Tumours (biallelic) SigMA SBS3 Best single input CSI-HRD
All 12 types (288) 0.58 0.87 0.90
Breast (72) 0.63 0.87 0.88
Ovary (85) 0.60 0.82 0.83
Prostate (76) 0.57 0.78 0.81

On TCGA exomes, out of fold, CSI-HRD reaches 0.95, against 0.82 for SigMA's Sig3 score.

There is no public real-panel truth for seqcap, fo and op. Their models are trained and tested on TCGA exomes reduced to each footprint and reach 0.95–0.96. Weak tumour-type models show in describe() with their cross-validated AUC. For example, colorectal on msk has an AUC of 0.48: only 5 biallelic tumours.

hrd=True adds the HRD columns to a run for another soi.

Mismatch-repair deficiency and POLE

mmrd = sg2.predict_mmrd_ppd(input="cohort.maf", ref_genome="hg19", tumor_type="uterus",
                            seq_type="tcga_mc3", soi="SBS3", model="legacy",
                            catalog="cosmic_v2_inhouse", mva=False)

It reads the indel counts SigMA2 takes from a VCF or MAF (sigma2.indel_features):

Count Meaning
nins, ndel all insertions and deletions
nmsi_ins, nmsi_del insertions and deletions in a microsatellite locus
mmej, nhej deletions ≥ 5 bp with and without ≥ 2 bp microhomology

VCF-style (anchor base) and MAF-style (-) records give the same counts. The repeat loci in the data directory are hg19; on hg38 pass beds= in that build.

Train your own

  • Signature classifier: the Add workflow annotates, clusters and simulates your cohort, then tunes a classifier you pass back as model=. See the example notebooks.

    a = sg2.Add(input=mutations, exposures=exposures, tumor_type="breast", seq_type=["msk"], soi=["SBS3"])
    a.annotate(); a.cluster(); a.simulate(); models = a.tune(output_dir="...")
    
  • HRD classifier: for another assay or cohort, build the feature table and give biallelic BRCA1/2 status per tumour. Add does not train HRD; HRD is a classifier, not a signature.

    F = sg2.hrd_features(input="cohort.maf", tumor_type="breast", seq_type="my_assay",
                         segments="segments.tsv", ref_genome="hg19")
    F["brca"] = brca_biallelic                            # bool per sample
    sg2.tune_hrd(F, labels="brca", seq_type="my_assay")   # then run(..., seq_type="my_assay", soi="HRD")
    

From the shell: sigma2 hrd score | features | tune | gis | models.

Reference data

The package ships everything a run needs in the way of models: the data store, the classifiers, and the panel definitions. Bulk reference data (~835 MB) is downloaded on demand instead:

sigma2 data list          # what exists and what is installed
sigma2 data fetch --all   # download everything
sigma2 data verify        # re-check checksums
sigma2 info               # versions, data directory, disk usage

Files land in a per-user data directory; set $SIGMA2_DATA_DIR to override it, which is the usual choice on a cluster where one pre-seeded copy is shared.

Reference genomes are separate and larger (~3 GB each): sigma2 data genome hg19.

Two things are deliberately not distributed, because they are not ours to redistribute: reference genomes, fetched from UCSC by the command above, and gnomAD germline VCFs, which you supply yourself. Obtain the latter from gnomAD and point SigMA2 at your own copy.

Access note. Until the accompanying paper is published, the bulk data lives in a private repository. sigma2 data fetch therefore needs GitHub credentials with access to it — either run gh auth login, or set SIGMA2_GITHUB_TOKEN. Without access the fetch fails with a 404; the code itself is fully functional, and any data you already hold can be used by pointing $SIGMA2_DATA_DIR at it. Please contact the authors (below) to request access.

Example notebooks

Work through the example notebooks in numerical order to get started with SigMA2 and its built-in functions.

They are not included in the installed package; clone the repository to run them locally:

git clone https://github.com/sigscape/SigMA2.git
jupyter notebook SigMA2/examples

Documentation & Further Information

Find more here

Contact

Requests for use of the Software for or on behalf of for-profit entities or for any commercial purposes, please contact:

Office of Technology Development Harvard University Smith Campus Center, Suite 727E 1350 Massachusetts Avenue Cambridge, MA 02138 USA Telephone: (617) 495-3067 E-mail: otd@harvard.edu

Citation

Citation pending. The manuscript describing SigMA2 is in preparation; this section will be updated with the reference once the preprint is available.

If you use SigMA2 in your work in the meantime, please contact the authors for the citation to use.


Copyright (c) 2019-2026 - President and Fellows of Harvard College. All rights reserved.

Metadata

Release files for sigma2 0.0.16a15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sigma2 0.0.16a15
File Size Uploaded Provenance Actions
sigma2-0.0.16a15.tar.gz 37.4 MB With provenance Details for sigma2-0.0.16a15.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for sigma2 0.0.16a15
File Actions
sigma2-0.0.16a15-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for sigma2-0.0.16a15-cp39-abi3-win_amd64.whl
sigma2-0.0.16a15-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for sigma2-0.0.16a15-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
sigma2-0.0.16a15-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for sigma2-0.0.16a15-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
sigma2-0.0.16a15-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for sigma2-0.0.16a15-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 186.6 MB

Release files / sigma2-0.0.16a15.tar.gz

Download URL sigma2-0.0.16a15.tar.gz
Size 37.4 MB
Tags Source
SHA-256 checksum
How to use checksums
0e9f9e45fedaca1f6ca345d31442fb2b6d5da20f17d986f8b87b05c3f5995468
BLAKE2b-256 checksum
How to use checksums
0c13bbe0afb880d828d1e2b17c3e3a28980931e160ab58f701c3f02958587559
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / sigma2-0.0.16a15-cp39-abi3-win_amd64.whl

Download URL sigma2-0.0.16a15-cp39-abi3-win_amd64.whl
Size 37.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
8a001009044e660160413ef282ff2edb3e36e1e63512c3924c0637a50251ecfb
BLAKE2b-256 checksum
How to use checksums
63ae6cd78662e45293a7af6cbc5ec8e4440e69f7ead4749dbab790ecf08667b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / sigma2-0.0.16a15-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL sigma2-0.0.16a15-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 37.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
afb65464641977d9c8b3b392fdc25b0a5e3e7e026efafef6689ca2e3696bbcd5
BLAKE2b-256 checksum
How to use checksums
e7e7ea2b0f6f2e13f15fe082da27b4427ead4ee96bb049f160b9a963a79d984e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / sigma2-0.0.16a15-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL sigma2-0.0.16a15-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 37.3 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
886991f512ce7d871f0dfd65d10d720fe1af9df647de8b4d35ec5358c4d4249c
BLAKE2b-256 checksum
How to use checksums
0ecd89ce3bbab749d3e5f0a96aadfd92f6b5a4b687cc01dfbfcd0074db8eef09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Release files / sigma2-0.0.16a15-cp39-abi3-macosx_11_0_arm64.whl

Download URL sigma2-0.0.16a15-cp39-abi3-macosx_11_0_arm64.whl
Size 37.3 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f496e807c3106d71c4fa9bc2a255298e613ff1bac3726f9f1b5b66069ea02bc7
BLAKE2b-256 checksum
How to use checksums
317aaee79322ab2af61d429b1b9d274b477d907b2494b1a60841f75429e47da0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

Security for sigma2 0.0.16a15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for sigma2-0.0.16a15.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page