From 1c528719cbb25e62c71ccf683aa4988b3b4ee61c Mon Sep 17 00:00:00 2001 From: Teague Sterling Date: Wed, 2 Oct 2024 07:21:06 -0700 Subject: perl-bio-ensembl-variation: new package (#44507) * Adding the perl-bio-db-bigfile package * Adding perl-bio-ensembl-variation package * Adding perl-bio-ensembl-io package * Update package.py * Update package.py * Update package.py * Update package.py * Update package.py * Updating dependent package handling Signed-off-by: Teague Sterling * Updating dependent package handling Signed-off-by: Teague Sterling * Reverting variants Signed-off-by: Teague Sterling * Update package.py * Rename package.py to package.py * Update package.py * Update package.py * Update package.py * Fix variant installation and dependencies Signed-off-by: Teague Sterling * Styles Signed-off-by: Teague Sterling * Removing unneeded dependencies Signed-off-by: Teague Sterling * Update package.py * Update package.py * Update package.py * perl-bio-ensembl: update sha256 of 112 * perl-bio-ensembl-variation: add perl-bio-ensembl-funcgen@{vers} --------- Signed-off-by: Teague Sterling Co-authored-by: Bernhard Kaindl --- .../packages/perl-bio-ensembl-variation/package.py | 88 ++++++++++++++++++++++ .../builtin/packages/perl-bio-ensembl/package.py | 2 +- 2 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 var/spack/repos/builtin/packages/perl-bio-ensembl-variation/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/perl-bio-ensembl-variation/package.py b/var/spack/repos/builtin/packages/perl-bio-ensembl-variation/package.py new file mode 100644 index 0000000000..0078c28061 --- /dev/null +++ b/var/spack/repos/builtin/packages/perl-bio-ensembl-variation/package.py @@ -0,0 +1,88 @@ +# Copyright 2013-2024 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) +from spack.package import * + + +class PerlBioEnsemblVariation(Package): + """The Ensembl Variation Perl API and SQL schema.""" + + homepage = "http://www.ensembl.org/info/docs/api/variation/" + url = "https://github.com/Ensembl/ensembl-variation/archive/release/112.zip" + + maintainers("teaguesterling") + + license("APACHE-2.0", checked_by="teaguesterling") + + for vers, sha in [ + ("112", "ad75ff0a9efbf2d5c10ab5087d414bac685819664d01fbe4a9765393bd742a7c"), + ("111", "b2171b3f5f82a2b7e849c0ec8dc254f4bace4b3faba1b3ab75c5eea596e33bef"), + ("110", "210d627dcb867d9fda3a0d94428da256f394c32e34df5171b9b9e604507e1f05"), + ]: + version(vers, sha256=sha) + depends_on(f"perl-bio-ensembl@{vers}", when=f"@{vers}") + depends_on(f"perl-bio-ensembl-io@{vers}", when=f"@{vers}+tools", type="run") + depends_on(f"perl-bio-ensembl-funcgen@{vers}", when=f"@{vers}", type="run") + + extends("perl") + + variant("sql", default=False, description="Install SQL files") + variant("schema", default=False, description="Install schema documentation") + variant("nextflow", default=False, description="Install nextflow workflows") + variant("scripts", default=False, description="Install additional scripts") + variant("tools", default=False, description="Install additional tools") + variant("ld", default=False, description="Compile LD calculation tools") + + depends_on("perl-bioperl@1.6.924") + depends_on("perl-bio-bigfile") + depends_on("perl-bio-db-hts") + depends_on("perl-sereal") + depends_on("perl-json") + depends_on("perl-set-intervaltree") + depends_on("perl-string-approx") + depends_on("perl-xml-hash-xs") + depends_on("perl-xml-libxml") + depends_on("perl-date-manip") + + with when("+ld"): + depends_on("htslib", type="build") + depends_on("gmake", type="build") + + phases = ("build", "install") + + def setup_build_environment(self, env): + if self.spec.satisfies("+ld"): + env.set("HTSLIB_DIR", self.spec["htslib"].prefix.include) + + def build(self, spec, prefix): + if spec.satisfies("+ld"): + make = which("make") + with working_dir("C_code"): + make() + if spec.satisfies("+tools"): + # Fix the fact that phenotype_annotation isn't executable + chmod = which("chmod") + chmod("+x", "tools/phenotype_annotation/phenotype_annotation") + + def install(self, spec, prefix): + install_tree("modules", prefix.lib.perl5) + + mkdirp(prefix.share.ensembl.variation) + for extra in ["sql", "schema", "nextflow", "scripts"]: + if spec.satisfies(f"+{extra}"): + target = join_path(prefix.share.ensembl, extra) + install_tree(extra, target) + + for requested, targets in { + "+ld": ["C_code/calc_genotypes", "C_code/ld_vcf"], + "+tools": [ + "tools/linkage_disequilibrium/ld_tool", + "tools/variant_simulator/simulate_variation", + "tools/phenotype_annotation/phenotype_annotation", + ], + }.items(): + if spec.satisfies(requested): + mkdirp(prefix.bin) + for target in targets: + install(target, prefix.bin) diff --git a/var/spack/repos/builtin/packages/perl-bio-ensembl/package.py b/var/spack/repos/builtin/packages/perl-bio-ensembl/package.py index 763c75e91d..8cf860e3d7 100644 --- a/var/spack/repos/builtin/packages/perl-bio-ensembl/package.py +++ b/var/spack/repos/builtin/packages/perl-bio-ensembl/package.py @@ -18,7 +18,7 @@ class PerlBioEnsembl(Package): license("APACHE-2.0", checked_by="teaguesterling") - version("112", sha256="8a6b46840df71c4332d2de6027596ed4417a26111800d7ff0636199363568235") + version("112", sha256="7c2c5265abe74b462cd4f8b26f140a4c4945cd0e2971f40711afbb4b38db5997") version("111", sha256="346c47c75a6fa8dcfd9f9d22e9f1e0ccc35b2fb99f75980a0c74d892e4ab2b6d") version("110", sha256="fdf725cad1a980ddf900f1af1a72bf1de355f15e408664930ed84aeccfefad15") -- cgit v1.2.3-70-g09d2