Skip to content

Commit

Permalink
fix vcf site walker failing on hom-ref calls when walking alleles
Browse files Browse the repository at this point in the history
  • Loading branch information
ssadedin committed Jun 18, 2024
1 parent 3bd3284 commit 79db1db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/groovy/gngs/VCFSiteWalker.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ class VCFSiteWalker {
@CompileStatic
private void processByAllele(List<VariantContext> variants, @ClosureParams(value=FromString, options='java.util.List<htsjdk.variant.variantcontext.VariantContext>') Closure callback) {
Map<String, List<VariantContext>> alleles = variants.groupBy { VariantContext ctx ->
ctx.getReference().baseString + '/' + ctx.getAlternateAllele(0).baseString
if(ctx.isVariant())
ctx.getReference().baseString + '/' + ctx.getAlternateAllele(0).baseString
else
ctx.getReference().baseString + '/' + ctx.getReference().baseString
}

alleles.each { String bases, List<VariantContext> alleleVariants ->
Expand Down

0 comments on commit 79db1db

Please sign in to comment.