Commit 0810321c authored by Damien Leroux's avatar Damien Leroux
Browse files

WIP.

parent 88f6b676
......@@ -320,7 +320,7 @@ struct population_marker_observation {
marker_data observations;
std::map<char, VectorXb> observation_vectors;
void compute_observation_vectors(
const impl::generation_rs* g,
const marker_observation_spec& obs_spec);
......
......@@ -37,6 +37,8 @@ struct settings_t {
std::string map_filename;
std::vector<chromosome> map;
/*format_specification_t* marker_observation_specs;*/
enum observation_type_t { Geno, Line };
observation_type_t observation_type;
std::map<std::string, marker_observation_spec> marker_observation_specs;
std::vector<std::string> marker_observation_specs_filenames;
std::map<std::string, population> populations;
......@@ -98,6 +100,7 @@ struct settings_t {
: notes()
, design(0)
, map_filename(), map()
, observation_type(ObsLine)
, marker_observation_specs()
, populations()
, working_set()
......@@ -264,6 +267,20 @@ struct format_specification_t {
};
inline std::ostream& operator << (std::ostream& os, settings_t::observation_type_t ot)
{
switch (ot) {
case settings_t::observation_type_t::Line:
os << "line";
break;
case settings_t::observation_type_t::Geno:
os << "geno";
break;
};
return os;
}
std::ostream& operator << (std::ostream&, const settings_t&);
namespace read_data {
......
......@@ -7,7 +7,7 @@
#include "labelled_matrix.h"
#include "cache2.h"
#include "model.h"
#include "computations/basic_data.h"
#include "computations/probabilities.h"
#include <regex>
......@@ -416,6 +416,47 @@ arguments = {
exit(0);
SAFE_IGNORE_CALLBACK_ARGS;
}},
{{"-Dpop", "--dump-POP"},
{},
"[DEBUG] Dump parental origin probabilities and exit",
true,
{},
[](CALLBACK_ARGS)
{
ensure(target);
active_settings = target;
msg_handler_t::check(true);
active_settings->finalize();
active_settings->set_title("Checking the validity of the configuration");
if (!active_settings->sanity_check()) {
exit(-1);
}
msg_handler_t::check(true);
locus_key lk;
Eigen::IOFormat fmt(StreamPrecision, DontAlignCols, "\t", "\n", "", "", "", "");
for (const chromosome& c: active_settings->map) {
auto loci = compute_steps(c.condensed.marker_locus, target->step);
for (const auto& kv: active_settings->populations) {
const auto& pop = kv.second;
context_key ck(new context_key_struc(&pop, &c, loci));
auto vck = as_value(ck);
collection<multi_generation_observations>
vmgo = make_collection<Disk>(population_marker_obs,
vck, range<int>(0, ck->pop->size(), 1));
collection<locus_probabilities_type>
alp = make_collection<Disk>(locus_probabilities,
vck, as_value(lk), vmgo, as_value(ck->loci));
OUT("CHROMOSOME " << c.name << " POPULATION " << kv.first << std::endl);
int i = 0;
for (const auto& pm: alp) {
OUT('#' << (++i) << std::endl << pm << std::endl);
}
}
}
exit(0);
SAFE_IGNORE_CALLBACK_ARGS;
}},
{{"-Dstfopom", "--dump-stfopom"},
{"gen", "order"},
"[DEBUG] Dump ST(fo)POM",
......@@ -648,6 +689,17 @@ arguments = {
SAFE_IGNORE_CALLBACK_ARGS;
}},
{{"-ot", "--observation-type"},
{"type"},
"Specify how to interpret the observation data.\nIf type is 'line'" /* TODO */,
false,
{&settings_t::observation_type},
[](CALLBACK_ARGS)
{
/* TODO */
SAFE_IGNORE_CALLBACK_ARGS;
}},
{{"-mos", "--marker-observations-spec"},
{"path"},
"Path to the marker observation specification file",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment