spack/var/spack/repos/builtin/packages/mirdeep2/package.py

52 lines
1.9 KiB
Python
Raw Normal View History

# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
2017-09-21 06:48:20 +08:00
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
2017-09-21 06:48:20 +08:00
import glob
from os import chmod
from spack import *
2017-09-21 06:48:20 +08:00
class Mirdeep2(Package):
2017-09-21 06:48:20 +08:00
"""miRDeep2 is a completely overhauled tool which discovers microRNA genes
by analyzing sequenced RNAs."""
homepage = "https://www.mdc-berlin.de/8551903/en/"
url = "https://www.mdc-berlin.de/system/files/migrated_files/fiona/mirdeep2_0_0_8.zip"
2017-09-21 06:48:20 +08:00
version('0.0.8', sha256='eeb24ee1b0e76b49ee2f542da3ee7d46d163c80b152709e963492b79f4fca1b8')
2017-09-21 06:48:20 +08:00
depends_on('perl', type=('build', 'run'))
depends_on('perl-pdf-api2', type=('build', 'run'))
depends_on('bowtie')
depends_on('viennarna')
depends_on('squid')
depends_on('randfold')
def url_for_version(self, version):
url = 'https://www.mdc-berlin.de/system/files/migrated_files/fiona/mirdeep2_{0}.zip'
2017-09-21 06:48:20 +08:00
return url.format(version.underscored)
def patch(self):
with working_dir('src'):
files = glob.iglob("*.pl")
for file in files:
chmod(file, 0o755)
2017-09-21 06:48:20 +08:00
change = FileFilter(file)
change.filter('usr/bin/perl', 'usr/bin/env perl')
change.filter('perl -W', 'perl')
change.filter("../Rfam_for_miRDeep.fa",
"Rfam_for_miRDeep.fa")
change.filter("../install_successful",
"install_successful")
def install(self, spec, prefix):
install_tree('src', prefix.bin)
install('Rfam_for_miRDeep.fa', prefix.bin)
# miRDeep looks for the install_sucessful file to check if you used
# their automated install script which we'll just be kind of hacking
# around
touch(prefix.bin.install_successful)