/** * Create the SAM writer, given the constituent parts accrued. * @return Newly minted SAM file writer. */ public SamReader build() { if( samFile == null ) throw new ReviewedGATKException( "Filename for output sam file must be supplied."); if( validationStringency == null ) throw new ReviewedGATKException( "Header for output sam file must be supplied."); return SamReaderFactory .makeDefault() .referenceSequence(this.getReferenceFile()) .validationStringency(validationStringency) .open(samFile); } }