Commit 60f0b923 authored by Damien Leroux's avatar Damien Leroux
Browse files

Late commit with fixes and updates. See the diff…

parent bd47a1a9
......@@ -28,6 +28,7 @@
#include <iostream>
#include "file.h"
#include <cstring>
#include <type_traits>
#include "eigen.h"
#include "error.h"
......@@ -956,9 +957,11 @@ struct EM_helpers {
struct EM_map {
std::vector<std::string> marker_names;
std::vector<double> distances;
std::vector<double> r;
double likelihood;
int n_iterations;
bool converged;
double delta;
};
......@@ -1079,7 +1082,7 @@ struct gamete_LV_database : public EM_helpers {
gam.get(*name_i++, tmp);
// accum = tmp / tmp.sum();
// // accum = tmp / (tmp.array() > 0).template cast<double>().sum();
accum = tmp * .25;
accum = tmp/* * .25*/;
for (const auto& t: TR) {
gam.get(*name_i++, tmp);
MSG_DEBUG("accum = " << accum.transpose() << " LV = " << tmp.transpose());
......@@ -1315,6 +1318,67 @@ struct gamete_LV_database : public EM_helpers {
MSG_DEBUG(em_state_per_mark_per_ind);
}
double
EM_forward_likelihood()
{
scoped_indent _("[EM forward likelihood] ");
double accum = 0;
for (size_t i = 0; i < em_chain_is_single.size(); ++i) {
if (em_chain_is_single[i]) {
size_t m = 0;
Eigen::Vector2d v2 = Eigen::Vector2d::Constant(1);
// forward.
for (; m < em_distances.size(); ++m) {
v2 = em_TR2[m] * (v2.array() * em_obs[m][i].unary.array()).matrix();
}
v2 = (v2.array() * em_obs[m][i].unary.array()).matrix();
accum += log(v2.sum());
} else {
size_t m = 0;
Eigen::Vector4d v4 = Eigen::Vector4d::Constant(1);
// forward.
for (; m < em_distances.size(); ++m) {
v4 = em_TR4[m] * (v4.array() * em_obs[m][i].binary.array()).matrix();
}
v4 = (v4.array() * em_obs[m][i].binary.array()).matrix();
accum += log(v4.sum());
}
}
return accum;
}
template <typename M>
double
L1(const M& m)
{
double d = m.sum();
return d < DBL_EPSILON ? 1. / d : 1.;
}
double
twoMarkerLikelihoodAtInf()
{
return twoMarkerLikelihood(0, .5);
auto o1 = em_obs[0].begin();
auto done = em_obs[0].end();
auto o2 = em_obs[1].begin();
auto sing = em_chain_is_single.begin();
double accum = 0;
for (; o1 != done; ++sing/*, ++m1, ++m2*/, ++o1, ++o2) {
if (*sing) {
// accum += log(o1->unary.transpose() * L1(o1->unary) * Eigen::Matrix2d::Constant(.5) * o2->unary);
// MSG_INFO("sing " << o1->unary.transpose() << " ; " << o2->unary.transpose());
accum += log(.5 * o1->unary.sum() * o2->unary.sum());
} else {
// accum += log(o1->binary.transpose() * L1(o1->binary) * Eigen::Matrix4d::Constant(.25) * o2->binary);
// MSG_INFO("doub " << o1->binary.transpose() << " ; " << o2->binary.transpose());
accum += log(.25 * o1->binary.sum() * o2->binary.sum());
}
}
return accum;
}
double
twoMarkerLikelihood(size_t i, double r)
{
......@@ -1326,10 +1390,19 @@ struct gamete_LV_database : public EM_helpers {
double accum = 0;
for (; sing != done; ++sing, ++m1, ++m2, ++o1, ++o2) {
if (*sing) {
accum += log(mult_and_norm(m1->unary, o1->unary).transpose() * get_TR_unary(r, true) * mult_and_norm(m2->unary, o2->unary));
// accum += log(mult_and_norm(m1->unary, o1->unary).transpose() * get_TR_unary(r, true) * mult_and_norm(m2->unary, o2->unary));
accum += log((2 * m1->unary.array() * o1->unary.array()).matrix().transpose()
* get_TR_unary(r, true)
* (2 * m2->unary.array() * o2->unary.array()).matrix());
// MSG_INFO("o1 " << o1->unary.transpose());
// MSG_INFO("o2 " << o2->unary.transpose());
} else {
Eigen::Vector4d mm1 = mult_and_norm(m1->binary, o1->binary);
Eigen::Vector4d mm2 = mult_and_norm(m2->binary, o2->binary);
// Eigen::Vector4d mm1 = mult_and_norm(m1->binary, o1->binary);
// Eigen::Vector4d mm2 = mult_and_norm(m2->binary, o2->binary);
// MSG_INFO("o1 " << o1->binary.transpose());
// MSG_INFO("o2 " << o2->binary.transpose());
Eigen::Vector4d mm1 = 4 * (m1->binary.array() * o1->binary.array()).matrix();
Eigen::Vector4d mm2 = 4 * (m2->binary.array() * o2->binary.array()).matrix();
/*MSG_DEBUG("mm1 " << mm1.transpose());*/
/*MSG_DEBUG("mm2 " << mm2.transpose());*/
accum += log(mm1.transpose() * get_TR_binary(r, true) * mm2);
......@@ -1337,7 +1410,7 @@ struct gamete_LV_database : public EM_helpers {
}
return accum;
}
double
compute_2pt_dist(size_t i)
{
......@@ -1370,7 +1443,7 @@ struct gamete_LV_database : public EM_helpers {
return ret;
//*/
}
void
EM_update_distances()
{
......@@ -1396,7 +1469,7 @@ struct gamete_LV_database : public EM_helpers {
EM_map
EM(const std::vector<std::string>& marker_names, double convergence_threshold = 1.e-12, int max_iterations = 100)
EM(const std::vector<std::string>& marker_names, bool dist_if_true_else_r = true, double convergence_threshold = 1.e-12, int max_iterations = 100)
{
double delta;
EM_map ret;
......@@ -1411,12 +1484,25 @@ struct gamete_LV_database : public EM_helpers {
delta = EM_delta();
++ret.n_iterations;
} while (delta > convergence_threshold && ret.n_iterations < max_iterations);
ret.r = em_distances;
ret.distances = em_distances;
for (double& d: ret.distances) {
d = -50. * log(1 - 2. * d);
if (dist_if_true_else_r) {
for (double& d: ret.distances) {
d = -50. * log(1 - 2. * d);
}
}
ret.likelihood = map_likelihood(marker_names, em_distances);
// ret.likelihood = map_likelihood(marker_names, em_distances);
ret.likelihood = EM_forward_likelihood();
// auto sing = em_chain_is_single.begin();
// for (const auto& v: em_forward.back()) {
// if (*sing++) {
// ret.likelihood += log(v.unary.sum());
// } else {
// ret.likelihood += log(v.binary.sum());
// }
// }
ret.converged = delta < convergence_threshold;
ret.delta = delta;
return ret;
}
......
......@@ -571,7 +571,7 @@ void message_queue::run()
#ifdef SPELL_UNSAFE_OUTPUT
#define MSG_ERROR(_msg_expr_, _workaround_expr_) do { std::cerr << _msg_expr_ << std::endl; } while (0)
#define MSG_ERROR(_msg_expr_, _workaround_expr_) do { std::cerr << msg_handler_t::e() << _msg_expr_ << msg_handler_t::n() << std::endl; } while (0)
#define MSG_WARNING(_msg_expr_) do { std::cout << _msg_expr_ << std::endl; } while (0)
#define MSG_INFO(_msg_expr_) do { std::cout << _msg_expr_ << std::endl; } while (0)
#define MSG_QUEUE_FLUSH()
......@@ -706,12 +706,18 @@ struct scoped_indent {
inline bool msg_handler_t::state_t::check(bool fatal)
{
msg_handler_t::scoped_lock_type _(msg_handler_t::mutex);
// MSG_INFO("count = " << count);
if (count > 0) {
cerr() << info() << "[MSG] " << count << " error"
<< (count > 1 ? "s were" : " was")
<< " reported. Suggestions to fix this:" << std::endl;
for (auto& w: workarounds) {
cerr() << info() << " - " << w << normal() << std::endl;
<< " reported.";
if (workarounds.size()) {
cerr() << " Suggestions to fix this:" << std::endl;
for (auto& w: workarounds) {
cerr() << info() << " - " << w << normal() << std::endl;
}
} else {
cerr() << normal() << std::endl;
}
if (fatal) {
cout() << normal() <<"At least one fatal error encountered. Aborting process." << std::endl;
......
......@@ -150,7 +150,8 @@ struct marker_obs_formats {
const nlohmann::json& formats = get_internal_formats_json();
auto it = formats.find(key);
if (it == formats.end()) {
MSG_ERROR("Marker observation format is not defined: " << key, SPELL_STRING("Use one of the predefined formats " << build_all_internal_format_names() << " or add a -mos <format-filename> argument to the commandline."));
MSG_ERROR("Marker observation format is not defined: " << key << ". Use one of the predefined formats " << build_all_internal_format_names() << " or add a -mos <format-filename> argument to the commandline.", "");
// MSG_ERROR("Marker observation format is not defined: " << key, SPELL_STRING("Use one of the predefined formats " << build_all_internal_format_names() << " or add a -mos <format-filename> argument to the commandline."));
return {};
}
return it.value();
......
......@@ -570,14 +570,6 @@ bn_settings_t* bn_settings_t::from_args(int argc, const char** argv)
if (ret->output_mode == 0) {
ret->output_mode = bn_settings_t::OutputPopData;
}
if (ret->output_generations.size() == 0) {
for (const auto& kv: ret->pedigree.generation_names) {
ret->output_generations.emplace_back(kv.second);
}
}
std::sort(ret->output_generations.begin(), ret->output_generations.end());
auto it = std::unique(ret->output_generations.begin(), ret->output_generations.end());
ret->output_generations.resize(it - ret->output_generations.begin());
}
return ret;
......
......@@ -194,7 +194,7 @@ job_registry = {
/*MSG_DEBUG("Pedigree" << std::endl << settings->pedigree);*/
/*MSG_DEBUG("COMPUTING FACTOR GRAPH FOR " << unique_n_alleles[n] << " ALLELES.");*/
/*factor_graph fg(settings->pedigree, unique_n_alleles[n], settings->noise);*/
auto fg = factor_graph_type::from_pedigree(settings->pedigree.items, unique_n_alleles[n], settings->output_mode & bn_settings_t::OutputGametes, settings->input_generations, /*settings->output_generations*/ {});
auto fg = factor_graph_type::from_pedigree(settings->pedigree.items, unique_n_alleles[n], settings->output_mode & bn_settings_t::OutputGametes, settings->input_generations, settings->output_generations);
/*MSG_DEBUG("COMPUTED FACTOR GRAPH" << std::endl << fg);*/
/*fg.finalize();*/
/*fg.save(settings->job_filename("factor-graph", unique_n_alleles[n]));*/
......
......@@ -42,7 +42,9 @@ int SPELL_BAYES_MAIN(int argc, const char** argv)
bn_settings_t* settings = NULL;
try {
settings = bn_settings_t::from_args(argc, argv);
msg_handler_t::check(true);
if (msg_handler_t::check(false)) {
return -1;
}
} catch (file::error& fe) {
MSG_ERROR("An error happened while reading input files. " << fe.what(), "");
return -1;
......@@ -62,6 +64,25 @@ int SPELL_BAYES_MAIN(int argc, const char** argv)
MSG_DEBUG("loaded from " << settings->pedigree_filename);
MSG_DEBUG("" << settings->pedigree);
MSG_DEBUG_DEDENT;
MSG_INFO("Output gen: " << settings->output_generations);
MSG_INFO("settings->output_generations.size = " << settings->output_generations.size());
MSG_INFO("settings->output_mode & OutputGametes = " << (settings->output_mode & bn_settings_t::OutputGametes));
if (settings->output_generations.size() == 0 || (settings->output_mode & bn_settings_t::OutputGametes)) {
settings->output_generations.clear();
settings->output_generations.reserve(settings->pedigree.generations.size());
for (const auto& gen: settings->pedigree.generations) {
if (gen) {
settings->output_generations.emplace_back(gen->name);
}
}
}
MSG_INFO("Output gen: " << settings->output_generations);
std::sort(settings->output_generations.begin(), settings->output_generations.end());
auto it = std::unique(settings->output_generations.begin(), settings->output_generations.end());
settings->output_generations.resize(it - settings->output_generations.begin());
for (const auto& kv: settings->observed_mark) {
settings->marker_observation_specs[kv.second.format_name]
......
......@@ -35,7 +35,7 @@ int SPELL_PEDIGREE_MAIN(int argc, const char** argv)
print_usage();
} else {
pedigree_type ped = read_pedigree(settings->pedigree_filename, settings->csv_sep, settings->max_states);
if (!msg_handler_t::check(false)) {
if (msg_handler_t::check(false)) {
return -1;
}
std::string ped_output;
......
Package: spellmaptools
Version: 1.0
Version: 0.3
Date: 2018-03-05
Title: SpellMapTools
Authors@R: c(person("Damien", "Leroux", role = c("aut", "cre"), email = "damien.leroux@inra.fr"),
......
......@@ -15,7 +15,7 @@ copy_sources_1:
@./cp.py . $(DOT_SRC) Makevars package/src
@./cp.py /usr/include/RWrap '*.h' package/src/include/RWrap
@./cp.py ../../3rd-party json.hpp package/3rd-party
@./cp.py . DESCRIPTION package
@./cp.py . .Rbuildignore DESCRIPTION package
copy_sources_2: .FORCE
@./cp.py ~/include/eigen3/ '*' '*/*' '*/*/*' '*/*/*/*' package/src/include/eigen3
......@@ -49,7 +49,7 @@ package: generate
install: package
+R CMD INSTALL $(TARGET)_1.0.tar.gz
+R CMD INSTALL $(TARGET)_`grep Version DESCRIPTION | sed 's/.* //'`.tar.gz
clean:
......
......@@ -41,11 +41,12 @@ class Spell2PtMatrix;
class SpellMapTools {
private:
gamete_LV_database gamete_LV;
double m_convergence_threshold = 1.e-12;
double m_convergence_threshold = 1.e-6;
int m_max_iterations = 100;
bool m_active = false;
public:
/* observations_specs must have three columns: generation, format, filename */
SpellMapTools(std::string ped_filename, Rwrap::DataFrame observation_specs);
SpellMapTools(std::string ped_filename, Rwrap::DataFrame observation_specs, int mt);
Rwrap::List
SEM(marker_vec order);
Rwrap::List
......@@ -54,12 +55,14 @@ public:
Flips(marker_vec order, int window_size);
Spell2PtMatrix*
LOD2pt(marker_vec rows, marker_vec cols);
Spell2PtMatrix*
R2pt(marker_vec rows, marker_vec cols);
double
map_likelihood(const marker_vec& order, const std::vector<double>& distances)
{ return gamete_LV.map_likelihood(order, distances); }
EM_map
EM(const marker_vec& order)
{ return gamete_LV.EM(order, m_convergence_threshold, m_max_iterations); }
EM(const marker_vec& order, bool dist_if_true_else_r=true)
{ return gamete_LV.EM(order, dist_if_true_else_r, m_convergence_threshold, m_max_iterations); }
// void init_2pt_tr_at_inf() { gamete_LV.init_2pt_tr_at_inf(); }
double twoMarkerLikelihood() { return gamete_LV.twoMarkerLikelihoodAtInf(); }
......@@ -75,7 +78,17 @@ public:
if (t) { std::swap(m_convergence_threshold, t); return t; }
else { return m_convergence_threshold; }
}
bool active_check()
{
if (!m_active) {
MSG_ERROR("This instance is not active. There was a problem during initialization.", "");
return true;
}
return false;
}
bool is_active() { return m_active; }
};
......@@ -86,9 +99,11 @@ private:
std::vector<std::string> rownames, colnames;
std::map<std::string, int> row_indices, col_indices;
std::map<std::pair<std::string, std::string>, double> cache;
std::map<std::pair<std::string, std::string>, double> r_cache;
bool lod_if_true_else_r;
public:
Spell2PtMatrix(SpellMapTools* smt, std::vector<std::string> r, std::vector<std::string> c)
: instance(smt), rownames(r), colnames(c), row_indices(), col_indices(), cache()
: instance(smt), rownames(r), colnames(c), row_indices(), col_indices(), cache(), r_cache(), lod_if_true_else_r(true)
{
for (const auto& m: rownames) {
row_indices.emplace(m, row_indices.size());
......@@ -98,6 +113,12 @@ public:
}
}
void rate() { lod_if_true_else_r = false; }
void lod() { lod_if_true_else_r = true; }
int is_rate() { return (int) !lod_if_true_else_r; }
int is_lod() { return (int) lod_if_true_else_r; }
marker_vec getRownames() { return rownames; }
marker_vec getColnames() { return colnames; }
......@@ -107,14 +128,15 @@ public:
return {(int) rownames.size(), (int) colnames.size()};
}
double get2PtValue(int i, int j)
void
get_value_impl(int i, int j, double& lod, double& r)
{
if (i < 1 || j < 1 || i > rownames.size() || j > colnames.size()) {
return NA_REAL;
lod = r = NA_REAL;
}
--i; --j;
if (rownames[i] == colnames[j]) {
return 0;
lod = r = 0;
}
std::pair<std::string, std::string> key = {rownames[i], colnames[j]};
if (key.first > key.second) {
......@@ -125,19 +147,31 @@ public:
// MSG_INFO("Key " << key.first << ':' << key.second << " not in cache!");
static const std::vector<double> at_worlds_end = {.5};
marker_vec minimap = {rownames[i], colnames[j]};
auto em = instance->EM(minimap);
auto em = instance->EM(minimap, false);
double best = em.likelihood;
r = em.distances[0];
r_cache.emplace(key, r);
// instance->init_2pt_tr_at_inf();
// double inf_ref = instance->map_likelihood(minimap, at_worlds_end);
double inf_ref = instance->twoMarkerLikelihood();
double value = best - inf_ref;
// MSG_INFO("LOD(" << minimap[0] << " … " << minimap[1] << " => d=" << em.distances[0] << " best=" << best << " inf_ref=" << inf_ref << " value=" << value);
cache.emplace(key, value);
return value;
lod = best - inf_ref;
// MSG_INFO("LOD(" << minimap[0] << " … " << minimap[1] << " => d=" << em.distances[0] << " best=" << best << " inf_ref=" << inf_ref << " value=" << lod);
cache.emplace(key, lod);
} else {
// MSG_INFO("Key " << key.first << ':' << key.second << " in cache! " << it->first.first << ':' << it->first.second);
return it->second;
lod = it->second;
r = r_cache[key];
}
}
double get2PtValue(int i, int j)
{
if (!instance->is_active()) {
return NA_REAL;
}
double lod, r;
get_value_impl(i, j, lod, r);
return lod_if_true_else_r ? lod : r;
}
};
......@@ -181,7 +215,7 @@ extern "C" {
SpellMapTools::SpellMapTools(std::string ped_filename, Rwrap::DataFrame observation_specs)
SpellMapTools::SpellMapTools(std::string ped_filename, Rwrap::DataFrame observation_specs, int mt)
: gamete_LV()
{
// MSG_DEBUG(__FILE__ << ':' << __LINE__);
......@@ -214,13 +248,13 @@ SpellMapTools::SpellMapTools(std::string ped_filename, Rwrap::DataFrame observat
// MSG_DEBUG(__FILE__ << ':' << __LINE__);
std::string name = md5;
std::string spell_ped_file = SPELL_STRING(wd << '/' << name << ".cache/" << name << ".spell-pedigree.data");
std::string spell_mark_file = SPELL_STRING(wd << '/' << name << ".cache/gamete.data");
std::time_t spell_ped_t = get_file_date(spell_ped_file.c_str());
std::time_t spell_mark_t = 0;
// MSG_DEBUG(__FILE__ << ':' << __LINE__);
// MSG_INFO("ped_time=" << ped_time);
......@@ -249,20 +283,27 @@ SpellMapTools::SpellMapTools(std::string ped_filename, Rwrap::DataFrame observat
/* Run spell-marker if needed */
if (spell_mark_t < data_time && obs_gen.size() > 0) {
// MSG_DEBUG(__FILE__ << ':' << __LINE__);
std::stringstream out;
// std::stringstream out;
std::vector<std::string> args = {"spell-marker", "-wd", wd, "-n", name, "-Og", "-Op"};
if (mt > 1) {
args.push_back("-mt");
args.push_back(SPELL_STRING(mt));
}
for (size_t i = 0; i < obs_gen.size(); ++i) {
args.push_back("-m");
args.push_back(SPELL_STRING(obs_gen[i] << ':' << obs_format[i]));
args.push_back(obs_filename[i]);
if (out.tellp()) {
out << ',';
}
out << obs_gen[i];
// if (out.tellp()) {
// out << ',';
// }
// out << obs_gen[i];
}
// args.push_back("-o");
// args.push_back(out.str());
if (invoke_spell(SPELL_BAYES_MAIN, args)) {
MSG_ERROR("Aborting spell-map-tools initialization because of errors…", "");
return;
}
args.push_back("-o");
args.push_back(out.str());
invoke_spell(SPELL_BAYES_MAIN, args);
}
// MSG_DEBUG(__FILE__ << ':' << __LINE__);
......@@ -273,6 +314,7 @@ SpellMapTools::SpellMapTools(std::string ped_filename, Rwrap::DataFrame observat
// MSG_DEBUG(__FILE__ << ':' << __LINE__);
}
// MSG_DEBUG(__FILE__ << ':' << __LINE__);
m_active = true;
}
......@@ -286,6 +328,8 @@ map2list(const EM_map& map)
ret.add("likelihood", map.likelihood);
ret.add("n_iterations", map.n_iterations);
ret.add("converged", (int) map.converged);
ret.add("delta", map.delta);
ret.add("r", map.r);
return ret;
}
......@@ -294,14 +338,21 @@ map2list(const EM_map& map)
Rwrap::List
SpellMapTools::SEM(marker_vec order)
{
if (active_check()) {
return {};
}
return map2list(EM(order));
}
Rwrap::List
SpellMapTools::Try(marker_vec order, std::string marker)
{
if (active_check()) {
return {};
}
std::vector<Rwrap::List> map_results;
marker_vec full_order;
full_order.reserve(order.size() + 1);
......@@ -333,6 +384,9 @@ SpellMapTools::Try(marker_vec order, std::string marker)
double
SpellMapTools::Flips(marker_vec order, int window_size)
{
if (active_check()) {
return NA_REAL;
}
std::vector<size_t> window(window_size);
double best = EM(order).likelihood;
double ref = best;
......@@ -387,6 +441,7 @@ SpellMapTools::Flips(marker_vec order, int window_size)
Spell2PtMatrix*
SpellMapTools::LOD2pt(marker_vec row_order, marker_vec col_order)
{
active_check();
return new Spell2PtMatrix(this, row_order, col_order);
}
......@@ -396,13 +451,17 @@ SpellMapTools::LOD2pt(marker_vec row_order, marker_vec col_order)
CLASS(Spell2PtMatrix)
.method(Spell2PtMatrix, get2PtValue).arg("i").arg("j").auto_glue()
.method(Spell2PtMatrix, rate).auto_glue()
.method(Spell2PtMatrix, lod).auto_glue()
.method(Spell2PtMatrix, is_lod).auto_glue()
.method(Spell2PtMatrix, is_rate).auto_glue()
.method(Spell2PtMatrix, getDim).auto_glue()
.method(Spell2PtMatrix, getRownames).auto_glue()
.method(Spell2PtMatrix, getColnames).auto_glue()
;
CLASS(SpellMapTools)
.ctor<std::string, Rwrap::DataFrame>("pedigree_filename", "observation_specs")
.ctor<std::string, Rwrap::DataFrame, int>("pedigree_filename", "observation_specs", "mt")
.method(SpellMapTools, SEM).arg("order").auto_glue()
.method(SpellMapTools, Try).arg("order").arg("marker").auto_glue()
.method(SpellMapTools, Flips).arg("order").arg("window_size").auto_glue()
......
include Makefile.conf
#CXX=clang++ -stdlib=libc++
#CXXARGS=--std=c++11 -Wall -Wno-unused-local-typedefs -DEIGEN_NO_DEPRECATED_WARNING -pthread -DSPELL_UNSAFE_OUTPUT
CXXARGS=--std=c++11 -Wall -DEIGEN_NO_DEPRECATED_WARNING -pthread -DSPELL_UNSAFE_OUTPUT
#CXXARGS=--std=c++14 -Wall -Wno-unused-local-typedefs -DEIGEN_NO_DEPRECATED_WARNING -pthread -DSPELL_UNSAFE_OUTPUT
CXXARGS=--std=c++14 -Wall -DEIGEN_NO_DEPRECATED_WARNING -pthread -DSPELL_UNSAFE_OUTPUT
LD=$(CXX)
LIBS=-rdynamic -lexpat -ldl
VERSION_DEFINES=$(shell git tag | sed 's/\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)/-DVERSION_MAJOR=\\\"\1\\\" -DVERSION_MINOR=\\\"\2\\\" -DVERSION_PATCH=\\\"\3\\\"/')
#VERSION_DEFINES=$(shell git tag | tail -1 | sed 's/\([0-9]*\)[.]\([0-9]*\)[.]\(.*\)/-DVERSION_MAJOR=\\\"\1\\\" -DVERSION_MINOR=\\\"\2\\\" -DVERSION_PATCH=\\\"\3\\\"/')
VERSION_DEFINES='-DVERSION_MAJOR="test" -DVERSION_MINOR="test" -DVERSION_PATCH="2"'
C=$(CXX) $(CXXARGS) $(INC) -DTEST_POLY $(VERSION_DEFINES)
SRC=main.cc cache.cc fast_polynom.cc markov_population.cc ril_properties.cc frag_comp.cc model_manager.cc
#SRC=main.cc cache.cc fast_polynom.cc markov_population.cc ril_properties.cc frag_comp.cc model_manager.cc
SRC=main.cc cache.cc frag_comp.cc model_manager.cc
EXT_SRC=../src/input/read_map.cc ../src/input/read_mark.cc ../src/input/read_trait.cc ../src/outbred.cc ../src/probapop_dtd.cc ../src/input/invoke_probapop.cc ../src/static_data.cc ../src/input/read_settings.cc ../src/input/xml/xml_design.cc ../src/input/xml/xml_format.cc ../src/input/xml/xml_settings.cc ../src/input/ld_matrices.cc ../src/input/pedigree.cc ../src/computations/basic_data.cc ../src/computations/probabilities.cc ../src/computations/model.cc ../src/beta_gamma.cc
#SRC=main.cc fast_polynom.cc ril_properties.cc ../src/input/read_map.cc ../src/outbred.cc ../src/probapop_dtd.cc ../src/input/invoke_probapop.cc ../src/static_data.cc
......@@ -65,7 +67,7 @@ test-coverage: test
.depend: $(SRC) Makefile
g++-4.9 --std=c++11 $(INC) --depend $(SRC) > $@
g++ --std=c++14 $(INC) --depend $(SRC) > $@
$(OBJ):%.o: %.cc $(PCH)
$C -c $< -o $@
......