code: def add_alignment(self, ref_seq, annotation) -> Annotation:
          seq_features = get_seqs(ref_seq)
          annoated_align = {}
          allele = ref_seq.description.split(",")[0]
          locus = allele.split("*")[0].split("-")[1]
          for feat in seq_features:
              if feat in annotation.annotation:
                  if isinstance(annotation.annotation[feat], DBSeq):
                      seq_len = len(str(annotation.annotation[feat]))
                      ref_len = len(seq_features[feat])
                  else:
                      seq_len = len(str(annotation.annotation[feat].seq))
                      ref_len = len(seq_features[feat])
                  if seq_len == ref_len:
                      seq = list(annotation.annotation[feat].seq)
                      gaps = self.refdata.annoated_alignments[locus][allele][feat]['Gaps']
                      if self.verbose and self.verbosity > 0:
                          self.logger.info(self.logname + " Lengths match for " + feat)
                          self.logger.info(self.logname + " Gaps at " + feat)
                          self.logger.info(self.logname +
                                           "-".join([",".join([str(s)
                                                               for s in g])
                                                     for g in gaps]))
                      for i in range(0, len(gaps)):
                          for j in gaps[i]:
                              loc = j
                              seq.insert(loc, '-')
                      nseq = ''.join(seq)
                      annoated_align.update({feat: nseq})
                  else:
                      in_seq = str(annotation.annotation[feat].seq)
                      ref_seq = self.refdata.annoated_alignments[locus][allele][feat]['Seq']
                      alignment = pairwise2.align.globalxx(in_seq, ref_seq)
                      if self.verbose and self.verbosity > 0:
                          self.logger.info(self.logname + " Align2 -> in_seq != ref_len " + feat)
                          self.logger.info(self.logname + " " + str(len(in_seq)) + " == " + str(ref_len))
                      annoated_align.update({feat: alignment[0][0]})
              else:
                  nseq = ''.join(list(repeat('-', len(seq_features[feat]))))
                  annoated_align.update({feat: nseq})
          annotation.aligned = annoated_align
          return annotation