Two passes thru BAM file.