本文整理汇总了Python中shared._make_tmp_dir函数的典型用法代码示例。如果您正苦于以下问题:Python _make_tmp_dir函数的具体用法?Python _make_tmp_dir怎么用?Python _make_tmp_dir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_make_tmp_dir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: install_novoalign
def install_novoalign(env):
base_version = "V2.07.09"
cs_version = "V1.01.09"
_url = "http://www.novocraft.com/downloads/%s/" % base_version
ref_url = "http://www.novocraft.com/main/downloadpage.php"
base_url = "%s/novocraft%s.gcc.tar.gz" % (_url, base_version)
cs_url = "%s/novoalignCS%s.gcc.tar.gz" % (_url, cs_version)
install_dir = os.path.join(env.system_install, "bin")
with _make_tmp_dir() as work_dir:
with cd(work_dir):
_wget_with_cookies(ref_url, base_url)
run("tar -xzvpf novocraft%s.gcc.tar.gz" % base_version)
with cd("novocraft"):
for fname in ["isnovoindex", "novo2maq", "novo2paf",
"novo2sam.pl", "novoalign", "novobarcode",
"novoindex", "novope2bed.pl", "novorun.pl",
"novoutil"]:
env.safe_sudo("mv %s %s" % (fname, install_dir))
with _make_tmp_dir() as work_dir:
with cd(work_dir):
_wget_with_cookies(ref_url, cs_url)
run("tar -xzvpf novoalignCS%s.gcc.tar.gz" % cs_version)
with cd("novoalignCS"):
for fname in ["novoalignCS"]:
env.safe_sudo("mv %s %s" % (fname, install_dir))
示例2: install_novoalign
def install_novoalign(env):
"""Novoalign short read aligner using Needleman-Wunsch algorithm with affine gap penalties.
http://www.novocraft.com/main/index.php
"""
base_version = "V3.00.02"
cs_version = "V1.03.02"
_url = "http://www.novocraft.com/downloads/%s/" % base_version
ref_url = "http://www.novocraft.com/main/downloadpage.php"
base_url = "%s/novocraft%s.gcc.tar.gz" % (_url, base_version)
cs_url = "%s/novoalignCS%s.gcc.tar.gz" % (_url, cs_version)
install_dir = shared._get_bin_dir(env)
with _make_tmp_dir() as work_dir:
with cd(work_dir):
_wget_with_cookies(ref_url, base_url)
env.safe_run("tar -xzvpf novocraft%s.gcc.tar.gz" % base_version)
with cd("novocraft"):
for fname in ["isnovoindex", "novo2maq", "novo2paf",
"novo2sam.pl", "novoalign", "novobarcode",
"novoindex", "novope2bed.pl", "novorun.pl",
"novoutil"]:
env.safe_sudo("mv %s %s" % (fname, install_dir))
with _make_tmp_dir() as work_dir:
with cd(work_dir):
_wget_with_cookies(ref_url, cs_url)
env.safe_run("tar -xzvpf novoalignCS%s.gcc.tar.gz" % cs_version)
with cd("novoalignCS"):
for fname in ["novoalignCS"]:
env.safe_sudo("mv %s %s" % (fname, install_dir))
示例3: install_pydoop
def install_pydoop(env):
"""Install pydoop; provides Hadoop access for Python.
http://pydoop.sourceforge.net/docs/installation.html
"""
hadoop_version = "0.20.2"
pydoop_version = "0.3.7_rc1"
ubuntu_hadoop_src = "/usr/src/hadoop-0.20"
hadoop_url = "http://apache.mirrors.hoobly.com/hadoop/core/" \
"hadoop-%s/hadoop-%s.tar.gz" % (hadoop_version, hadoop_version)
pydoop_url ="http://downloads.sourceforge.net/project/pydoop/" \
"Pydoop-%s/pydoop-%s.tar.gz" % (pydoop_version, pydoop_version)
java_home = env.java_home if env.has_key("java_home") else os.environ["JAVA_HOME"]
pyext = env.python_version_ext if env.has_key("python_version_ext") else ""
with _make_tmp_dir() as work_dir:
with cd(work_dir):
pydoop_dir = _fetch_and_unpack(pydoop_url)
# Use native supplied Hadoop source to match installed defaults. On
# Ubuntu this is currently 0.20.2.
if exists(ubuntu_hadoop_src):
hadoop_dir = ubuntu_hadoop_src
with cd(pydoop_dir):
sed("setup.py", "src/c", "c")
else:
hadoop_dir = _fetch_and_unpack(hadoop_url)
with cd(pydoop_dir):
export_str = "export HADOOP_VERSION=%s && export HADOOP_HOME=%s " \
"&& export JAVA_HOME=%s" % (hadoop_version,
os.path.join(os.pardir, hadoop_dir), java_home)
run("%s && python%s setup.py build" % (export_str, pyext))
sudo("%s && python%s setup.py install --skip-build" %
(export_str, pyext))
示例4: install_snpeff
def install_snpeff(env):
version = "1_9_5"
genomes = ["hg37.61", "mm37.61"]
url = "http://downloads.sourceforge.net/project/snpeff/" \
"snpEff_v%s_core.zip" % version
genome_url_base = "http://downloads.sourceforge.net/project/snpeff/"\
"databases/v%s/snpEff_v%s_%s.zip"
install_dir = _symlinked_java_version_dir("snpeff", version, env)
if install_dir:
with _make_tmp_dir() as work_dir:
with cd(work_dir):
dir_name = _fetch_and_unpack(url)
with cd(dir_name):
env.safe_sudo("mv *.jar %s" % install_dir)
run("sed -i.bak -r -e 's/data_dir = \.\/data\//data_dir = %s\/data/' %s" %
(install_dir.replace("/", "\/"), "snpEff.config"))
run("chmod a+r *.config")
env.safe_sudo("mv *.config %s" % install_dir)
data_dir = os.path.join(install_dir, "data")
env.safe_sudo("mkdir %s" % data_dir)
for org in genomes:
if not exists(os.path.join(data_dir, org)):
gurl = genome_url_base % (version, version, org)
_fetch_and_unpack(gurl, need_dir=False)
env.safe_sudo("mv data/%s %s" % (org, data_dir))
示例5: install_snpeff
def install_snpeff(env):
"""Variant annotation and effect prediction tool.
http://snpeff.sourceforge.net/
"""
version = "3_3"
genomes = ["GRCh37.71", "hg19", "GRCm38.71"]
#genomes_notinstalled = ["NCBIM37.66","athalianaTair10"]
url = "http://downloads.sourceforge.net/project/snpeff/" \
"snpEff_v%s_core.zip" % version
genome_url_base = "http://downloads.sourceforge.net/project/snpeff/"\
"databases/v%s/snpEff_v%s_%s.zip"
install_dir = _symlinked_java_version_dir("snpeff", version, env)
if install_dir:
with _make_tmp_dir() as work_dir:
with cd(work_dir):
dir_name = _fetch_and_unpack(url)
with cd(dir_name):
env.safe_sudo("mv *.jar %s" % install_dir)
env.safe_run("sed -i.bak -r -e 's/^data_dir.*=.*/data_dir = %s\/data/' %s" %
(install_dir.replace("/", "\/"), "snpEff.config"))
env.safe_run("chmod a+r *.config")
env.safe_sudo("mv *.config %s" % install_dir)
data_dir = os.path.join(install_dir, "data")
env.safe_sudo("mkdir %s" % data_dir)
for org in genomes:
if not env.safe_exists(os.path.join(data_dir, org)):
gurl = genome_url_base % (version, version, org)
_fetch_and_unpack(gurl, need_dir=False)
env.safe_sudo("mv data/%s %s" % (org, data_dir))
示例6: install_gatk_protected
def install_gatk_protected(env):
"""Installation script for recent versions of GATK. Requires manual download from user.
http://www.broadinstitute.org/gatk/
"""
min_version = "2.7-2"
version = "%s-g6bda569" % min_version
if shared._symlinked_dir_exists("gatk", version, env, "java"):
return
dl_fname = "GenomeAnalysisTK-%s.tar.bz2" % min_version
print "**** Manual intervention needed"
print "Recent GATK versions require manual download from the GATK website"
print "Please retrieve the latest versions from:"
print "http://www.broadinstitute.org/gatk/download"
print "and place %s in your home directory" % dl_fname
userin = raw_input("**** Press <enter> when complete or type 'skip' to avoid the installation: ")
if userin.find("skip") >= 0:
return
with _make_tmp_dir() as work_dir:
work_fname = os.path.join(work_dir, dl_fname)
def manual_gatk_download(env):
try:
fname = env.safe_run_output("ls $HOME/%s" % dl_fname)
except:
raise IOError("Could not find %s in your home directory. Please download and retry" % dl_fname)
env.safe_put(fname, work_fname)
return work_fname
_java_install("gatk", version, work_fname, env, pre_fetch_fn=manual_gatk_download)
示例7: install_anaconda
def install_anaconda(env):
"""Pre-packaged Anaconda Python installed from Continuum.
http://docs.continuum.io/anaconda/index.html
"""
version = "2.0.0"
outdir = os.path.join(env.system_install, "anaconda")
if env.distribution in ["ubuntu", "centos", "scientificlinux", "debian", "arch", "suse"]:
platform = "Linux"
elif env.distribution in ["macosx"]:
platform = "MacOSX"
else:
raise ValueError("Unexpected distribution: %s" % env.distribution)
url = "http://09c8d0b2229f813c1b93-c95ac804525aac4b6dba79b00b39d1d3.r79.cf1.rackcdn.com/" \
"Anaconda-%s-%s-x86_64.sh" % (version, platform)
if not env.safe_exists(outdir):
with _make_tmp_dir() as work_dir:
with cd(work_dir):
installer = shared._remote_fetch(env, url)
env.safe_sed(os.path.basename(url), "more <<EOF", "cat <<EOF")
env.safe_sudo("echo -e '\nyes\n%s\nyes\n' | bash %s" % (outdir, installer))
env.safe_sudo("chown -R %s %s" % (env.user, outdir))
comment_line = "# added by Ananconda %s installer" % version
if not env.safe_contains(env.shell_config, comment_line):
env.safe_append(env.shell_config, comment_line)
env.safe_append(env.shell_config, "export PATH=%s/bin:$PATH" % outdir)
# remove curl library with broken certificates
env.safe_run("%s/bin/conda remove --yes curl" % outdir)
env.safe_run("%s/bin/conda install --yes pip" % outdir)
示例8: _unzip_install
def _unzip_install(pname, version, url, env, install_fn, dir_name="."):
install_dir = _symlinked_java_version_dir(pname, version, env)
if install_dir:
with _make_tmp_dir() as work_dir:
with cd(work_dir):
_fetch_and_unpack(url, need_dir=False)
with cd(dir_name):
install_fn(env, install_dir)
示例9: install_solexaqa
def install_solexaqa(env):
version = "1.4"
url = "http://downloads.sourceforge.net/project/solexaqa/src/" "SolexaQA_v.%s.pl.zip" % version
with _make_tmp_dir() as work_dir:
with cd(work_dir):
run("wget %s" % url)
run("unzip %s" % os.path.basename(url))
env.safe_sudo("mv SolexaQA.pl %s" % os.path.join(env.system_install, "bin"))
示例10: _download_executables
def _download_executables(env, base_url, tools):
install_dir = shared._get_bin_dir(env)
with _make_tmp_dir() as work_dir:
with cd(work_dir):
for tool in tools:
final_tool = os.path.join(install_dir, tool)
if not env.safe_exists(final_tool) and shared._executable_not_on_path(tool):
shared._remote_fetch(env, "%s%s" % (base_url, tool))
env.safe_sudo("cp -f %s %s" % (tool, install_dir))
示例11: _install_tar_ball
def _install_tar_ball(env, url, tool):
install_dir = shared._get_bin_dir(env)
install_dir_parent = os.path.abspath(os.path.join(install_dir, os.pardir))
with _make_tmp_dir() as work_dir:
with cd(work_dir):
_remote_fetch(env, url + tool + ".tar.gz")
env.safe_sudo("tar -xzvpf %s.tar.gz -C %s" % (tool, install_dir_parent))
env.safe_sudo("chown -R %s:%s '%s'" % (env.user, env.user, install_dir))
env.safe_sudo("chgrp -R %s '%s'" % (env.user, install_dir))
示例12: install_leinengin
def install_leinengin(env):
"""Standard clojure build tool: http://github.com/technomancy/leiningen
"""
with _make_tmp_dir() as work_dir:
with cd(work_dir):
run("wget --no-check-certificate https://github.com/technomancy/leiningen/raw/stable/bin/lein")
run("chmod a+rwx lein")
env.safe_sudo("mv lein %s" % os.path.join(env.system_install, "bin"))
run("lein self-install")
示例13: install_bx_python
def install_bx_python(env):
"""Install bx-python
"""
clone_url = "http://bitbucket.org/james_taylor/bx-python"
with _make_tmp_dir() as work_dir:
with cd(work_dir):
run("hg clone %s" % clone_url)
with cd(os.path.split(clone_url)[-1]):
run("python setup.py build")
sudo("python setup.py install --skip-build")
示例14: install_leinengin
def install_leinengin(env):
"""Clojure tool for project configuration and automation.
http://github.com/technomancy/leiningen
"""
with _make_tmp_dir() as work_dir:
with cd(work_dir):
run("wget --no-check-certificate https://raw.github.com/technomancy/leiningen/preview/bin/lein")
run("chmod a+rwx lein")
env.safe_sudo("mv lein %s" % os.path.join(env.system_install, "bin"))
run("lein self-install")
示例15: install_mutect
def install_mutect(env):
version = "1.1.5"
url = "https://github.com/broadinstitute/mutect/releases/download/" \
"%s/muTect-%s-bin.zip" % (version, version)
install_dir = _symlinked_java_version_dir("mutect", version, env)
if install_dir:
with _make_tmp_dir() as work_dir:
with cd(work_dir):
out_file = shared._remote_fetch(env, url)
env.safe_run("unzip %s" % out_file)
env.safe_sudo("mv *.jar version.txt LICENSE* %s" % install_dir)