SAMTOOLS VIEW¶
Convert or filter SAM/BAM. For more information see SAMtools documentation.
URL:
Example¶
This wrapper can be used in the following way:
rule samtools_view:
input:
"{sample}.sam"
output:
"{sample}.bam"
log:
"{sample}.log"
params:
extra="" # optional params string
wrapper:
"0.80.1/bio/samtools/view"
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.12
snakemake-wrapper-utils==0.2.0
Notes¶
- The extra param allows for additional program arguments (not -@/–threads or -O/–output-fmt).
- For more information see, http://www.htslib.org/doc/samtools-view.html
Authors¶
- Johannes Köster
- Filipe G. Vieira
Code¶
__author__ = "Johannes Köster"
__copyright__ = "Copyright 2016, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
from snakemake.shell import shell
from snakemake_wrapper_utils.samtools import get_samtools_opts
samtools_opts = get_samtools_opts(snakemake)
log = snakemake.log_fmt_shell(stdout=True, stderr=True, append=True)
shell(
"samtools view {snakemake.params.extra} {samtools_opts} -o {snakemake.output[0]} {snakemake.input[0]} {log}"
)