Mercurial > repos > scottx611x > qualimap2_bamqc
comparison qualimap_bamqc.py @ 1:716e406ce6ea draft
planemo upload for repository https://github.com/scottx611x/qualimap2 commit 2e9620ea29d3a146e8669ec0037932d9a2135c79-dirty
author | scottx611x |
---|---|
date | Wed, 25 Jul 2018 10:59:11 -0400 |
parents | |
children | 5b36882f6455 |
comparison
equal
deleted
inserted
replaced
0:d00bc4d82e90 | 1:716e406ce6ea |
---|---|
1 #!/usr/bin/env python | |
2 from __future__ import print_function | |
3 import argparse | |
4 from subprocess import check_call, CalledProcessError | |
5 import sys | |
6 import logging | |
7 | |
8 log = logging.getLogger(__name__) | |
9 | |
10 | |
11 def qualimap_bamqc(bam_filename, genomecov_file, out_dir, jv_mem_size): | |
12 qualimap_command = [ | |
13 "qualimap", "bamqc", | |
14 "-bam " + bam_filename, | |
15 "-oc " + genomecov_file, | |
16 "-outdir " + out_dir, | |
17 "--java-mem-size=" + jv_mem_size | |
18 ] | |
19 | |
20 try: | |
21 check_call(qualimap_command) | |
22 except CalledProcessError: | |
23 print("Error running the qualimap bamqc", file=sys.stderr) | |
24 | |
25 | |
26 def main(): | |
27 parser = argparse.ArgumentParser( | |
28 description="Generate Bam Quality Statistics" | |
29 ) | |
30 parser.add_argument('--input_file') | |
31 parser.add_argument('--out_genome_file', default="genome_results.txt") | |
32 parser.add_argument('--out_dir') | |
33 parser.add_argument('--java_mem_size', default="8G") | |
34 | |
35 args = parser.parse_args() | |
36 | |
37 qualimap_bamqc( | |
38 args.input_file, | |
39 args.out_genome_file, | |
40 args.out_dir, | |
41 args.java_mem_size | |
42 ) | |
43 | |
44 | |
45 if __name__ == "__main__": | |
46 main() |