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))
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))
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)
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)
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))
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))
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))
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)
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"))
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))
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))
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")
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")
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")
def install_leiningen(env): """Clojure tool for project configuration and automation. http://github.com/technomancy/leiningen """ bin_dir = os.path.join(env.system_install, "bin") with _make_tmp_dir() as work_dir: with cd(work_dir): shared._remote_fetch(env, "https://raw.github.com/technomancy/leiningen/stable/bin/lein") env.safe_run("chmod a+rwx lein") env.safe_sudo("mv lein %s" % bin_dir) env.safe_run("%s/lein" % bin_dir)
def install_proteowizard(env): url = "http://teamcity.labkey.org:8080/repository/download/bt36/77483:id/pwiz-bin-windows-x86-vc100-release-3_0_4360.tar.bz2?guest=1" install_dir = env.get("install_dir") share_dir = "%s/share/proteowizard" % install_dir with _make_tmp_dir() as work_dir: with cd(work_dir): _fetch_and_unpack(url, need_dir=False) env.safe_sudo("cp -r . '%s'" % share_dir) proteowizard_apps = ["msconvert", "msaccess", "chainsaw", "msdiff", "mspicture", "mscat", "txt2mzml", "MSConvertGUI", "Skyline", "Topograph", "SeeMS"] for app in proteowizard_apps: setup_wine_wrapper(env, "%s/%s" % (share_dir, app))
def install_sambamba(env): """Library for working with SAM/BAM formats written in D programming language https://github.com/lomereiter/sambamba/wiki """ version = "0.2.9" url = "https://github.com/downloads/lomereiter/sambamba/" "sambamba-{0}_amd64.deb".format(version) if env.distribution in ["ubuntu", "debian"] and env.is_64bit: with _make_tmp_dir() as work_dir: with cd(work_dir): run("wget {0}".format(url)) env.safe_sudo("sudo dpkg -i {0}".format(os.path.basename(url)))
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): env.safe_run("wget --no-check-certificate %s" % url) env.safe_run("unzip %s" % os.path.basename(url)) env.safe_sudo("mv *.jar version.txt LICENSE* %s" % install_dir)
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)
def install_solexaqa(env): """SolexaQA creates visual representations of data quality from FASTQ files. http://solexaqa.sourceforge.net/ """ 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"))
def install_mutect(env): version = "1.1.4" url = "http://www.broadinstitute.org/cancer/cga/sites/default/files/data/tools/mutect/" \ "muTect-%s-bin.zip" % version install_dir = _symlinked_java_version_dir("mutect", version, env) if install_dir: with _make_tmp_dir() as work_dir: with cd(work_dir): env.safe_run("wget --no-check-certificate %s" % url) env.safe_run("unzip %s" % os.path.basename(url)) env.safe_sudo("mv *.jar version.txt LICENSE* %s" % install_dir)
def install_morpheus(env): url = "http://www.chem.wisc.edu/~coon/Downloads/Morpheus/latest/Morpheus.zip" # TODO: install_dir = env.get("install_dir") share_dir = "%s/share/morpheus" % install_dir with _make_tmp_dir() as work_dir: with cd(work_dir): _fetch_and_unpack(url, need_dir=False) env.safe_sudo("cp -r Morpheus '%s'" % share_dir) morpheus_exes = ["morpheus_cl.exe", "Morpheus.exe"] for app in morpheus_exes: setup_wine_wrapper(env, "%s/%s" % (share_dir, app))
def install_pysam(env): """Install pysam for Python access to BAM files. """ version = "0.3" url = "http://pysam.googlecode.com/files/pysam-%s.tar.gz" % version with _make_tmp_dir() as work_dir: with cd(work_dir): run("wget %s" % url) run("tar -xzvpf %s" % os.path.split(url)[-1]) with cd("pysam-%s" % version): run("python setup.py build") sudo("python setup.py install --skip-build")
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%s setup.py build" % env.python_version_ext) sudo("python%s setup.py install --skip-build" % env.python_version_ext) sudo("rm -rf dist") sudo("rm -rf lib/bx_python.egg-info")
def install_picard(env): version = "1.49" url = "http://downloads.sourceforge.net/project/picard/" \ "picard-tools/%s/picard-tools-%s.zip" % (version, version) install_dir = _symlinked_java_version_dir("picard", version, env) if install_dir: with _make_tmp_dir() as work_dir: with cd(work_dir): run("wget %s" % (url)) run("unzip %s" % os.path.basename(url)) with cd(os.path.splitext(os.path.basename(url))[0]): env.safe_sudo("mv *.jar %s" % install_dir)
def install_varscan(env): """Variant detection in massively parallel sequencing data http://varscan.sourceforge.net/ """ version = "2.3.6" url = "http://downloads.sourceforge.net/project/varscan/VarScan.v%s.jar" % version install_dir = _symlinked_java_version_dir("varscan", 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_sudo("mv %s %s" % (out_file, install_dir))
def install_bcbio_variation(env): """Toolkit to analyze genomic variation data with comparison and ensemble approaches. https://github.com/chapmanb/bcbio.variation """ version = "0.0.6" url = "https://s3.amazonaws.com/bcbio.variation/" "bcbio.variation-%s-standalone.jar" % version install_dir = _symlinked_java_version_dir("bcbio_variation", version, env) if install_dir: with _make_tmp_dir() as work_dir: with cd(work_dir): run("wget %s" % url) env.safe_sudo("mv *.jar %s" % install_dir)
def install_ms2preproc(env): default_version = "2009" version = env.get("tool_version", default_version) get_cmd = 'wget --post-data "Anonym=1&GotoDownload=1&ref=http://hci.iwr.uni-heidelberg.de/MIP/Software/ms2preproc.php" http://hci.iwr.uni-heidelberg.de/php-tools/download.php -O ms2preproc.zip' install_dir = _get_bin_dir(env) with _make_tmp_dir() as work_dir: with cd(work_dir): run(get_cmd) run("unzip ms2preproc.zip") run("chmod +x ms2preproc-x86_64") env.safe_sudo("mv ms2preproc-x86_64 '%s'/ms2preproc" % install_dir)
def install_sambamba(env): """Library for working with SAM/BAM formats written in D programming language https://github.com/lomereiter/sambamba/wiki """ version = "0.2.9" url = "https://github.com/downloads/lomereiter/sambamba/" \ "sambamba-{0}_amd64.deb".format(version) if env.distribution in ["ubuntu", "debian"] and env.is_64bit: with _make_tmp_dir() as work_dir: with cd(work_dir): dl_file = shared._remote_fetch(env, url) env.safe_sudo("sudo dpkg -i {0}".format(dl_file))
def install_varscan(env): """Variant detection in massively parallel sequencing data http://varscan.sourceforge.net/ """ version = "2.3.5" url = "http://downloads.sourceforge.net/project/varscan/VarScan.v%s.jar" % version install_dir = _symlinked_java_version_dir("varscan", version, env) if install_dir: with _make_tmp_dir() as work_dir: with cd(work_dir): run("wget --no-check-certificate %s" % url) env.safe_sudo("mv *.jar %s" % install_dir)
def install_shrec(env): version = "2.2" url = "http://downloads.sourceforge.net/project/shrec-ec/SHREC%%20%s/bin.zip" % version install_dir = _symlinked_java_version_dir("shrec", version, env) if install_dir: shrec_script = "%s/shrec" % install_dir 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 *.class %s" % install_dir) for line in _shrec_run.split("\n"): if line.strip(): append(shrec_script, line, use_sudo=env.use_sudo) env.safe_sudo("chmod a+rwx %s" % shrec_script) env.safe_sudo("ln -s %s %s/bin/shrec" % (shrec_script, env.system_install))
def install_proteowizard(env): build_id = "83083" version = "3_0_4472" url = "http://teamcity.labkey.org:8080/repository/download/bt36/%s:id/pwiz-bin-windows-x86-vc100-release-%s.tar.bz2?guest=1" % ( build_id, version) install_dir = env.get("install_dir") share_dir = "%s/share/proteowizard" % install_dir with _make_tmp_dir() as work_dir: with cd(work_dir): _fetch_and_unpack(url, need_dir=False) env.safe_sudo("cp -r . '%s'" % share_dir) proteowizard_apps = [ "msconvert", "msaccess", "chainsaw", "msdiff", "mspicture", "mscat", "txt2mzml", "MSConvertGUI", "Skyline", "Topograph", "SeeMS" ] for app in proteowizard_apps: setup_wine_wrapper(env, "%s/%s" % (share_dir, app))
def install_gemini(env): """A lightweight db framework for disease and population genetics. https://github.com/arq5x/gemini """ version = "github" installer = "https://raw.github.com/arq5x/gemini/master/gemini/scripts/gemini_install.py" data_dir = os.path.join( env.system_install, "local" if env.system_install.find("/local") == -1 else "", "share", "gemini") with _make_tmp_dir() as work_dir: with cd(work_dir): env.safe_run("wget --no-check-certificate %s" % installer) env.safe_run("%s gemini_install.py %s %s %s" % (_python_cmd(env), "" if env.use_sudo else "--nosudo", env.system_install, data_dir)) env.safe_run("rm -f gemini_install.py")
def install_novosort(env): """Multithreaded sort and merge for BAM files. http://www.novocraft.com/wiki/tiki-index.php?page=Novosort """ base_version = "V3.00.02" version = "V1.00.02" url = "http://www.novocraft.com/downloads/%s/novosort%s.gcc.tar.gz" % ( base_version, version) ref_url = "http://www.novocraft.com/main/downloadpage.php" install_dir = shared._get_bin_dir(env) with _make_tmp_dir() as work_dir: with cd(work_dir): _wget_with_cookies(ref_url, url) env.safe_run("tar -xzvpf novosort%s.gcc.tar.gz" % version) with cd("novosort"): for fname in ["novosort"]: env.safe_sudo("mv %s %s" % (fname, install_dir))
def install_fastqc(env): version = "0.9.1" url = "http://www.bioinformatics.bbsrc.ac.uk/projects/fastqc/" \ "fastqc_v%s.zip" % version executable = "fastqc" install_dir = _symlinked_java_version_dir("fastqc", version, env) if install_dir: with _make_tmp_dir() as work_dir: with cd(work_dir): run("wget %s" % (url)) run("unzip %s" % os.path.basename(url)) with cd("FastQC"): env.safe_sudo("chmod a+rwx %s" % executable) env.safe_sudo("mv * %s" % install_dir) env.safe_sudo( "ln -s %s/%s %s/bin/%s" % (install_dir, executable, env.system_install, executable))
def install_fastq_screen(env): """A screening application for high througput sequence data. http://www.bioinformatics.babraham.ac.uk/projects/fastq_screen/ """ version = "0.4" url = "http://www.bioinformatics.babraham.ac.uk/projects/fastq_screen/" \ "fastq_screen_v%s.tar.gz" % version install_dir = shared._symlinked_shared_dir("fastqc_screen", version, env) executable = "fastq_screen" if install_dir: with _make_tmp_dir() as work_dir: with cd(work_dir): env.safe_run("wget %s" % (url)) env.safe_run("tar -xzvpf %s" % os.path.basename(url)) with cd("fastq_screen_v%s" % version): env.safe_sudo("mv * %s" % install_dir) env.safe_sudo("ln -s %s/%s %s/bin/%s" % (install_dir, executable, env.system_install, executable))
def install_multiplierz(env): """ Assumes your wine environment contains an install Python 2.6 in C:\Python26. """ wine_user = _get_wine_user(env) env.safe_sudo("setup_proteomics_wine_env.sh", user=wine_user) with _make_tmp_dir() as work_dir: with cd(work_dir): _fetch_and_unpack( "hg clone http://multiplierz.hg.sourceforge.net:8000/hgroot/multiplierz/multiplierz" ) with cd("multiplierz"): wine_prefix = _get_wine_prefix(env) env.safe_sudo( "%s; wine %s/drive_c/Python26/python.exe setup.py install" % (_conf_wine(env), wine_prefix), user=wine_user)
def install_fastqc(env): """A quality control tool for high throughput sequence data. http://www.bioinformatics.babraham.ac.uk/projects/fastqc/ """ version = "0.10.1" url = "http://www.bioinformatics.bbsrc.ac.uk/projects/fastqc/" \ "fastqc_v%s.zip" % version executable = "fastqc" install_dir = _symlinked_java_version_dir("fastqc", version, env) if install_dir: with _make_tmp_dir() as work_dir: with cd(work_dir): env.safe_run("wget %s" % (url)) env.safe_run("unzip %s" % os.path.basename(url)) with cd("FastQC"): env.safe_sudo("chmod a+rwx %s" % executable) env.safe_sudo("mv * %s" % install_dir) env.safe_sudo("ln -s %s/%s %s/bin/%s" % (install_dir, executable, env.system_install, executable))
def install_tassel(env): """TASSEL: evaluate traits associations, evolutionary patterns, and linkage disequilibrium. http://www.maizegenetics.net/index.php?option=com_content&task=view&id=89&/Itemid=119 """ version = "4.0" url = "http://www.maizegenetics.net/tassel/tassel{0}_standalone.zip".format(version) executables = ["start_tassel.pl", "run_pipeline.pl"] install_dir = _symlinked_java_version_dir("tassel", version, env) if install_dir: with _make_tmp_dir() as work_dir: with cd(work_dir): env.safe_run("wget %s" % (url)) env.safe_run("unzip %s" % os.path.basename(url)) with cd("tassel{0}_standalone".format(version)): for x in executables: env.safe_sed(x, "^my \$top.*;", "use FindBin qw($RealBin); my $top = $RealBin;") env.safe_sudo("chmod a+rwx %s" % x) env.safe_sudo("mv * %s" % install_dir) for x in executables: env.safe_sudo("ln -s %s/%s %s/bin/%s" % (install_dir, x, env.system_install, x))
def install_shrec(env): """Shrec is a bioinformatics tool for error correction of HTS read data. http://sourceforge.net/projects/shrec-ec/ """ version = "2.2" url = "http://downloads.sourceforge.net/project/shrec-ec/SHREC%%20%s/bin.zip" % version install_dir = _symlinked_java_version_dir("shrec", version, env) if install_dir: shrec_script = "%s/shrec" % 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 *.class %s" % install_dir) for line in _shrec_run.split("\n"): if line.strip(): env.safe_append(shrec_script, line, use_sudo=env.use_sudo) env.safe_sudo("chmod a+rwx %s" % shrec_script) env.safe_sudo("ln -s %s %s/bin/shrec" % (shrec_script, env.system_install))
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.6-5" version = "%s-gba531bd" % min_version dl_fname = "GenomeAnalysisTK-%s.tar.bz2" % min_version with _make_tmp_dir() as work_dir: work_fname = os.path.join(work_dir, dl_fname) def manual_gatk_download(env): 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 raw_input("**** Press <enter> when complete ") 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)
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)
def install_snpeff(env): version = "1_9" 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) if install_dir: with _make_tmp_dir() as work_dir: with cd(work_dir): dir_name = _fetch_and_unpack(url) with cd(dir_name): 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")) sudo("mv *.config %s" % install_dir) data_dir = os.path.join(install_dir, "data") 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) sudo("mv data/%s %s" % (org, data_dir))