private void loadReference() throws Exception{
if(referenceAvailable){
// prepare reader
FastaReader reader = new FastaReader(referenceFile);
// init buffer
StringBuilder referenceBuffer = new StringBuilder();
numberOfReferenceContigs = 0;
Fasta contig;
while((contig=reader.read())!=null){
referenceBuffer.append(contig.getSeq().toUpperCase());
numberOfReferenceContigs++;
}
reader.close();
reference = referenceBuffer.toString().getBytes();
referenceSize = reference.length;
if(reference.length!=locator.getTotalSize()){
throw new Exception("invalid reference file, number of nucleotides differs");
}