Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e8541cc8 authored by LUISELLI Juliette's avatar LUISELLI Juliette
Browse files

actually writing the pop stats during the simulation

parent 4ac06a66
No related branches found
No related tags found
No related merge requests found
...@@ -782,8 +782,14 @@ void ExpManager_7::setup_individuals(double w_max, double selection_pressure) { ...@@ -782,8 +782,14 @@ void ExpManager_7::setup_individuals(double w_max, double selection_pressure) {
previous_individuals[indiv_id] = current_individuals[indiv_id]; previous_individuals[indiv_id] = current_individuals[indiv_id];
} }
#ifdef __EUKARYOTE
stats_best = new Stats_7(this, AeTime::time(), true, nullptr, true);
stats_mean = new Stats_7(this, AeTime::time(), false, nullptr, true);
write_stat(true);
#else
stats_best = new Stats_7(this, AeTime::time(), true); stats_best = new Stats_7(this, AeTime::time(), true);
write_stat(); write_stat();
#endif
} }
void ExpManager_7::run_a_step(double w_max, double selection_pressure) { void ExpManager_7::run_a_step(double w_max, double selection_pressure) {
...@@ -1334,7 +1340,11 @@ for (size_t index = 0; index < mutant_list_.size(); index++) { ...@@ -1334,7 +1340,11 @@ for (size_t index = 0; index < mutant_list_.size(); index++) {
} }
} }
#ifdef __EUKARYOTE
write_stat(true);
#else
write_stat(); write_stat();
#endif
} }
#endif #endif
...@@ -1606,6 +1616,37 @@ void ExpManager_7::write_stat(bool non_coding) { ...@@ -1606,6 +1616,37 @@ void ExpManager_7::write_stat(bool non_coding) {
#endif #endif
stats_best->write(best_indiv,non_coding); stats_best->write(best_indiv,non_coding);
#ifdef __EUKARYOTE
stats_mean->reinit(AeTime::time());
for (int indiv_id = 0; indiv_id < exp_m_->nb_indivs(); indiv_id++) {
auto indiv = previous_individuals[indiv_id];
for (auto chrsm : {A, B}) {
indiv->annotated_chromosome_[chrsm]->reset_stats();
for (Rna_7* rna : indiv->annotated_chromosome_[chrsm]->rnas()) {
if (rna != nullptr) {
if (rna->is_coding_)
indiv->annotated_chromosome_[chrsm]->nb_coding_RNAs++;
else
indiv->annotated_chromosome_[chrsm]->nb_non_coding_RNAs++;
}
}
for (const auto& prot : indiv->annotated_chromosome_[chrsm]->proteins()) {
if (prot != nullptr) {
if (prot->is_functional) {
indiv->annotated_chromosome_[chrsm]->nb_func_genes++;
} else {
indiv->annotated_chromosome_[chrsm]->nb_non_func_genes++;
}
}
}
}
}
stats_mean->compute_average(non_coding);
stats_mean->write_average();
#endif
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment