code: def mask_sequence(seq, gaps):
      
      seq = [i.upper() for i in seq]
      for gap in gaps:
          for i in range(gap[0] - 1, gap[1]):
              seq[i] = seq[i].lower()
      return ''.join(seq)
docs: mask (make lower case) regions of sequence found in gaps between model alignments