summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/fr-hit/package.py
blob: a6dc3378822de6bd19cd4588d0b31bf15a9e654b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright 2013-2018 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 FrHit(Package):
    """An efficient algorithm for fragment recruitment for next generation
    sequences against microbial reference genomes."""

    homepage = "http://weizhong-lab.ucsd.edu/frhit"
    url      = "http://weizhong-lab.ucsd.edu/frhit/fr-hit-v0.7.1-2013-02-20.tar.gz"

    version('0.7.1-2013-02-20', '3e8ea41ba09ab0c13e9973fe6f493f96')

    depends_on('perl')
    depends_on('python@2.7:')

    # The patch adds the python interpreter to the beginning of the script
    # allowing it to be run directly without passing the entire path to the
    # script to python.
    patch('binning.patch')

    def install(self, spec, prefix):
        make()

        filter_file(
            r'#!/bin/env perl',
            '#!/usr/bin/env perl',
            'frhit2pairend.pl'
        )
        filter_file(
            r'#!/bin/env perl',
            '#!/usr/bin/env perl',
            'psl2sam.pl'
        )

        mkdirp(prefix.bin)
        install('fr-hit', prefix.bin)
        install('frhit2pairend.pl', prefix.bin)
        install('psl2sam.pl', prefix.bin)
        install('binning-1.1.1/bacteria_gitax.pkl', prefix.bin)
        install('binning-1.1.1/binning.py', prefix.bin)
        install('binning-1.1.1/tax.pkl', prefix.bin)