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