int SNPBamProcessor::get_haplotype(BamTools::BamAlignment& aln){ if (!aln.HasTag(HAPLOTYPE_TAG)) return -1; uint8_t haplotype; if (!aln.GetTag(HAPLOTYPE_TAG, haplotype)){ char type; aln.GetTagType(HAPLOTYPE_TAG, type); printErrorAndDie("Failed to extract haplotype tag"); } assert(haplotype == 1 || haplotype == 2); return (int)haplotype; }