Skip to content

Commit

Permalink
Bugfix to SplitVcfBySamples and immutable lists
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Mar 20, 2024
1 parent 4be5c76 commit e67f88f
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ private void prepareOutputsForBatches(List<String> samples, VCFHeader header) {
if (minAllowableInFinalVcf != null) {
int lastIdx = batches.size() - 1;
if (batches.get(lastIdx).size() < minAllowableInFinalVcf) {
batches.get(lastIdx - 1).addAll(batches.get(lastIdx));
List<String> toUpdate = new ArrayList<>(batches.get(lastIdx - 1));
toUpdate.addAll(batches.get(lastIdx));

batches.set(lastIdx - 1, new UnmodifiableList<>(toUpdate));
batches.remove(lastIdx);
}
}
Expand Down

0 comments on commit e67f88f

Please sign in to comment.