Skip to content

Commit f1c5e97

Browse files
committed
Version 2.7.5
1 parent fdc599c commit f1c5e97

File tree

5 files changed

+36
-21
lines changed

5 files changed

+36
-21
lines changed

src/graph/constructor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1579,9 +1579,9 @@ void add_var_record(std::vector<VarRecord> & var_records,
15791579
else
15801580
{
15811581
assert(key == "GT_HAPLOTYPE");
1582-
auto const val_ul = std::stoul(val_str);
1583-
ref.anti_events.insert(val_ul);
1584-
// alt.anti_events.insert(-val_ul);
1582+
int const val_ul = std::stol(val_str);
1583+
// ref.anti_events.insert(val_ul);
1584+
alt.anti_events.insert(-val_ul);
15851585
}
15861586
} // for (auto const & val : values)
15871587
} // for (auto const & info : infos)

src/graph/haplotype.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,12 @@ void Haplotype::explain_to_score(std::size_t const pn_index,
505505

506506
#ifndef NDEBUG
507507
// TODO(h2) THE FOLLOWING DOESNT MAKE SENSE
508-
/*assert(!explains.none());
508+
assert(!explains.empty());
509509

510+
/*
510511
if (explains.none())
511512
explains.set(); // Flip 'em all, cause they can all explain this read
512-
*/
513+
*/
513514
#endif // NDEBUG
514515

515516
// std::vector<uint16_t> haplotype_errors = find_with_how_many_errors_haplotypes_explain_the_read(cnum);

src/typer/caller.cpp

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace
5656
{
5757
#ifndef NDEBUG
5858
std::string const debug_read_name = "HISEQ1:33:H9YY4ADXX:1:2110:2792:58362/2";
59-
long debug_event_pos{152195561};
59+
long debug_event_pos{3603668};
6060
char debug_event_type{'X'};
6161
std::size_t debug_event_size{1};
6262
#endif // NDEBUG
@@ -74,6 +74,11 @@ void merge_haplotypes2(std::map<gyper::Event, Thap> & into, std::map<gyper::Even
7474
// Insert any elements from "from" into "into"
7575
for (auto from_it = from.begin(); from_it != from.end(); ++from_it)
7676
{
77+
#ifndef NDEBUG
78+
if (from_it->first.pos == debug_event_pos)
79+
gyper::print_log(gyper::log_severity::info, __HERE__, " var ", from_it->first.to_string());
80+
#endif // NDEBUG
81+
7782
auto insert_p = into.insert(*from_it);
7883

7984
if (insert_p.second)
@@ -82,6 +87,11 @@ void merge_haplotypes2(std::map<gyper::Event, Thap> & into, std::map<gyper::Even
8287
// nothing needs to be done for "ever_together"
8388
// go through all events in the newly inserted "always_together" and remove any that have been seen in into
8489

90+
#ifndef NDEBUG
91+
if (insert_p.first->first.pos == debug_event_pos)
92+
gyper::print_log(gyper::log_severity::info, __HERE__, " new var ", insert_p.first->first.to_string());
93+
#endif // NDEBUG
94+
8595
gyper::HaplotypeInfo & into_hap_info = insert_p.first->second;
8696
auto it = into_hap_info.always_together.begin();
8797

@@ -131,16 +141,20 @@ void merge_haplotypes2(std::map<gyper::Event, Thap> & into, std::map<gyper::Even
131141
}
132142
}
133143

134-
/*
135-
gyper::print_log(gyper::log_severity::info,
136-
__HERE__,
137-
" ",
138-
from_hap_info.always_together.size(),
139-
" ",
140-
into_hap_info.always_together.size(),
141-
" ",
142-
intersection.size());
143-
*/
144+
#ifndef NDEBUG
145+
if (insert_p.first->first.pos == debug_event_pos)
146+
{
147+
gyper::print_log(gyper::log_severity::info, __HERE__, " intersection of ", insert_p.first->first.to_string());
148+
gyper::print_log(gyper::log_severity::info,
149+
__HERE__,
150+
" ",
151+
from_hap_info.always_together.size(),
152+
" ",
153+
into_hap_info.always_together.size(),
154+
" ",
155+
intersection.size());
156+
}
157+
#endif // NDEBUG
144158

145159
insert_p.first->second.always_together = std::move(intersection);
146160
}

test/graph/test_constructor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,9 @@ TEST_CASE("Construct test graph with anti events (chr10)")
530530
}
531531

532532
{
533-
REQUIRE(var_nodes[0].anti_events.size() == 1);
534-
REQUIRE(var_nodes[0].anti_events.count(2) == 1);
535-
REQUIRE(var_nodes[1].anti_events.size() == 0);
533+
REQUIRE(var_nodes[0].anti_events.size() == 0);
534+
REQUIRE(var_nodes[1].anti_events.size() == 1);
535+
REQUIRE(var_nodes[1].anti_events.count(-2) == 1);
536536
REQUIRE(var_nodes[2].anti_events.size() == 0);
537537
REQUIRE(var_nodes[3].anti_events.size() == 0);
538538
}
@@ -553,7 +553,7 @@ TEST_CASE("Construct test graph with anti events (chr11)")
553553

554554
{
555555
REQUIRE(ref_nodes.size() == 2);
556-
REQUIRE(var_nodes.size() == 6);
556+
REQUIRE(var_nodes.size() == 4);
557557
}
558558

559559
Options::instance()->add_all_variants = false;

test/index/test_index.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ TEST_CASE("Test index chr10 with parity event")
431431
REQUIRE(labels[0].variant_id != labels[1].variant_id);
432432

433433
labels = ph_index.get(gyper::to_uint64("AGGGGGGTGGGGGGGGGGGGGGGGGGGGGGGG", 0));
434-
REQUIRE(labels.size() == 2);
434+
REQUIRE(labels.size() == 0);
435435

436436
labels = ph_index.get(gyper::to_uint64("AGGGGGAGTGGGGGGGGGGGGGGGGGGGGGGG", 0));
437437

0 commit comments

Comments
 (0)