2023-01-19 06:30:17 +08:00
|
|
|
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
|
2018-11-03 09:18:05 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
|
|
|
from os import symlink
|
|
|
|
|
2022-05-29 00:55:44 +08:00
|
|
|
from spack.package import *
|
2021-07-09 06:12:30 +08:00
|
|
|
|
2018-11-03 09:18:05 +08:00
|
|
|
|
|
|
|
class Homer(Package):
|
|
|
|
"""Software for motif discovery and next generation sequencing analysis"""
|
|
|
|
|
|
|
|
homepage = "http://homer.ucsd.edu/homer"
|
2019-10-29 09:27:54 +08:00
|
|
|
url = "http://homer.ucsd.edu/homer/data/software/homer.v4.9.1.zip"
|
2018-11-03 09:18:05 +08:00
|
|
|
|
|
|
|
version("4.9.1", sha256="ad1303b0b0400dc8a88dbeae1ee03a94631977b751a3d335326c4febf0eec3a9")
|
|
|
|
|
|
|
|
depends_on("perl", type=("build", "run"))
|
|
|
|
depends_on("r-biocgenerics", type="run")
|
|
|
|
depends_on("r-biocparallel", type="run")
|
|
|
|
depends_on("r-edger", type="run")
|
|
|
|
depends_on("r-deseq2", type="run")
|
|
|
|
|
|
|
|
variant("data", default=False, description="Download genome data packages")
|
|
|
|
|
|
|
|
def install(self, spec, prefix):
|
|
|
|
# initialize homer directories
|
|
|
|
basedir = join_path(prefix.lib, "homer")
|
|
|
|
mkdirp(basedir)
|
|
|
|
|
|
|
|
install_tree(".", basedir)
|
|
|
|
|
|
|
|
# symlink bin so it is included in the PATH
|
|
|
|
symlink(join_path(basedir, "bin"), prefix.bin)
|
|
|
|
|
|
|
|
# override homer base directory in configure script
|
|
|
|
filter_file(
|
|
|
|
"my $homeDir = $1;",
|
|
|
|
'my $homeDir = "{0}";'.format(basedir),
|
|
|
|
"configureHomer.pl",
|
|
|
|
string=True,
|
|
|
|
)
|
|
|
|
|
|
|
|
# compile/prepare binaries and perl scripts with the correct paths
|
|
|
|
perl = which("perl")
|
|
|
|
perl("configureHomer.pl", "-local")
|
|
|
|
|
|
|
|
# download extra data if requested
|
|
|
|
if "+data" in spec:
|
|
|
|
perl("configureHomer.pl", "-install", "-all")
|