Skip to content

Commit 1f0e29d

Browse files
authored
Merge pull request #4316 from vgteam/pad-fallback-alignments
Pad out fallback pair alignments
2 parents 5bc8f8a + 870339b commit 1f0e29d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/minimizer_mapper.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,14 @@ pair<vector<Alignment>, vector<Alignment>> MinimizerMapper::map_paired(Alignment
13641364

13651365
// Map single-ended and bail
13661366
std::array<vector<Alignment>, 2> mapped_pair = {map(aln1), map(aln2)};
1367+
// We have no way to know which mapping ought to go with each other, so pad out
1368+
// the shorter list with copies of the first item, so we can report all mappings
1369+
// we got.
1370+
for (size_t index = 0; index < 2; index++) {
1371+
while (mapped_pair[index].size() < mapped_pair[1 - index].size()) {
1372+
mapped_pair[index].push_back(mapped_pair[index].front());
1373+
}
1374+
}
13671375
pair_all(mapped_pair);
13681376
return {std::move(mapped_pair[0]), std::move(mapped_pair[1])};
13691377
}

0 commit comments

Comments
 (0)