final int haplotypeSize,
final int numPrefBases) {
LinkedHashMap<Allele,Haplotype> haplotypeMap = new LinkedHashMap<Allele,Haplotype>();
Allele refAllele = null;
for (Allele a:alleleList) {
if (a.isReference()) {
refAllele = a;
break;
}
}
if (refAllele == null)
throw new ReviewedGATKException("BUG: no ref alleles in input to makeHaplotypeListfrom Alleles at loc: "+ startPos);
final byte[] refBases = ref.getBases();
final int startIdxInReference = 1 + startPos - numPrefBases - ref.getWindow().getStart();
final String basesBeforeVariant = new String(Arrays.copyOfRange(refBases, startIdxInReference, startIdxInReference + numPrefBases));
// protect against long events that overrun available reference context
final int startAfter = Math.min(startIdxInReference + numPrefBases + refAllele.getBases().length - 1, refBases.length);
final String basesAfterVariant = new String(Arrays.copyOfRange(refBases, startAfter, refBases.length));
// Create location for all haplotypes
final int startLoc = ref.getWindow().getStart() + startIdxInReference;
final int stopLoc = startLoc + haplotypeSize-1;