Mercurial > repos > peterjc > mira4_assembler
comparison tools/mira4_0/mira4_convert.py @ 35:259891fce7fd draft
planemo upload for repository https://github.com/peterjc/galaxy_mira/tree/master/tools/mira4_0 commit e4c56df75150c82d3e9c4ac487c4209108e52412
| author | peterjc |
|---|---|
| date | Wed, 09 Aug 2017 13:32:11 -0400 |
| parents | 0785a6537f3e |
| children | cee8f9005e43 |
comparison
equal
deleted
inserted
replaced
| 34:0785a6537f3e | 35:259891fce7fd |
|---|---|
| 20 from StringIO import StringIO as BytesIO | 20 from StringIO import StringIO as BytesIO |
| 21 | 21 |
| 22 # Do we need any PYTHONPATH magic? | 22 # Do we need any PYTHONPATH magic? |
| 23 from mira4_make_bam import depad | 23 from mira4_make_bam import depad |
| 24 | 24 |
| 25 WRAPPER_VER = "0.0.10" # Keep in sync with the XML file | 25 WRAPPER_VER = "0.0.11" # Keep in sync with the XML file |
| 26 | 26 |
| 27 | 27 |
| 28 def run(cmd): | 28 def run(cmd): |
| 29 # Avoid using shell=True when we call subprocess to ensure if the Python | 29 # Avoid using shell=True when we call subprocess to ensure if the Python |
| 30 # script is killed, so too is the child process. | 30 # script is killed, so too is the child process. |
| 108 out_bam = options.bam | 108 out_bam = options.bam |
| 109 out_fasta = options.fasta | 109 out_fasta = options.fasta |
| 110 out_ace = options.ace | 110 out_ace = options.ace |
| 111 out_cstats = options.cstats | 111 out_cstats = options.cstats |
| 112 | 112 |
| 113 try: | 113 if "MIRA4" in os.environ: |
| 114 mira_path = os.environ["MIRA4"] | 114 mira_path = os.environ["MIRA4"] |
| 115 except KeyError: | 115 mira_convert = os.path.join(mira_path, "miraconvert") |
| 116 sys.exit("Environment variable $MIRA4 not set") | 116 if not os.path.isfile(mira_convert): |
| 117 mira_convert = os.path.join(mira_path, "miraconvert") | 117 sys.exit("Missing miraconvert under $MIRA4, %r\nFolder contained: %s" |
| 118 if not os.path.isfile(mira_convert): | 118 % (mira_convert, ", ".join(os.listdir(mira_path)))) |
| 119 sys.exit("Missing miraconvert under $MIRA4, %r\nFolder contained: %s" | 119 else: |
| 120 % (mira_convert, ", ".join(os.listdir(mira_path)))) | 120 sys.stderr.write("DEBUG: Since $MIRA4 is not set, assuming mira binaries are on $PATH.\n") |
| 121 mira_path = None | |
| 122 mira_convert = "miraconvert" | |
| 121 | 123 |
| 122 mira_convert_ver = get_version(mira_convert) | 124 mira_convert_ver = get_version(mira_convert) |
| 123 if not mira_convert_ver.strip().startswith("4.0"): | 125 if not mira_convert_ver.strip().startswith("4.0"): |
| 124 sys.exit("This wrapper is for MIRA V4.0, not:\n%s\n%s" % (mira_convert_ver, mira_convert)) | 126 sys.exit("This wrapper is for MIRA V4.0, not:\n%s\n%s" % (mira_convert_ver, mira_convert)) |
| 125 if options.version: | 127 if options.version: |
