snakemake-workflows/microsatellite-instability-detection-with-msisensor-pro

Best practices snakemake workflow for microsatellite instability (MSI) detection with msisensor-pro.

Overview

Latest release: v1.1.0, Last update: 2026-01-23

Linting: linting: passed, Formatting: formatting: passed

Wrappers: bio/reference/ensembl-sequence bio/samtools/index

Deployment

Step 1: Install Snakemake and Snakedeploy

Snakemake and Snakedeploy are best installed via the Conda. It is recommended to install conda via Miniforge. Run

conda create -c conda-forge -c bioconda -c nodefaults --name snakemake snakemake snakedeploy

to install both Snakemake and Snakedeploy in an isolated environment. For all following commands ensure that this environment is activated via

conda activate snakemake

For other installation methods, refer to the Snakemake and Snakedeploy documentation.

Step 2: Deploy workflow

With Snakemake and Snakedeploy installed, the workflow can be deployed as follows. First, create an appropriate project working directory on your system and enter it:

mkdir -p path/to/project-workdir
cd path/to/project-workdir

In all following steps, we will assume that you are inside of that directory. Then run

snakedeploy deploy-workflow https://github.com/snakemake-workflows/microsatellite-instability-detection-with-msisensor-pro . --tag v1.1.0

Snakedeploy will create two folders, workflow and config. The former contains the deployment of the chosen workflow as a Snakemake module, the latter contains configuration files which will be modified in the next step in order to configure the workflow to your needs.

Step 3: Configure workflow

To configure the workflow, adapt config/config.yml to your needs following the instructions below.

Step 4: Run workflow

The deployment method is controlled using the --software-deployment-method (short --sdm) argument.

To run the workflow using apptainer/singularity, use

snakemake --cores all --sdm apptainer

To run the workflow using a combination of conda and apptainer/singularity for software deployment, use

snakemake --cores all --sdm conda apptainer

To run the workflow with automatic deployment of all required software via conda/mamba, use

snakemake --cores all --sdm conda

Snakemake will automatically detect the main Snakefile in the workflow subfolder and execute the workflow module that has been defined by the deployment in step 2.

For further options such as cluster and cloud execution, see the docs.

Step 5: Generate report

After finalizing your data analysis, you can automatically generate an interactive visual HTML report for inspection of results together with parameters and code inside of the browser using

snakemake --report report.zip

Configuration

The following section is imported from the workflow’s config/README.md.

Workflow overview

This workflow is a best-practice workflow for microsatellite instability (MSI) detection with msisensor-pro, following best practices for standardized workflows. The workflow is built using snakemake and consists of the following steps:

  1. Download genome reference from Ensembl

  2. Run msisensor-pro scan of the reference genome.

  3. (optional) Create a panel of normals with msisensor-pro baseline as background for tumor MSI calling without matched normal samples.

  4. Run msisensor-pro pro for MSI calling.

  5. Collect MSI calling statistics in a single file across all samples.

Workflow setup

Setting up this workflow requires three steps:

  1. Create a sample sheet as described below.

  2. Ensure that input SAM/BAM/CRAM files exist with the given file name pattern.

  3. Go through the config/config.yaml file adjusting all configurations as outlined in the extensive comments. This includes choosing, whether all the normal samples will be pooled into a baseline panel of normals, or whether each normal sample matches a tumor sample (with the same group specified).

Sample sheet

The sample sheet has the following layout and is agnostic of the analysis mode specified in the config.yaml (panel of normals vs. matched normals):

sample

alias

group

sample1

tumor

patient_A

sample2

normal

patient_A

sample3

tumor

patient_B

sample4

normal

patient_B

This follows the same naming scheme that a number of other standardized snakemake workflows for DNA sequencing data also follow, for example the dna-seq-varlociraptor workflow.

Input data

This workflow assumes that you have already mapped / aligned your read data to the reference genome that you specify in the config/config.yaml file, and performed quality score recalibration on them. So it starts from SAM/BAM/CRAM files, and assumes that these follow this file path and naming scheme (where {sample} are entries from the sample column in your sample sheet):

If your input files do not follow this scheme, we suggest that you add a rule that creates symbolic links with the correct {sample}.bam naming scheme in the subfolder results/recal/. This could for example look like this:

rule link_input_data:
    input:
        original="../../path/to/other/workflow/results/mapped_and_recalibrated/{sample}",
    output:
        compliant="results/recal/{sample}.bam",
    log:
        "logs/link_input_data/{sample}.log",
    shell:
        "( ln --symbolic {input.original} {output.compliant} "
        ") >{log} 2>&1 "

Linting and formatting

Linting results

All tests passed!

Formatting results

All tests passed!