easyblock = 'MakeCp'

name = 'psmc'
version = '0.6.5'

homepage = 'https://github.com/lh3/psmc'
description = """This software package infers population size history from a diploid sequence
using the Pairwise Sequentially Markovian Coalescent (PSMC) model."""

toolchain = {'name': 'foss', 'version': '2016a'}

source_urls = ['https://github.com/lh3/psmc/archive/']
sources = ['%(version)s.tar.gz']

buildopts = '&& cd local_utils && make'

local_utils = [
    'avg.pl',
    'calD',
    'cntcpg',
    'ctime_plot.pl',
    'dec2ctime.pl',
    'decode2bed.pl',
    'fq2psmcfa',
    'history2ms.pl',
    'ms2psmcfa.pl',
    'mutDiff',
    'pcnt_bezier.lua',
    'psmc2history.pl',
    'psmc_plot.pl',
    'psmc_trunc.pl',
    'splitfa',
]

files_to_copy = [
    (['psmc'], 'bin'),
    (['local_utils/%s' % util for util in local_utils], 'bin')
]

sanity_check_paths = {
    'files': ['bin/psmc'] + ['bin/%s' % util for util in local_utils],
    'dirs': [],
}

moduleclass = 'bio'
