Mentions légales du service

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

Record recombinations_ in the Tree (from DnaReplicationReport)

parent 2f01b85a
No related branches found
No related tags found
No related merge requests found
...@@ -315,6 +315,15 @@ void DnaReplicationReport::compute_stats() ...@@ -315,6 +315,15 @@ void DnaReplicationReport::compute_stats()
void DnaReplicationReport::write_to_tree_file(gzFile tree_file) const { void DnaReplicationReport::write_to_tree_file(gzFile tree_file) const {
// Write the mutations and rearrangements undergone during replication // Write the mutations and rearrangements undergone during replication
// Store recombinations
#ifdef __EUKARYOTE
int32_t nb_recomb = nb(RECOMB);
gzwrite(tree_file, &nb_recomb, sizeof(nb_recomb));
for (const auto& recomb : recombinations_) {
recomb->save(tree_file);
}
#endif
// Store HT // Store HT
int32_t nb_HT = nb(H_T); int32_t nb_HT = nb(H_T);
gzwrite(tree_file, &nb_HT, sizeof(nb_HT)); gzwrite(tree_file, &nb_HT, sizeof(nb_HT));
...@@ -377,9 +386,21 @@ void DnaReplicationReport::write_to_tree_file(gzFile tree_file) const { ...@@ -377,9 +386,21 @@ void DnaReplicationReport::write_to_tree_file(gzFile tree_file) const {
} }
void DnaReplicationReport::read_from_tree_file(gzFile tree_file) { void DnaReplicationReport::read_from_tree_file(gzFile tree_file) {
#ifdef __EUKARYOTE
int32_t nb_recomb;
#endif
int32_t nb_rears, nb_muts, nb_HT; int32_t nb_rears, nb_muts, nb_HT;
Mutation* mut = nullptr; Mutation* mut = nullptr;
#ifdef __EUKARYOTE
gzread(tree_file, &nb_recomb, sizeof(nb_recomb));
for (int i = 0 ; i < nb_recomb ; i++) {
mut = Mutation::Load(tree_file);
add_recomb(mut);
delete mut;
}
#endif
gzread(tree_file, &nb_HT, sizeof(nb_HT)); gzread(tree_file, &nb_HT, sizeof(nb_HT));
for (int i = 0 ; i < nb_HT ; i++) { for (int i = 0 ; i < nb_HT ; i++) {
mut = Mutation::Load(tree_file); mut = Mutation::Load(tree_file);
......
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