Mercurial > repos > sanbi-uwc > qualimap2
comparison qualimap_multi_bamqc.py @ 6:8dff744880cd draft
planemo upload for repository https://github.com/zipho/qualimap2 commit c721c32bc9c559c94c2f8cb9c77aa0c60a9fceb6
author | sanbi-uwc |
---|---|
date | Tue, 05 Apr 2016 04:45:41 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
5:465131fb4ce9 | 6:8dff744880cd |
---|---|
1 #!/usr/bin/env python | |
2 from __future__ import print_function | |
3 import argparse | |
4 from subprocess import check_call, CalledProcessError | |
5 import shlex | |
6 import sys | |
7 import logging | |
8 | |
9 log = logging.getLogger(__name__) | |
10 | |
11 | |
12 def qualimap_multi_bamqc(input_file, out_dir, jv_mem_size): | |
13 #multi-bamqc -r -d ./bamlistinput.txt -outdir ./Kaust_kxdr/variants/qualimap -outformat PDF --java-mem-size=16G | |
14 cmdline_str = "qualimap multi-bamqc -r -d {} -outdir {} -outformat PDF --java-mem-size={}".format(input_file, | |
15 out_dir, | |
16 jv_mem_size) | |
17 cmdline = new_split(cmdline_str) | |
18 try: | |
19 check_call(cmdline) | |
20 except CalledProcessError: | |
21 print("Error running the qualimap multi bamqc", file=sys.stderr) | |
22 | |
23 | |
24 def new_split(value): | |
25 lex = shlex.shlex(value) | |
26 lex.quotes = '"' | |
27 lex.whitespace_split = True | |
28 lex.commenters = '' | |
29 return list(lex) | |
30 | |
31 | |
32 def main(): | |
33 parser = argparse.ArgumentParser(description="Generate Bam Quality Statistics") | |
34 parser.add_argument('--input_file') | |
35 parser.add_argument('--out_dir', default="/tmp/bamstats") | |
36 parser.add_argument('--java_mem_size', default="8G") | |
37 | |
38 args = parser.parse_args() | |
39 | |
40 qualimap_multi_bamqc(args.input_file, args.out_dir, args.java_mem_size) | |
41 | |
42 | |
43 if __name__ == "__main__": main() |