lofreq lofreq call

lofreq call

Version:
1.6
Identifier: TL_a7703a_53.43
Tool
1__author__ = "Patrik Smeds"
2__copyright__ = "Copyright 2018, Patrik Smeds"
3__email__ = "patrik.smeds@gmail.com"
4__license__ = "MIT"
5
6
7import os
8from snakemake.shell import shell
9
10log = snakemake.log_fmt_shell(stdout=False, stderr=True)
11extra = snakemake.params.get("extra", "")
12ref = snakemake.params.get("ref", None)
13
14if ref is None:
15    raise ValueError("A reference must be provided")
16
17bam_input = snakemake.input.bam
18bai_input = snakemake.input.bai
19
20if bam_input is None:
21    raise ValueError("Missing bam input file!")
22
23if bai_input is None:
24    raise ValueError("Missing bai input file!")
25
26output_file = snakemake.output[0]
27
28if output_file is None:
29    raise ValueError("Missing output file")
30elif not len(snakemake.output) == 1:
31    raise ValueError("Only expecting one output file: " + str(output_file) + "!")
32
33shell(
34    "lofreq call-parallel "
35    " --pp-threads {snakemake.threads}"
36    " -f {ref}"
37    " {bam_input}"
38    " -o {output_file}"
39    " {extra}"
40    " {log}"
41)
42