summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/prinseq-lite/package.py
blob: 7852f08e0c1686df43c3bcb2a3dfac386694f672 (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
# 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)

from spack.package import *


class PrinseqLite(Package):
    """PRINSEQ will help you to preprocess your genomic or metagenomic
    sequence data in FASTA or FASTQ format."""

    homepage = "http://prinseq.sourceforge.net"
    url = "https://sourceforge.net/projects/prinseq/files/standalone/prinseq-lite-0.20.4.tar.gz"

    version("0.20.4", sha256="9b5e0dce3b7f02f09e1cc7e8a2dd77c0b133e5e35529d570ee901f53ebfeb56f")

    variant("nopca", default=True, description="Graphs version without PCA")

    depends_on("perl", type="run")
    depends_on("perl-cairo", type="run")
    depends_on("perl-digest-md5", type="run")
    depends_on("perl-json", type="run")

    def install(self, spec, prefix):
        mkdirp(prefix.bin)

        filter_file(r"#!/usr/bin/perl", "#!/usr/bin/env perl", "prinseq-graphs-noPCA.pl")

        filter_file(r"#!/usr/bin/perl", "#!/usr/bin/env perl", "prinseq-lite.pl")

        install("prinseq-graphs-noPCA.pl", prefix.bin)
        install("prinseq-lite.pl", prefix.bin)

        chmod = which("chmod")
        chmod("+x", join_path(self.prefix.bin, "prinseq-graphs-noPCA.pl"))
        chmod("+x", join_path(self.prefix.bin, "prinseq-lite.pl"))