Skip to content

Commit

Permalink
Drop empty numeric values when indexing VCF (#292)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber authored Nov 15, 2023
1 parent 93ad1c7 commit 61a47cb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ else if (line.getCountType() == VCFHeaderLineCount.INTEGER || line.getCountType(
if (valueStr.contains("|")) {
try {
if (clazz == Double.class) {
return Arrays.stream(valueStr.split("\\|")).map(Double::parseDouble).map(clazz::cast).collect(Collectors.toSet());
return Arrays.stream(valueStr.split("\\|")).filter(x -> !x.isEmpty()).map(Double::parseDouble).map(clazz::cast).collect(Collectors.toSet());
} else if (clazz == Integer.class) {
return Arrays.stream(valueStr.split("\\|")).map(Integer::parseInt).map(clazz::cast).collect(Collectors.toSet());
return Arrays.stream(valueStr.split("\\|")).filter(x -> !x.isEmpty()).map(Integer::parseInt).map(clazz::cast).collect(Collectors.toSet());
}

// should never reach this
Expand Down

0 comments on commit 61a47cb

Please # to comment.