bwa-mem2 bwa-mem2 index

bwa-mem2 index

Version:
2.0
Identifier: TL_ad909e_6a.d1
Tool
1__author__ = "Christopher Schröder, Patrik Smeds"
2__copyright__ = "Copyright 2020, Christopher Schröder, Patrik Smeds"
3__email__ = "christopher.schroeder@tu-dortmund.de, patrik.smeds@gmail.com"
4__license__ = "MIT"
5
6from os import path
7
8from snakemake.shell import shell
9
10log = snakemake.log_fmt_shell(stdout=False, stderr=True)
11
12# Check inputs/arguments.
13if len(snakemake.input) == 0:
14    raise ValueError("A reference genome has to be provided.")
15elif len(snakemake.input) > 1:
16    raise ValueError("Please provide exactly one reference genome as input.")
17
18# Prefix that should be used for the database
19prefix = snakemake.params.get("prefix", "")
20
21if len(prefix) > 0:
22    prefix = "-p " + prefix
23
24shell("bwa-mem2 index" " {prefix}" " {snakemake.input[0]}" " {log}")
25