Skip to content

Commit 6dbf95a

Browse files
authored
Merge branch 'main' into main
2 parents 46f86a9 + 8ed202c commit 6dbf95a

19 files changed

+1856
-380
lines changed

alignment/seqregions.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,11 @@ void cmaple::merge_identicalRACGT_TwoLowers(
415415
}
416416

417417
if (seq1_region.type == TYPE_R) {
418+
auto prev_log_lh = log_lh;
418419
log_lh += (total_blength_1 + total_blength_2) *
419420
(cumulative_rate[end_pos + 1] - cumulative_rate[pos]);
420421
} else {
421-
log_lh += model->diagonal_mut_mat[seq1_region.type] *
422+
log_lh += model->getDiagonalMutationMatrixEntry(seq1_region.type, end_pos) *
422423
(total_blength_1 + total_blength_2);
423424
}
424425
}
@@ -464,11 +465,11 @@ void cmaple::calSiteLhs_identicalRACGT(std::vector<RealNumType>&site_lh_contribu
464465
* (cumulative_rate[i + 1] - cumulative_rate[i]);
465466
}
466467
} else {
467-
log_lh += model->diagonal_mut_mat[seq1_region.type] * total_blength;
468+
log_lh += model->getDiagonalMutationMatrixEntry(seq1_region.type, pos) * total_blength;
468469

469470
// compute site lh contributions
470471
site_lh_contributions[static_cast<std::vector<RealNumType>::size_type>(pos)] +=
471-
model->diagonal_mut_mat[seq1_region.type] * total_blength;
472+
model->getDiagonalMutationMatrixEntry(seq1_region.type, pos) * total_blength;
472473
}
473474
}
474475

0 commit comments

Comments
 (0)