# HG changeset patch # User refinery-platform # Date 1532958970 14400 # Node ID a6d048668f7f169c0cc407d3608ef78311cc5568 planemo upload for repository https://github.com/refinery-platform/qualimap2 commit 88b5467f336ac3b6b5d3a6e824273a183e5184b6 diff -r 000000000000 -r a6d048668f7f qualimap_bamqc.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qualimap_bamqc.py Mon Jul 30 09:56:10 2018 -0400 @@ -0,0 +1,53 @@ +#!/usr/bin/env python +from __future__ import print_function +import argparse +import os +from subprocess import check_call, CalledProcessError +import shutil +import sys + +QUALIMAP_OUPUT_DIR = "qualimap_results" + + +def qualimap_bamqc(bam_filename, jv_mem_size): + qualimap_command = [ + "qualimap", "bamqc", + "-bam " + bam_filename, + "-outdir " + QUALIMAP_OUPUT_DIR, + "--java-mem-size=" + jv_mem_size + ] + + try: + check_call(qualimap_command) + except CalledProcessError: + print("Error running the qualimap bamqc", file=sys.stderr) + + +def main(): + parser = argparse.ArgumentParser( + description="Generate Bam Quality Statistics" + ) + parser.add_argument('--input_file') + parser.add_argument('--out_dir') + parser.add_argument('--out_results') + parser.add_argument('--out_zip') + parser.add_argument('--java_mem_size') + + args = parser.parse_args() + + qualimap_bamqc(args.input_file, args.java_mem_size) + + shutil.make_archive( + 'raw_data_qualimapReport', + 'zip', + os.path.join(QUALIMAP_OUPUT_DIR, 'raw_data_qualimapReport') + ) + + shutil.move("raw_data_qualimapReport.zip", args.out_zip) + shutil.move( + os.path.join(QUALIMAP_OUPUT_DIR, "genome_results.txt"), + args.out_results + ) + +if __name__ == "__main__": + main() diff -r 000000000000 -r a6d048668f7f qualimap_bamqc.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qualimap_bamqc.xml Mon Jul 30 09:56:10 2018 -0400 @@ -0,0 +1,48 @@ + + + Tool to to facilitate the quality control of alignment sequencing data and its derivatives like feature counts. + + qualimap + + + + + + + qualimap_bamqc.py + --input_file $input_realigned_bam_file + --out_results $genome_results + --out_zip $raw_data_qualimapReport + --java_mem_size $mem_size + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://github.com/scottx611x/qualimap2 + + + + diff -r 000000000000 -r a6d048668f7f test-data/test.bam Binary file test-data/test.bam has changed diff -r 000000000000 -r a6d048668f7f tool_dependencies.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Mon Jul 30 09:56:10 2018 -0400 @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file