From b0ec2788ab57d418a7193ea7bd1a0a57342ccaf0 Mon Sep 17 00:00:00 2001 From: ilbiondo <61497728+ilbiondo@users.noreply.github.com> Date: Thu, 16 Apr 2020 12:19:20 +0200 Subject: HAL: added new package at v2.1 (#16085) Co-authored-by: Massimiliano Culpo --- var/spack/repos/builtin/packages/hal/package.py | 102 ++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 var/spack/repos/builtin/packages/hal/package.py diff --git a/var/spack/repos/builtin/packages/hal/package.py b/var/spack/repos/builtin/packages/hal/package.py new file mode 100644 index 0000000000..752feab1d8 --- /dev/null +++ b/var/spack/repos/builtin/packages/hal/package.py @@ -0,0 +1,102 @@ +# Copyright 2013-2020 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 import * + + +class Hal(MakefilePackage): + """HAL is a structure to efficiently store and index multiple + genome alignments and ancestral reconstructions. + + HAL is a graph-based representation which provides several advantages + over matrix/block-based formats such as MAF, such as + improved scalability and the ability to perform queries with + respect to an arbitrary reference or subtree.""" + + homepage = "https://github.com/ComparativeGenomicsToolkit/hal" + url = "https://github.com/ComparativeGenomicsToolkit/hal/archive/release-V2.1.tar.gz" + + version('2.1', '540255be1af55abf390359fe034b82d7e61bdf6c3277df3cc01259cd450994e5') + + maintainers = ['ilbiondo'] + + # HAL expects to be compiled alongside sonlib so we need both the + # source version and python library version + + depends_on('hdf5+cxx~mpi') + depends_on('sonlib', type='build') + depends_on('python', type='run') + depends_on('py-sonlib', type='run') + + # As we install sonlib seperately the include.mk needs + # editing to comment out an include + + def patch(self): + includemk = FileFilter('include.mk') + includemk.filter(r'^include \$\{sonLibRootDir\}/include\.mk', + '# include ${sonLibRootDir}/include.mk') + + def setup_build_environment(self, env): + env.set('sonLibRootDir', self.spec['sonlib'].prefix) + + def install(self, spec, prefix): + + # First the easy bit + + install_tree('bin', prefix.bin) + install_tree('lib', prefix.lib) + + # Copy the rest of the "toolkit" as to a directory named hal + # in order that the python libraries can be found and used + + haldirs = ['alignmentDepth', + 'analysis', + 'api', + 'assemblyHub', + 'benchmarks', + 'blockViz', + 'doc', + 'extra', + 'extract', + 'fasta', + 'liftover', + 'lod', + 'maf', + 'modify', + 'mutations', + 'objs', + 'phyloP', + 'randgen', + 'stats', + 'synteny', + 'testdata', + 'validate'] + + for folder in haldirs: + + install_tree(folder, join_path(self.prefix, 'hal', folder)) + + install('__init__.py', join_path(self.prefix, 'hal')) + + # Now in order to make things useful we copy some python tools to bin + + halpyfiles = ['analysis/halContiguousRegions.py', + 'assemblyHub/hal2assemblyHub.py', + 'liftover/halLiftoverStatus.py', + 'lod/halLodBenchmark.py', + 'lod/halLodInterpolate.py', + 'maf/hal2mafMP.py', + 'phyloP/halPhyloPMP.py'] + + for pyfile in halpyfiles: + + install(pyfile, self.prefix.bin) + + # The hal directory is a python library so we set the path + # to be the installation root + + def setup_run_environment(self, env): + env.prepend_path('PYTHONPATH', self.prefix) -- cgit v1.2.3-70-g09d2