Mercurial > repos > scottx611x > qualimap2_bamqc
comparison qualimap_bamqc.py @ 42:c53375e61b33 draft
planemo upload for repository https://github.com/scottx611x/qualimap2 commit 9fafbbc012490e70d06fcef4704a1e4a45b382c5-dirty
author | scottx611x |
---|---|
date | Sun, 29 Jul 2018 13:53:35 -0400 |
parents | e856fda6f375 |
children | 2395818cb1f1 |
comparison
equal
deleted
inserted
replaced
41:e856fda6f375 | 42:c53375e61b33 |
---|---|
5 from subprocess import check_call, CalledProcessError | 5 from subprocess import check_call, CalledProcessError |
6 import shutil | 6 import shutil |
7 import sys | 7 import sys |
8 | 8 |
9 | 9 |
10 def qualimap_bamqc(bam_filename, genomecov_file, out_dir, jv_mem_size): | 10 def qualimap_bamqc(bam_filename, out_dir, jv_mem_size): |
11 qualimap_command = [ | 11 qualimap_command = [ |
12 "qualimap", "bamqc", | 12 "qualimap", "bamqc", |
13 "-bam " + bam_filename, | 13 "-bam " + bam_filename, |
14 "-oc " + genomecov_file, | |
15 "-outdir " + out_dir, | 14 "-outdir " + out_dir, |
16 "--java-mem-size=" + jv_mem_size | 15 "--java-mem-size=" + jv_mem_size |
17 ] | 16 ] |
18 | 17 |
19 try: | 18 try: |
25 def main(): | 24 def main(): |
26 parser = argparse.ArgumentParser( | 25 parser = argparse.ArgumentParser( |
27 description="Generate Bam Quality Statistics" | 26 description="Generate Bam Quality Statistics" |
28 ) | 27 ) |
29 parser.add_argument('--input_file') | 28 parser.add_argument('--input_file') |
30 parser.add_argument('--out_genome_file') | |
31 parser.add_argument('--out_dir') | 29 parser.add_argument('--out_dir') |
32 parser.add_argument('--out_zip') | 30 parser.add_argument('--out_zip') |
33 parser.add_argument('--out_html') | 31 parser.add_argument('--out_html') |
34 parser.add_argument('--out_results') | |
35 parser.add_argument('--java_mem_size') | 32 parser.add_argument('--java_mem_size') |
36 | 33 |
37 args = parser.parse_args() | 34 args = parser.parse_args() |
38 print(args) | 35 print(args) |
39 | 36 |
40 qualimap_bamqc( | 37 qualimap_bamqc( |
41 args.input_file, | 38 args.input_file, |
42 args.out_genome_file, | |
43 args.out_dir, | 39 args.out_dir, |
44 args.java_mem_size | 40 args.java_mem_size |
45 ) | 41 ) |
46 | 42 |
47 shutil.make_archive( | 43 shutil.make_archive( |
48 'raw_data_qualimapReport', | 44 'raw_data_qualimapReport', |
49 'zip', | 45 'zip', |
50 os.path.join(args.out_dir,'raw_data_qualimapReport') | 46 os.path.join(args.out_dir, 'raw_data_qualimapReport') |
51 ) | 47 ) |
52 | 48 |
53 shutil.move("raw_data_qualimapReport.zip", args.out_zip) | 49 shutil.move("raw_data_qualimapReport.zip", args.out_zip) |
54 shutil.move( | 50 shutil.move( |
55 os.path.join(args.out_dir, "genome_results.txt"), | 51 os.path.join(args.out_dir, "genome_results.txt"), |
56 args.out_results | 52 args.out_results |
57 ) | 53 ) |
58 shutil.move( | |
59 os.path.join(args.out_dir, "qualimapReport.html"), | |
60 args.out_html | |
61 ) | |
62 | 54 |
63 if __name__ == "__main__": | 55 if __name__ == "__main__": |
64 main() | 56 main() |