@@ -564,6 +564,7 @@ auto updateLHwithModel(const ModelBase* model,
564
564
RealNumType tot = 0 ;
565
565
if (total_blength > 0 ) // TODO: avoid
566
566
{
567
+
567
568
const RealNumType* mutation_mat_row = model->getMutationMatrixRow (i, pos);
568
569
tot += dotProduct<num_states>(&(prior)[0 ], mutation_mat_row);
569
570
@@ -630,7 +631,6 @@ void merge_N_O(const RealNumType lower_plength,
630
631
total_blength = reg_o.plength_observation2node +
631
632
(lower_plength > 0 ? lower_plength : 0 );
632
633
}
633
-
634
634
auto new_lh =
635
635
cmaple::make_unique<SeqRegion::LHType>(); // = new RealNumType[num_states];
636
636
RealNumType sum_lh = updateLHwithModel<num_states>(model, *reg_o.likelihood ,
@@ -765,7 +765,7 @@ void merge_RACGT_O(const SeqRegion& seq2_region,
765
765
assert (seq2_region.type == TYPE_O);
766
766
assert (model);
767
767
assert (aln);
768
-
768
+
769
769
RealNumType sum_new_lh = updateMultLHwithMat<num_states>(
770
770
model->getMutationMatrix (end_pos), *(seq2_region.likelihood ), new_lh, total_blength_2);
771
771
@@ -1043,7 +1043,7 @@ auto merge_O_O_TwoLowers(const SeqRegion& seq2_region,
1043
1043
assert (seq2_region.type == TYPE_O);
1044
1044
assert (model);
1045
1045
assert (aln);
1046
-
1046
+
1047
1047
RealNumType sum_lh = updateMultLHwithMat<num_states>(
1048
1048
model->getMutationMatrix (end_pos), *seq2_region.likelihood , new_lh, total_blength_2);
1049
1049
@@ -1179,7 +1179,7 @@ auto merge_RACGT_O_TwoLowers(const SeqRegion& seq2_region,
1179
1179
assert (seq2_region.type == TYPE_O);
1180
1180
assert (model);
1181
1181
assert (aln);
1182
-
1182
+
1183
1183
RealNumType sum_lh = updateMultLHwithMat<num_states>(
1184
1184
model->getMutationMatrix (end_pos), *(seq2_region.likelihood ), new_lh, total_blength_2);
1185
1185
@@ -1363,7 +1363,7 @@ auto merge_notN_notN_TwoLowers(const SeqRegion& seq1_region,
1363
1363
aln, model, threshold_prob, log_lh, merged_regions, return_log_lh);
1364
1364
return ret;
1365
1365
}
1366
-
1366
+
1367
1367
// no error
1368
1368
return true ;
1369
1369
}
@@ -1447,12 +1447,6 @@ RealNumType SeqRegions::mergeTwoLowers(
1447
1447
}
1448
1448
// neither seq1_entry nor seq2_entry = N
1449
1449
else {
1450
- // RealNumType* vec = (&seq1_region->likelihood)[0];
1451
- /* if(!seq1_region->likelihood.get()) {
1452
- std::cout << "[mergeTwoLowers] Likelihood pointer: " << seq1_region->likelihood.get() << std::endl;
1453
- return MIN_NEGATIVE;
1454
- }*/
1455
- // std::cout << "[mergeTwoLowers] Prior: " << vec[0] << " " << vec[1] << " " << vec[2] << " " << vec[3] << std::endl;
1456
1450
if (!merge_notN_notN_TwoLowers<num_states>(
1457
1451
*seq1_region, *seq2_region, plength1, plength2, end_pos, pos, aln,
1458
1452
model, cumulative_rate, threshold_prob, log_lh, merged_regions,
@@ -1480,7 +1474,6 @@ RealNumType SeqRegions::mergeTwoLowers(
1480
1474
max_elements); // ensure we did the correct reserve, otherwise it was
1481
1475
// a pessimization
1482
1476
#endif
1483
-
1484
1477
return log_lh;
1485
1478
}
1486
1479
@@ -1505,7 +1498,7 @@ auto SeqRegions::computeAbsoluteLhAtRoot(
1505
1498
for (StateType i = 0 ; i < num_states; ++i) {
1506
1499
log_lh += model->getRootLogFreq (i) *
1507
1500
(cumulative_base[static_cast <size_t >(region.position ) + 1 ][i] -
1508
- cumulative_base[static_cast <size_t >(start_pos)][i]);
1501
+ cumulative_base[static_cast <size_t >(start_pos)][i]);
1509
1502
}
1510
1503
}
1511
1504
// type ACGT
@@ -1737,7 +1730,7 @@ bool calSiteLhs_O_O(std::vector<RealNumType>& site_lh_contributions,
1737
1730
assert (seq2_region.type == TYPE_O);
1738
1731
assert (aln);
1739
1732
assert (model);
1740
-
1733
+
1741
1734
RealNumType sum_lh = updateMultLHwithMat<num_states>(
1742
1735
model->getMutationMatrix (end_pos), *seq2_region.likelihood , new_lh, total_blength_2);
1743
1736
@@ -1869,7 +1862,6 @@ bool calSiteLhs_RACGT_O(std::vector<RealNumType>& site_lh_contributions,
1869
1862
assert (seq2_region.type == TYPE_O);
1870
1863
assert (aln);
1871
1864
assert (model);
1872
-
1873
1865
RealNumType sum_lh = updateMultLHwithMat<num_states>(
1874
1866
model->getMutationMatrix (end_pos), *(seq2_region.likelihood ), new_lh, total_blength_2);
1875
1867
0 commit comments