Previous changeset 5:216bf640baaf (2012-05-09) Next changeset 7:4d3f94dfb857 (2013-02-14) |
Commit message:
MIRA wrapper v0.0.5 with <version_command> support and check for MIRA V3.4 |
modified:
tools/sr_assembly/mira.py tools/sr_assembly/mira.txt tools/sr_assembly/mira.xml |
b |
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) |
b |
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 |
b |
@@ -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 <version_command> tag to record the wrapper + version and the MIRA version being used. + - Check using MIRA 3.4 (later versions have a different API) Developers |
b |
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 |
b |
@@ -1,5 +1,6 @@ -<tool id="mira_assembler" name="Assemble with MIRA" version="0.0.4"> +<tool id="mira_assembler" name="Assemble with MIRA" version="0.0.5"> <description>Takes Sanger, Roche, Illumina, and Ion Torrent data</description> + <version_command interpreter="python">mira.py -v</version_command> <command interpreter="python">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 |