summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGeorge Young <A-N-Other@users.noreply.github.com>2023-09-18 16:36:44 +0100
committerGitHub <noreply@github.com>2023-09-18 17:36:44 +0200
commitc8a3f1a8aeeef0085f1dffd95e8746c265a1ec0e (patch)
tree0a50a1586e59dc10f900f95bbd9fcfb329ff9d2c /var
parentbe3f7b5da3d03be051805d11f0650437d283b836 (diff)
downloadspack-c8a3f1a8aeeef0085f1dffd95e8746c265a1ec0e.tar.gz
spack-c8a3f1a8aeeef0085f1dffd95e8746c265a1ec0e.tar.bz2
spack-c8a3f1a8aeeef0085f1dffd95e8746c265a1ec0e.tar.xz
spack-c8a3f1a8aeeef0085f1dffd95e8746c265a1ec0e.zip
chexmix: new package (#38441)
Co-authored-by: LMS Bioinformatics <bioinformatics@lms.mrc.ac.uk>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/chexmix/chexmix.sh3
-rw-r--r--var/spack/repos/builtin/packages/chexmix/package.py49
2 files changed, 52 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/chexmix/chexmix.sh b/var/spack/repos/builtin/packages/chexmix/chexmix.sh
new file mode 100644
index 0000000000..b83bce6e58
--- /dev/null
+++ b/var/spack/repos/builtin/packages/chexmix/chexmix.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+# convenience wrapper for the chexmix jar file
+java -jar chexmix.jar "$@"
diff --git a/var/spack/repos/builtin/packages/chexmix/package.py b/var/spack/repos/builtin/packages/chexmix/package.py
new file mode 100644
index 0000000000..6654102f4f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/chexmix/package.py
@@ -0,0 +1,49 @@
+# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+import os
+
+from spack.package import *
+
+
+class Chexmix(Package):
+ """ChExMix: the ChIP-exo mixture model. ChExMix aims to characterize protein-DNA binding
+ subtypes in ChIP-exo experiments."""
+
+ homepage = "http://mahonylab.org/software/chexmix"
+ url = "https://github.com/seqcode/chexmix/releases/download/v0.51/chexmix.v0.51.jar"
+
+ # The naming of the .jar files is inconsistent on GitHub. Until this is resolved, downloads
+ # that don't match the above url spec will need to be renamed - see rename_versions().
+ version(
+ "0.52",
+ url="https://github.com/seqcode/chexmix/releases/download/v0.52/chexmix.v0.52.public.jar",
+ sha256="7f856921b6071092cfcf226e4f99d9ab80587cf05502b41d00b8e5e16ccbfcdd",
+ expand=False,
+ )
+
+ depends_on("java@8:", type="run")
+ depends_on("meme", type="run")
+
+ @run_before("install")
+ def rename_versions(self):
+ if self.version == Version("0.52"):
+ os.rename("chexmix.v0.52.public.jar", "chexmix.v0.52.jar")
+
+ def install(self, spec, prefix):
+ # install .jar file
+ mkdirp(prefix.bin)
+ jar_file = "chexmix.v{0}.jar".format(self.version)
+ install(jar_file, prefix.bin)
+ # create a helper script to launch the .jar
+ script_sh = join_path(os.path.dirname(__file__), "chexmix.sh")
+ script = prefix.bin.chexmix
+ install(script_sh, script)
+ set_executable(script)
+ # set the helper script to explicitly point to java and the .jar file
+ java = self.spec["java"].prefix.bin.java
+ kwargs = {"ignore_absent": False, "backup": False, "string": False}
+ filter_file("^java", java, script, **kwargs)
+ filter_file("chexmix.jar", join_path(prefix.bin, jar_file), script, **kwargs)