Esempio n. 1
0
 def _cmake_bamtools(env):
     env.safe_run("mkdir build")
     with cd("build"):
         env.safe_run("cmake ..")
         env.safe_run("make")
     env.safe_sudo("cp bin/* %s" % shared._get_bin_dir(env))
     env.safe_sudo("cp lib/* %s" % shared._get_lib_dir(env))
Esempio n. 2
0
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))
Esempio n. 3
0
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))
Esempio n. 4
0
 def _cmake_bamtools(env):
     env.safe_run("mkdir build")
     with cd("build"):
         env.safe_run("cmake ..")
         env.safe_run("make")
     env.safe_sudo("cp bin/* %s" % shared._get_bin_dir(env))
     env.safe_sudo("cp lib/* %s" % shared._get_lib_dir(env))
Esempio n. 5
0
 def _install_fn(env, install_dir):
     env.safe_sudo("mv *.jar %s" % install_dir)
     bin_dir = shared._get_bin_dir(env)
     exe_file = "PGDSpider2.sh"
     jar = "PGDSpider2.jar"
     env.safe_sed(exe_file, jar, "{dir}/{jar}".format(dir=install_dir, jar=jar))
     env.safe_run("chmod a+x {0}".format(exe_file))
     env.safe_sudo("mv {exe} {bin}".format(exe=exe_file, bin=bin_dir))
Esempio n. 6
0
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))
Esempio n. 7
0
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):
                    env.safe_run("wget %s%s" % (base_url, tool))
                    env.safe_sudo("cp -f %s %s" % (tool, install_dir))
Esempio n. 8
0
 def _install_fn(env, install_dir):
     env.safe_sudo("mv *.jar %s" % install_dir)
     bin_dir = shared._get_bin_dir(env)
     exe_file = "PGDSpider2.sh"
     jar = "PGDSpider2.jar"
     env.safe_sed(exe_file, jar, "{dir}/{jar}".format(dir=install_dir,
                                                      jar=jar))
     env.safe_run("chmod a+x {0}".format(exe_file))
     env.safe_sudo("mv {exe} {bin}".format(exe=exe_file, bin=bin_dir))
Esempio n. 9
0
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))
Esempio n. 10
0
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):
            env.safe_run("wget %s" % url)
            env.safe_run("unzip %s" % os.path.basename(url))
            env.safe_sudo("mv SolexaQA.pl %s" % shared._get_bin_dir(env))
Esempio n. 11
0
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):
            env.safe_run("wget %s" % url)
            env.safe_run("unzip %s" % os.path.basename(url))
            env.safe_sudo("mv SolexaQA.pl %s" % shared._get_bin_dir(env))
Esempio n. 12
0
 def _safe_ncurses_make(env):
     """Combine samtools, removing ncurses refs if not present on system.
     """
     with settings(warn_only=True):
         result = env.safe_run("make")
     # no ncurses, fix Makefile and rebuild
     if result.failed:
         env.safe_sed("Makefile", "-D_CURSES_LIB=1", "-D_CURSES_LIB=0")
         env.safe_sed("Makefile", "-lcurses", "# -lcurses")
         env.safe_run("make clean")
         env.safe_run("make")
     install_dir = shared._get_bin_dir(env)
     for fname in env.safe_run_output("ls -1 samtools bcftools/bcftools bcftools/vcfutils.pl misc/wgsim").split("\n"):
         env.safe_sudo("cp -f %s %s" % (fname.rstrip("\r"), install_dir))
Esempio n. 13
0
def install_blast(env):
    version = env.tool_version
    url = 'ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/%s/ncbi-blast-%s-x64-linux.tar.gz' % (version[:-1], version)
    install_dir = env.system_install
    install_cmd = sudo if env.use_sudo else run
    if not exists(install_dir):
        install_cmd("mkdir -p %s" % install_dir)
    with _make_tmp_dir() as work_dir:
        with cd(work_dir):
            run("wget %s" % url)
            run("tar -xvzf %s" % os.path.split(url)[-1])
            with cd('ncbi-blast-%s/bin' % version):
                bin_dir = _get_bin_dir(env)
                install_cmd("mv * '%s'" % bin_dir)
Esempio n. 14
0
def install_blast(env):
    version = env.tool_version
    url = 'ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/%s/ncbi-blast-%s-x64-linux.tar.gz' % (version[:-1], version)
    install_dir = env.system_install
    install_cmd = env.safe_sudo if env.use_sudo else env.safe_run
    if not env.safe_exists(install_dir):
        install_cmd("mkdir -p %s" % install_dir)
    with _make_tmp_dir() as work_dir:
        with cd(work_dir):
            env.safe_run("wget %s" % url)
            env.safe_run("tar -xvzf %s" % os.path.split(url)[-1])
            with cd('ncbi-blast-%s/bin' % version):
                bin_dir = _get_bin_dir(env)
                install_cmd("mv * '%s'" % bin_dir)
Esempio n. 15
0
 def _safe_ncurses_make(env):
     """Combine samtools, removing ncurses refs if not present on system.
     """
     with settings(warn_only=True):
         result = env.safe_run("make")
     # no ncurses, fix Makefile and rebuild
     if result.failed:
         env.safe_sed("Makefile", "-D_CURSES_LIB=1", "-D_CURSES_LIB=0")
         env.safe_sed("Makefile", "-lcurses", "# -lcurses")
         env.safe_run("make clean")
         env.safe_run("make")
     install_dir = shared._get_bin_dir(env)
     for fname in env.safe_run_output("ls -1 samtools bcftools/bcftools bcftools/vcfutils.pl misc/wgsim").split("\n"):
         env.safe_sudo("cp -f %s %s" % (fname.rstrip("\r"), install_dir))
