Skip to content

Commit

Permalink
ignore aw hap
Browse files Browse the repository at this point in the history
  • Loading branch information
hannespetur committed Jun 21, 2022
1 parent f1c5e97 commit ddc58a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
11 changes: 1 addition & 10 deletions src/graph/constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@ void add_var_record(std::vector<VarRecord> & var_records,
continue;
}

if (key != "GT_ANTI_HAPLOTYPE" && key != "GT_HAPLOTYPE")
if (key != "GT_ANTI_HAPLOTYPE")
continue;

seqan::CharString value = EQ_SIGN_POS < static_cast<int>(seqan::length(info))
Expand All @@ -1573,16 +1573,7 @@ void add_var_record(std::vector<VarRecord> & var_records,
std::string val_str = seqan::toCString(val);

if (key == "GT_ANTI_HAPLOTYPE")
{
alt.anti_events.insert(std::stoul(val_str));
}
else
{
assert(key == "GT_HAPLOTYPE");
int const val_ul = std::stol(val_str);
// ref.anti_events.insert(val_ul);
alt.anti_events.insert(-val_ul);
}
} // for (auto const & val : values)
} // for (auto const & info : infos)
} // if (var.alts.size() == 1)
Expand Down
5 changes: 2 additions & 3 deletions test/graph/test_constructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,7 @@ TEST_CASE("Construct test graph with anti events (chr10)")

{
REQUIRE(var_nodes[0].anti_events.size() == 0);
REQUIRE(var_nodes[1].anti_events.size() == 1);
REQUIRE(var_nodes[1].anti_events.count(-2) == 1);
REQUIRE(var_nodes[1].anti_events.size() == 0);
REQUIRE(var_nodes[2].anti_events.size() == 0);
REQUIRE(var_nodes[3].anti_events.size() == 0);
}
Expand All @@ -553,7 +552,7 @@ TEST_CASE("Construct test graph with anti events (chr11)")

{
REQUIRE(ref_nodes.size() == 2);
REQUIRE(var_nodes.size() == 4);
REQUIRE(var_nodes.size() == 6);
}

Options::instance()->add_all_variants = false;
Expand Down
2 changes: 1 addition & 1 deletion test/index/test_index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ TEST_CASE("Test index chr10 with parity event")
REQUIRE(labels[0].variant_id != labels[1].variant_id);

labels = ph_index.get(gyper::to_uint64("AGGGGGGTGGGGGGGGGGGGGGGGGGGGGGGG", 0));
REQUIRE(labels.size() == 0);
REQUIRE(labels.size() == 2);

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

Expand Down

0 comments on commit ddc58a7

Please sign in to comment.