Before we add rescaling, let me prove to you that our code as it now stands will not work on a large tree. Download the files rbcl738.nex and rbcl738nj.tre and move them to the same directory where you have rbcL.nex.
Modify your strom.conf file to look like this:
datafile = rbcl738.nex
treefile = rbcl738nj.tre
rmatrix = default: 0.08394222, 0.34116704, 0.03603322, 0.15737940, 0.30297095, 0.07850717
statefreq = default: 0.309769, 0.163380, 0.121023, 0.405828
ratevar = default:1.933185251
ncateg = default:4
expectedLnL = -144730.75
Modify your meson.build script so that it copies the two new files to your install directory:
project('strom', 'cpp',
default_options : ['cpp_std=c++11','prefix=/home/paul/Documents/strom/distr'],
version : '1.0')
cpp = meson.get_compiler('cpp')
lib_filesystem = cpp.find_library('boost_filesystem', dirs: ['/home/paul/lib/static'], required: true)
lib_program_options = cpp.find_library('boost_program_options', dirs: ['/home/paul/lib/static'], required: true)
lib_ncl = cpp.find_library('ncl', dirs: ['/home/paul/lib/static'], required: true)
lib_beagle = cpp.find_library('hmsbeagle', dirs: ['/home/paul/lib'], required: true)
incl_beagle = include_directories('/home/paul/include/libhmsbeagle-1')
incl_ncl = include_directories('/home/paul/include')
incl_boost = include_directories('/home/paul/Documents/libraries/boost_1_71_0')
incl_eigen = include_directories('/home/paul/Documents/libraries/eigen-eigen-323c052e1731')
executable('strom', 'main.cpp', install: true, install_dir: '.', dependencies: [lib_beagle,lib_ncl,lib_program_options,lib_filesystem], include_directories: [incl_beagle,incl_ncl,incl_boost,incl_eigen])
install_data('strom.conf', install_dir: '.')
<span style="color:#0000ff"><strong>install_data('rbcl738.nex', install_dir: '.')</strong></span>
<span style="color:#0000ff"><strong>install_data('rbcl738nj.tre', install_dir: '.')</strong></span>
install_data('test.tre', install_dir: '.')
install_data('rbcL.nex', install_dir: '.')
install_data('rbcLjc.tre', install_dir: '.')
install_data('datatest.nex', install_dir: '.')
install_data('go.sh', install_dir: '.')
Run the program using the above strom.conf file. Before doing this, you will need to run meson install
in order to get the new strom.conf
, data file, and tree file copied to your install directory.
You should find that the log-likelihood computed is shown as -inf
(negative infinity), which means the likelihood (on the linear scale) is 0.0, which in turn means that underflow has occurred in at least some of the site likelihood calculations. The next page will show you how to set up BeagleLib to rescale the likelihood so that underflow does not happen.