Esempio n. 16
0
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))
Esempio n. 17
0
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))
Esempio n. 18
0
def _freenx_scripts(env):
    """Provide graphical access to clients via FreeNX.
    """
    home_dir = env.safe_run_output("echo $HOME")
    setup_script = "setupnx.sh"
    bin_dir = shared._get_bin_dir(env)
    install_file_dir = os.path.join(env.config_dir, os.pardir, "installed_files")
    if not env.safe_exists(os.path.join(bin_dir, setup_script)):
        env.safe_put(os.path.join(install_file_dir, setup_script),
                     os.path.join(home_dir, setup_script))
        env.safe_run("chmod 0777 %s" % os.path.join(home_dir, setup_script))
        env.safe_sudo("mv %s %s" % (os.path.join(home_dir, setup_script), bin_dir))
    remote_login = "******"
    if not env.safe_exists(os.path.join(home_dir, remote_login)):
        env.safe_put(os.path.join(install_file_dir, 'bash_login'), os.path.join(home_dir, remote_login))
        env.safe_run("chmod 0777 %s" % os.path.join(home_dir, remote_login))
    _configure_gnome(env)
Esempio n. 19
0
def install_pgdspider(env):
    """PGDSpider format conversion for population genetics programs.
    http://www.cmpg.unibe.ch/software/PGDSpider/
    """
    if os.path.exists(os.path.join(shared._get_bin_dir(env), "PGDSpider2.sh")):
        return
    version = "2.0.2.0"
    url = "http://www.cmpg.unibe.ch/software/PGDSpider/PGDSpider_{v}.zip".format(
        v=version)
    def _install_fn(env, install_dir):
        env.safe_sudo("mv *.jar %s" % install_dir)
        bin_dir = shared._get_bin_dir(env)
        exe_file = "PGDSpider2.sh"
        jar = "PGDSpider2.jar"
        env.safe_sed(exe_file, jar, "{dir}/{jar}".format(dir=install_dir, jar=jar))
        env.safe_run("chmod a+x {0}".format(exe_file))
        env.safe_sudo("mv {exe} {bin}".format(exe=exe_file, bin=bin_dir))
    _java_install("PGDSpider", version, url, env, install_fn=_install_fn)
Esempio n. 20
0
def _freenx_scripts(env):
    """Provide graphical access to clients via FreeNX.
    """
    home_dir = env.safe_run_output("echo $HOME")
    setup_script = "setupnx.sh"
    bin_dir = shared._get_bin_dir(env)
    install_file_dir = os.path.join(env.config_dir, os.pardir,
                                    "installed_files")
    if not env.safe_exists(os.path.join(bin_dir, setup_script)):
        env.safe_put(os.path.join(install_file_dir, setup_script),
                     os.path.join(home_dir, setup_script))
        env.safe_run("chmod 0777 %s" % os.path.join(home_dir, setup_script))
        env.safe_sudo("mv %s %s" %
                      (os.path.join(home_dir, setup_script), bin_dir))
    remote_login = "******"
    if not env.safe_exists(os.path.join(home_dir, remote_login)):
        env.safe_put(os.path.join(install_file_dir, 'bash_login'),
                     os.path.join(home_dir, remote_login))
        env.safe_run("chmod 0777 %s" % os.path.join(home_dir, remote_login))
    _configure_gnome(env)
Esempio n. 21
0
def install_pgdspider(env):
    """PGDSpider format conversion for population genetics programs.
    http://www.cmpg.unibe.ch/software/PGDSpider/
    """
    if os.path.exists(os.path.join(shared._get_bin_dir(env), "PGDSpider2.sh")):
        return
    version = "2.0.2.0"
    url = "http://www.cmpg.unibe.ch/software/PGDSpider/PGDSpider_{v}.zip".format(
        v=version)

    def _install_fn(env, install_dir):
        env.safe_sudo("mv *.jar %s" % install_dir)
        bin_dir = shared._get_bin_dir(env)
        exe_file = "PGDSpider2.sh"
        jar = "PGDSpider2.jar"
        env.safe_sed(exe_file, jar, "{dir}/{jar}".format(dir=install_dir,
                                                         jar=jar))
        env.safe_run("chmod a+x {0}".format(exe_file))
        env.safe_sudo("mv {exe} {bin}".format(exe=exe_file, bin=bin_dir))

    _java_install("PGDSpider", version, url, env, install_fn=_install_fn)
Esempio n. 22
0
 def _build(env):
     with cd("pbgzip"):
         env.safe_run("make")
         install_dir = shared._get_bin_dir(env)
         env.safe_sudo("cp -f pbgzip %s" % (install_dir))
Esempio n. 23
0
def install_biokepler(env):
    url = "http://www.biokepler.org/files/downloads/biokepler-1.0.deb"
    tool = url[url.rfind('/')+1:]
    _download_install_deb_pkg(env, url, tool)
    install_dir = shared._get_bin_dir(env)
    env.safe_sudo("ln -f -s /opt/kepler/biokepler-1.0/kepler.sh %s/kepler" % install_dir)
Esempio n. 24
0
 def _build(env):
     with cd("pbgzip"):
         env.safe_run("make")
         install_dir = shared._get_bin_dir(env)
         env.safe_sudo("cp -f pbgzip %s" % (install_dir))