Masks gaps from simulated alignments according to a template