MICROPHASER SOMATIC

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

Predict mutated neopeptides and their wildtype counterparts from NGS (whole exome/genome) data

Example

This wrapper can be used in the following way:

rule microphaser_somatic:
    input:
        bam="mapped/{sample}.sorted.bam",
        index="mapped/{sample}.sorted.bam.bai",
        ref="genome.fasta",
        annotation="genome.gtf",
        variants="calls/{sample}.bcf",
    output:
        # sequences neopeptides arisen from somatic variants
        tumor="out/{sample}.mt.fasta",
        # sequences of the normal, unmutated counterpart to every neopeptide
        normal="out/{sample}.wt.fasta",
        # info data of the somatic neopeptides
        tsv="out/{sample}.info.tsv",
    log:
        "logs/microphaser/somatic/{sample}.log",
    params:
        extra="--window-len 9",  # optional, desired peptide length in nucleotide bases, e.g. 27 (9 AA) for MHC-I ligands.
    wrapper:
        "v4.6.0/bio/microphaser/somatic"

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.

Notes

Software dependencies

  • microphaser=0.8.0

Input/Output

Input:

  • bam file

  • bcf file

  • fasta reference

  • gtf annotation file

Output:

  • mutated peptide fasta (nucleotide sequences)

  • wildtype peptide fasta (nucleotide sequences)

  • information tsv

Authors

  • Jan Forster

Code

__author__ = "Jan Forster"
__copyright__ = "Copyright 2021, Jan Forster"
__license__ = "MIT"


from snakemake.shell import shell

extra = snakemake.params.get("extra", "")

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

shell(
    "microphaser somatic {snakemake.input.bam} "
    "{extra} "
    "--ref {snakemake.input.ref} "
    "--variants {snakemake.input.variants} "
    "--normal-output {snakemake.output.normal} "
    "--tsv {snakemake.output.tsv} "
    "> {snakemake.output.tumor} "
    "< {snakemake.input.annotation} "
    "{log}"
)