diff --git a/src/libaevol/7/Dna_7.cpp b/src/libaevol/7/Dna_7.cpp index 33084f827d0bb267522b03213e06662f8deb566a..b4b928a33a4a8ab3cd75736cc4f4effc26b8f51c 100644 --- a/src/libaevol/7/Dna_7.cpp +++ b/src/libaevol/7/Dna_7.cpp @@ -237,7 +237,11 @@ Mutation* Dna_7::do_switch(size_type pos // Look for potential new promoters containing the switched base if (length() >= PROM_SIZE) + #ifdef __EUKARYOTE + ann_chrsm_->promoter_list().look_for_new_promoters_around(*this, pos, pos + 1); + #else ann_chrsm_->promoter_list().look_for_new_promoters_around(*this, pos, Utils::mod(pos + 1, length())); + #endif #ifdef BASE_2 return new PointMutation(pos); @@ -247,6 +251,13 @@ Mutation* Dna_7::do_switch(size_type pos } Mutation* Dna_7::do_small_insertion(size_type pos, int16_t nb_insert, char* seq) { + size_type end_look; + #ifdef __EUKARYOTE + end_look = std::max(length_, pos + nb_insert); + #else + end_look = Utils::mod(pos + nb_insert, length_); + #endif + // Remove the promoters that will be broken ann_chrsm_->promoter_list().remove_promoters_around(pos, length_); @@ -264,7 +275,7 @@ Mutation* Dna_7::do_small_insertion(size_type pos, int16_t nb_insert, char* seq) } else { ann_chrsm_->promoter_list().move_all_promoters_after(pos, nb_insert, length_); - ann_chrsm_->promoter_list().look_for_new_promoters_around(*this, pos, Utils::mod(pos + nb_insert, length_)); + ann_chrsm_->promoter_list().look_for_new_promoters_around(*this, pos, end_look); } } @@ -298,6 +309,10 @@ Mutation* Dna_7::do_small_deletion(size_type pos, int16_t nb_del) { } } else { // the deletion contains the origin of replication + #ifdef __EUKARYOTE + printf("Deleting across position 0 : not permitted in linear chromosomes"); + assert(false); + #endif // Do the deletion int32_t nb_del_at_pos_0 = nb_del - length() + pos; @@ -413,6 +428,11 @@ Mutation* Dna_7::do_duplication(size_type pos_1, size_type pos_2, size_type pos_ } Mutation* Dna_7::do_translocation(size_type pos_1, size_type pos_2, size_type pos_3, size_type pos_4, bool invert) { + #ifdef __EUKARYOTE + printf("Code not tested with translocation in eukaryote. Are you sure ?"); + assert(false); + #endif + auto pos_min = std::min(pos_1, std::min(pos_2, std::min(pos_3, pos_4))); if (not invert) { @@ -463,6 +483,10 @@ Mutation* Dna_7::do_inversion(size_type pos_1, size_type pos_2) { // pos_2 <-' // + #ifdef __EUKARYOTE + assert(pos_1 <= pos_2); + #endif + if (length_ == 1) { printf("*** genome of size 1 ; inversion not done *** \n"); @@ -509,6 +533,10 @@ Mutation* Dna_7::do_inversion(size_type pos_1, size_type pos_2) { Mutation* Dna_7::do_deletion(size_type pos_1, size_type pos_2) { + #ifdef __EUKARYOTE + assert(pos_1 <= pos_2); + #endif + // Delete segment going from pos_1 (included) to pos_2 (excluded) if (length_ == 1) {