2021-01-02 15:10:28 +08:00
|
|
|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
2018-10-08 04:52:23 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
2017-09-21 06:48:20 +08:00
|
|
|
#
|
2018-10-08 04:52:23 +08:00
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2017-09-21 06:48:20 +08:00
|
|
|
import glob
|
2021-07-09 06:12:30 +08:00
|
|
|
from os import chmod
|
|
|
|
|
|
|
|
from spack import *
|
2017-09-21 06:48:20 +08:00
|
|
|
|
|
|
|
|
2018-05-23 20:25:42 +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/"
|
2018-05-23 20:25:42 +08:00
|
|
|
url = "https://www.mdc-berlin.de/system/files/migrated_files/fiona/mirdeep2_0_0_8.zip"
|
2017-09-21 06:48:20 +08:00
|
|
|
|
2019-10-11 13:44:41 +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):
|
2018-05-23 20:25:42 +08:00
|
|
|
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:
|
2019-02-08 03:05:19 +08:00
|
|
|
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)
|