main.cc 1.22 KB
Newer Older
damien's avatar
damien committed
1
2
3
4
5
#include "error.h"
#include "geno_matrix.h"
#include "bayes/output.h"
#include "map-likelihood/cli.h"

6
7
8
9
10
#ifndef SPELL_MAP_MAIN
#  define SPELL_MAP_MAIN main
#endif

int SPELL_MAP_MAIN(int argc, const char** argv)
damien's avatar
damien committed
11
12
13
14
15
{
    gamete_LV_database gamete_LV;
    auto settings = mapqa_settings_t::from_args(argc, argv);
    
    if (!settings) {
16
        print_usage_pedigree();
damien's avatar
damien committed
17
18
19
20
21
22
23
24
        return -1;
    }
    {
        ifile gam(MESSAGE(settings->work_directory << "/" << settings->name << ".cache/gamete.data"));
        rw_base() (gam, gamete_LV);
    }
    MSG_DEBUG("Have gamete_LV");
    MSG_DEBUG(gamete_LV.data);
25
26
    MSG_DEBUG("Marker order: " << settings->group.raw.marker_name);
    MSG_DEBUG("Distances: " << settings->group.raw.marker_locus);
damien's avatar
damien committed
27
28
29
    
    const auto& locvec = settings->group.raw.marker_locus;
    const auto& nvec = settings->group.raw.marker_name;
30
31
32
33
34
35
36
37
//     double lh = gamete_LV.map_likelihood(nvec, locvec);
//     MSG_DEBUG("Computed likelihood (log): " << lh);
//     MSG_DEBUG("Computed likelihood (log10): " << (lh / log(10.)));
    
    
    auto map = gamete_LV.EM(settings->group.raw.marker_name);
    MSG_DEBUG("n_iter " << map.n_iterations);
    MSG_DEBUG("distances: " << map.distances);
damien's avatar
damien committed
38
39
40
41
42

    return 0;
}

#include "output_impl.h"