Skip to content

Commit

Permalink
Merge pull request #3298 from vgteam/deconstruct
Browse files Browse the repository at this point in the history
choose alt when possible, even if ref more frequent
  • Loading branch information
glennhickey authored May 24, 2021
2 parents 99cbb47 + ed77640 commit e0b25dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/deconstructor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,12 @@ pair<vector<int>, bool> Deconstructor::choose_traversals(const string& sample_na
// count the number of times each allele comes up in a traversal
vector<int> allele_frequencies(*max_element(trav_to_allele.begin(), trav_to_allele.end()) + 1, 0);
for (auto trav : travs) {
++allele_frequencies[trav_to_allele.at(trav)];
// we always want to choose alt over ref when possible in sorting logic below, so
// cap ref frequency at 1
int allele = trav_to_allele.at(trav);
if (allele > 0 || allele_frequencies[allele] == 0) {
++allele_frequencies[allele];
}
}
// sort on frquency
function<bool(int, int)> comp = [&] (int trav1, int trav2) {
Expand Down

2 comments on commit e0b25dc

@adamnovak
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vg CI tests complete for merge to master. View the full report here.

16 tests passed, 0 tests failed and 0 tests skipped in 11764 seconds

@adamnovak
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vg CI tests complete for branch v1.33.0. View the full report here.

16 tests passed, 0 tests failed and 0 tests skipped in 11757 seconds

Please sign in to comment.