def java(items): """Check for presence of external Java 1.7 for tools that require it. """ if any([_needs_java(d) for d in items]): min_version = "1.7" max_version = "1.8" with setpath.orig_paths(): java = utils.which("java") if not java: return ( "java not found on PATH. Java %s required for MuTect and GATK < 3.6." % min_version) p = subprocess.Popen([java, "-Xms250m", "-Xmx250m", "-version"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output, _ = p.communicate() p.stdout.close() version = "" for line in output.split("\n"): if line.startswith(("java version", "openjdk version")): version = line.strip().split()[-1] if version.startswith('"'): version = version[1:] if version.endswith('"'): version = version[:-1] if (not version or LooseVersion(version) >= LooseVersion(max_version) or LooseVersion(version) < LooseVersion(min_version)): return ( "java version %s required for running MuTect and GATK < 3.6.\n" "It needs to be first on your PATH so running 'java -version' give the correct version.\n" "Found version %s at %s" % (min_version, version, java))
def java(items): """Check for presence of external Java 1.7 for tools that require it. """ if any([_needs_java(d) for d in items]): min_version = "1.7" max_version = "1.8" with setpath.orig_paths(): java = utils.which("java") if not java: return ("java not found on PATH. Java %s required for MuTect and GATK < 3.6." % min_version) p = subprocess.Popen([java, "-Xms250m", "-Xmx250m", "-version"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output, _ = p.communicate() p.stdout.close() version = "" for line in output.split("\n"): if line.startswith(("java version", "openjdk version")): version = line.strip().split()[-1] if version.startswith('"'): version = version[1:] if version.endswith('"'): version = version[:-1] if (not version or LooseVersion(version) >= LooseVersion(max_version) or LooseVersion(version) < LooseVersion(min_version)): return ("java version %s required for running MuTect and GATK < 3.6.\n" "It needs to be first on your PATH so running 'java -version' give the correct version.\n" "Found version %s at %s" % (min_version, version, java))
def run_mutect(self, params, tmp_dir=None): with setpath.orig_paths(): with tx_tmpdir(self._config) as local_tmp_dir: if tmp_dir is None: tmp_dir = local_tmp_dir cl = self.cl_mutect(params, tmp_dir) prog = "MuTect" do.run(cl, "MuTect: {0}".format(prog), None)