Mercurial > repos > scottx611x > qualimap2_bamqc
comparison qualimap_bamqc.py @ 30:418ee04dd1b2 draft
planemo upload for repository https://github.com/scottx611x/qualimap2 commit dc78b7c4b1780b316ca4aba2be247969ac1100ec-dirty
author | scottx611x |
---|---|
date | Thu, 26 Jul 2018 16:40:19 -0400 |
parents | 71af3fbe85be |
children | a77bae54b1c7 |
comparison
equal
deleted
inserted
replaced
29:71af3fbe85be | 30:418ee04dd1b2 |
---|---|
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 os | |
6 import shutil | 5 import shutil |
7 import sys | 6 import sys |
7 | |
8 OUTPUT_DIR = "qualimap_results" | |
8 | 9 |
9 | 10 |
10 def qualimap_bamqc(bam_filename, genomecov_file, jv_mem_size): | 11 def qualimap_bamqc(bam_filename, genomecov_file, jv_mem_size): |
11 qualimap_command = [ | 12 qualimap_command = [ |
12 "qualimap", "bamqc", | 13 "qualimap", "bamqc", |
13 "-bam " + bam_filename, | 14 "-bam " + bam_filename, |
14 "-oc " + genomecov_file, | 15 "-oc " + genomecov_file, |
15 "-outdir .", | 16 "-outdir " + OUTPUT_DIR, |
16 "--java-mem-size=" + jv_mem_size | 17 "--java-mem-size=" + jv_mem_size |
17 ] | 18 ] |
18 | 19 |
19 try: | 20 try: |
20 check_call(qualimap_command) | 21 check_call(qualimap_command) |
36 args.input_file, | 37 args.input_file, |
37 args.out_genome_file, | 38 args.out_genome_file, |
38 args.java_mem_size | 39 args.java_mem_size |
39 ) | 40 ) |
40 | 41 |
41 print(os.listdir("../")) | 42 shutil.move(OUTPUT_DIR + "/genome_results.txt", "genome_results.txt") |
42 | 43 shutil.move(OUTPUT_DIR + "/qualimapReport.html", "qualimapReport.html") |
43 shutil.make_archive( | 44 shutil.make_archive( |
44 'raw_data_qualimapReport', | 45 'raw_data_qualimapReport', |
45 'zip', | 46 'zip', |
46 os.path.join("../", 'raw_data_qualimapReport') | 47 OUTPUT_DIR + '/raw_data_qualimapReport' |
47 ) | 48 ) |
48 | 49 |
49 | 50 |
50 if __name__ == "__main__": | 51 if __name__ == "__main__": |
51 main() | 52 main() |