Fixed variance calculation for sequences with ambiguous nucleotides.