# HG changeset patch # User peterjc # Date 1359732861 18000 # Node ID 3e7eca1f5d04158263735aca0b6aec935039f454 # Parent 216bf640baaf00502d7bfb56df32d5431e05d839 MIRA wrapper v0.0.5 with support and check for MIRA V3.4 diff -r 216bf640baaf -r 3e7eca1f5d04 tools/sr_assembly/mira.py --- a/tools/sr_assembly/mira.py Wed May 09 12:40:06 2012 -0400 +++ b/tools/sr_assembly/mira.py Fri Feb 01 10:34:21 2013 -0500 @@ -7,10 +7,38 @@ import shutil import time +WRAPPER_VER = "0.0.5" #Keep in sync with the XML file + def stop_err(msg, err=1): sys.stderr.write(msg+"\n") sys.exit(err) + +def get_version(): + """Run MIRA to find its version number""" + # At the commend line I would use: mira -v | head -n 1 + # however there is some pipe error when doing that here. + try: + child = subprocess.Popen(["mira", "-v"], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + except Exception, err: + sys.stderr.write("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err)) + sys.exit(1) + ver, tmp = child.communicate() + del child + return ver.split("\n", 1)[0] + + +mira_ver = get_version() +if "V3.4." not in mira_ver: + stop_err("This wrapper is for MIRA V3.4, not %s" % mira_ver) +if "-v" in sys.argv: + print "MIRA wrapper version %s," % WRAPPER_VER + print mira_ver + sys.exit(0) + + def collect_output(temp, name): n3 = (temp, name, name, name) f = "%s/%s_assembly/%s_d_results" % (temp, name, name) diff -r 216bf640baaf -r 3e7eca1f5d04 tools/sr_assembly/mira.txt --- a/tools/sr_assembly/mira.txt Wed May 09 12:40:06 2012 -0400 +++ b/tools/sr_assembly/mira.txt Fri Feb 01 10:34:21 2013 -0500 @@ -41,6 +41,9 @@ - The contig summary file (TCS file) was removed in MIRA 3.4 - Report all missing output files (not just first missing one) v0.0.4 - Fix problem with backbone arguments inroduced in v0.0.3 +v0.0.5 - Implement the tag to record the wrapper + version and the MIRA version being used. + - Check using MIRA 3.4 (later versions have a different API) Developers diff -r 216bf640baaf -r 3e7eca1f5d04 tools/sr_assembly/mira.xml --- a/tools/sr_assembly/mira.xml Wed May 09 12:40:06 2012 -0400 +++ b/tools/sr_assembly/mira.xml Fri Feb 01 10:34:21 2013 -0500 @@ -1,5 +1,6 @@ - + Takes Sanger, Roche, Illumina, and Ion Torrent data + mira.py -v mira.py mira $out_fasta $out_qual $out_ace $out_caf $out_wig $out_log ##Give the wrapper script list of output filenames, then the mira command... mira --job=$job_method,$job_type,$job_quality