static_data.cc 4.33 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* Spell-QTL  Software suite for the QTL analysis of modern datasets.
 * Copyright (C) 2016,2017  Damien Leroux <damien.leroux@inra.fr>, Sylvain Jasson <sylvain.jasson@inra.fr>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

Damien Leroux's avatar
Damien Leroux committed
18
#include "error.h"
19
#include "input.h"
20
/*#include "generation_rs.h"*/
Damien Leroux's avatar
Damien Leroux committed
21
#include "settings.h"
22
#include "cache2.h"
23
#include "geno_matrix.h"
24
#include "file.h"
25
#include "output_impl.h"
26
27

size_t file::open_count = 3;  /* stdin, stdout, stderr */
28
29
std::map<std::string, size_t> file::debug_open_files;
std::mutex file::dof_mutex;
30
31
32
33
34
35
36
37

#if 0
const algebraic_genotype algebraic_genotype::null = {{{0, 0}, {0, 0}}, algebraic_genotype::Type::Null, {0, 0, {0}}};

const polynom rs_polynom::r_poly = {0, 1};
const polynom rs_polynom::s_poly = {1, -1};
#endif

38
int RIL_ORDER = 10;
39
int MAGIC8_ORDER = 10;
40

41
#if 0
42
43
44
45
fast_polynom fast_polynom::zero = 0;
fast_polynom fast_polynom::one = 0;
fast_polynom fast_polynom::r = 0;
fast_polynom fast_polynom::s = 0;
46
fast_polynom fast_polynom::infinity = 0;
47
48
49
50
51

const algebraic_genotype algebraic_genotype::null = {{{0, 0}, {0, 0}}, algebraic_genotype::Type::Null, fast_polynom::zero};

auto& reg = impl::polynom_tables::registry(); /* acts as init */

52
53
#endif

54
55
56
57
msg_handler_t::lock_type msg_handler_t::mutex;

settings_t* active_settings = NULL;

58
59
std::thread::id settings_t::main_thread = std::this_thread::get_id();

60
61
62
63
64
65
66
67
namespace model_print {
    int precision = 4;
    std::string field_sep = "  ";
    std::string section_hsep = " | ";
    char section_vsep = '-';
    std::string section_csep = "-+-";
}

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

label_type empty = {GAMETE_EMPTY, GAMETE_EMPTY};

geno_matrix
    gamete = {
        "generic_gamete",
        Gamete,
        {{GAMETE_L, GAMETE_EMPTY}, {GAMETE_R, GAMETE_EMPTY}},
        (MatrixXd(2, 2) <<
         -1,  1,
          1, -1).finished(),
        /* BEWARE these matrices (p and p_inv) SHOULD be * 1/sqrt(2) */
        (MatrixXd(2, 2) <<
         P_NORM_FACTOR,  P_NORM_FACTOR,
         P_NORM_FACTOR, -P_NORM_FACTOR).finished(),
        (MatrixXd(2, 2) <<
         P_NORM_FACTOR,  P_NORM_FACTOR,
         P_NORM_FACTOR, -P_NORM_FACTOR).finished(),
        (MatrixXd(2, 1) << 0, -2).finished(),
        (VectorXd(2) << .5, .5).finished(),
        (MatrixXd(2, 2) <<
         1, 0,
         0, 1).finished(),
        (MatrixXd(2, 2) <<
         1, 0,
         0, 1).finished(),
#ifdef WITH_OVERLUMPING
        {},
            /*{{{GAMETE_L, GAMETE_L}, {GAMETE_R, GAMETE_R}}, {{0, 0}, {1, 1}}},*/
            /*{{{GAMETE_L, GAMETE_R}, {GAMETE_R, GAMETE_L}}, {{0, 1}, {1, 0}}}*/
            /*symmetry_group_type().insert({permutation_type::anti_identity(2), letter_permutation_type{}})*/
        /*},*/
        {}
#endif

    },
    doubling_gamete = {
        "doubling_gamete",
        DoublingGamete,
        {{GAMETE_L, GAMETE_L}, {GAMETE_R, GAMETE_R}},
        (MatrixXd(2, 2) <<
         -1,  1,
          1, -1).finished(),
        (MatrixXd(2, 2) <<
         P_NORM_FACTOR,  P_NORM_FACTOR,
         P_NORM_FACTOR, -P_NORM_FACTOR).finished(),
        (MatrixXd(2, 2) <<
         P_NORM_FACTOR,  P_NORM_FACTOR,
         P_NORM_FACTOR, -P_NORM_FACTOR).finished(),
        (MatrixXd(2, 1) << 0, -2).finished(),
        (VectorXd(2) << .5, .5).finished(),
        (MatrixXd(2, 2) <<
         1, 0,
         0, 1).finished(),
        (MatrixXd(2, 2) <<
         1, 0,
         0, 1).finished(),
#ifdef WITH_OVERLUMPING
        {},
            /*{{{GAMETE_L, GAMETE_L}, {GAMETE_R, GAMETE_R}}, {{0, 1}, {1, 0}}}*/
            /*{{{0, 1}, {1, 0}}}*/
            /*symmetry_group_type().insert({permutation_type::identity(2), letter_permutation_type{}})*/
        /*},*/
        {}
#endif
    };

geno_matrix
    selfing_gamete = kronecker(gamete, gamete);


139
140
/*std::vector<progress_display::progress_item> progress_display::items;*/
/*std::mutex progress_display::mutex;*/