Skip to content

Commit 65bb035

Browse files
committed
Bugfix for lofreq vcf merge
1 parent c1a9f76 commit 65bb035

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

SequenceAnalysis/src/org/labkey/sequenceanalysis/run/analysis/MergeLoFreqVcfHandler.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ public void processFilesRemote(List<SequenceOutputFile> inputFiles, JobContext c
346346
if (vc.getStart() < siteDef._start)
347347
{
348348
ctx.getLogger().info("Variant start less than site def, probably indicates an upstream deletion: " + siteDef._start + " / " + vc.getStart() + " / " + so.getFile().getPath());
349+
continue;
349350
}
350351
else if (vc.getStart() > siteDef._start)
351352
{
@@ -410,6 +411,11 @@ else if (vc.getStart() > siteDef._start)
410411
toWrite.add(refs.stream().map(Allele::getBaseString).collect(Collectors.joining(";")));
411412
List<String> alleleSets = new ArrayList<>();
412413
refs.forEach(r -> {
414+
if (!siteDef._encounteredAlleles.containsKey(r))
415+
{
416+
throw new IllegalArgumentException("Reference not found: " + r.getBaseString() + ", at site: " + siteDef._start + ", allowable: " + refs.stream().map(Allele::getBaseString).collect(Collectors.joining(",")));
417+
}
418+
413419
alleleSets.add(siteDef._encounteredAlleles.get(r).stream().map(Allele::getBaseString).collect(Collectors.joining(",")));
414420
});
415421
toWrite.add(alleleSets.stream().collect(Collectors.joining(";")));

0 commit comments

Comments
 (0)