MSISENSOR MSI

https://img.shields.io/github/issues-pr/snakemake/snakemake-wrappers/bio/msisensor/msi?label=version%20update%20pull%20requests

Score your MSI with MSIsensor

Example

This wrapper can be used in the following way:

rule test_msisensor_msi:
    input:
        normal = "example.normal.bam",
        tumor = "example.tumor.bam",
        microsat = "example.microsate.sites"
    output:
        "example.msi",
        "example.msi_dis",
        "example.msi_germline",
        "example.msi_somatic"
    message:
        "Testing MSIsensor msi"
    threads:
        1
    log:
        "example.log"
    params:
        out_prefix = "example.msi"
    wrapper:
        "v3.8.0-1-g149ef14/bio/msisensor/msi"

Note that input, output and log file paths can be chosen freely.

When running with

snakemake --use-conda

the software dependencies will be automatically deployed into an isolated environment before execution.

Software dependencies

  • msisensor=0.5

Input/Output

Input:

  • A microsatellite and homopolymer list from MSIsensor Scan

  • A pair of normal/tumoral bams

Output:

  • A text file containing MSI scores

  • A TSV formatted file containing read count distribution

  • A TSV formatted file containing somatic sites

  • A TSV formatted file containing germline sites

Authors

Code

"""Snakemake script for MSISensor msi"""

__author__ = "Thibault Dayris"
__copyright__ = "Copyright 2020, Dayris Thibault"
__email__ = "thibault.dayris@gustaveroussy.fr"
__license__ = "MIT"

from os.path import commonprefix
from snakemake.shell import shell

log = snakemake.log_fmt_shell(stdout=True, stderr=True)

# Extra parameters default value is an empty string
extra = snakemake.params.get("extra", "")

# Detemining common prefix in output files
# to fill the requested parameter '-o'
prefix = commonprefix(snakemake.output)

shell(
    "msisensor msi"  # Tool and its sub-command
    " -d {snakemake.input.microsat}"  # Path to homopolymer/microsat file
    " -n {snakemake.input.normal}"  # Path to normal bam
    " -t {snakemake.input.tumor}"  # Path to tumor bam
    " -o {prefix}"  # Path to output distribution file
    " -b {snakemake.threads}"  # Maximum number of threads used
    " {extra}"  # Optional extra parameters
    " {log}"  # Logging behavior
)