Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
IndexOutOfBounds thrown when saving gVCF with no likelihoods #1673
If saving a blocked gVCF where the non-reference blocks do not have likelihoods attached, we get the following error:
This tracks back to some code in htsjdk that doesn't check if an array-type FORMAT field is empty before writing it out, and which indexes directly into the 0th element, which isn't great. That said, what's happening on our side, is that the conditional that checks whether we are at a gVCF record when the genotypeLikelihood field is unset is wrong, and is setting the PL on the genotype builder to an empty array.