SAMTOOLS CALMD
Calculates MD and NM tags.
URL: http://www.htslib.org/doc/samtools-calmd.html
Example
This wrapper can be used in the following way:
rule samtools_calmd:
input:
aln="{sample}.bam", # Can be 'sam', 'bam', or 'cram'
ref="genome.fasta",
output:
"{sample}.calmd.bam",
log:
"{sample}.calmd.log",
params:
extra="-E", # optional params string
threads: 2
wrapper:
"v5.3.0-16-g710597c/bio/samtools/calmd"
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
samtools=1.21
snakemake-wrapper-utils=0.6.2
Input/Output
Input:
SAM/BAM/CRAM file
Output:
SAM/BAM/CRAM file
SAM/BAM/CRAM index file (optional)
Params
extra
: additional program arguments (not -@/–threads, –write-index, -m, -o or -O/–output-fmt).
Code
__author__ = "Filipe G. Vieira"
__copyright__ = "Copyright 2020, Filipe G. Vieira"
__license__ = "MIT"
from snakemake.shell import shell
from snakemake_wrapper_utils.samtools import get_samtools_opts
samtools_opts = get_samtools_opts(
snakemake, parse_write_index=False, parse_output=False
)
extra = snakemake.params.get("extra", "")
log = snakemake.log_fmt_shell(stdout=False, stderr=True)
shell(
"samtools calmd {samtools_opts} {extra} {snakemake.input.aln} {snakemake.input.ref} > {snakemake.output[0]} {log}"
)