def dot_alignment(self, seq_field='<STR_LIT>', name_field='<STR_LIT>', uca=None,<EOL>chain='<STR_LIT>', uca_name='<STR_LIT>', as_fasta=False, just_alignment=False):
if uca is None:<EOL><INDENT>uca = self.uca.heavy if chain == '<STR_LIT>' else self.uca.light<EOL><DEDENT>uca.id = '<STR_LIT>'<EOL>if chain == '<STR_LIT>':<EOL><INDENT>sequences = [p.heavy for p in self.heavies if seq_field in p.heavy]<EOL>if name_field != '<STR_LIT>':<EOL><INDENT>uca[name_field] = uca['<STR_LIT>']<EOL><DEDENT>sequences.append(uca)<EOL>seqs = [(s[name_field], s[seq_field]) for s in sequences]<EOL><DEDENT>else:<EOL><INDENT>sequences = [p.light for p in self.lights if seq_field in p.light]<EOL>if name_field != '<STR_LIT>':<EOL><INDENT>uca[name_field] = uca['<STR_LIT>']<EOL><DEDENT>sequences.append(uca)<EOL>seqs = [(s[name_field], s[seq_field]) for s in sequences]<EOL><DEDENT>aln = muscle(seqs)<EOL>g_aln = [a for a in aln if a.id == '<STR_LIT>'][<NUM_LIT:0>]<EOL>dots = [(uca_name, str(g_aln.seq)), ]<EOL>for seq in [a for a in aln if a.id != '<STR_LIT>']:<EOL><INDENT>s_aln = '<STR_LIT>'<EOL>for g, q in zip(str(g_aln.seq), str(seq.seq)):<EOL><INDENT>if g == q == '<STR_LIT:->':<EOL><INDENT>s_aln += '<STR_LIT:->'<EOL><DEDENT>elif g == q:<EOL><INDENT>s_aln += '<STR_LIT:.>'<EOL><DEDENT>else:<EOL><INDENT>s_aln += q<EOL><DEDENT><DEDENT>dots.append((seq.id, s_aln))<EOL><DEDENT>if just_alignment:<EOL><INDENT>return [d[<NUM_LIT:1>] for d in dots]<EOL><DEDENT>name_len = max([len(d[<NUM_LIT:0>]) for d in dots]) + <NUM_LIT:2><EOL>dot_aln = []<EOL>for d in dots:<EOL><INDENT>if as_fasta:<EOL><INDENT>dot_aln.append('<STR_LIT>'.format(d[<NUM_LIT:0>], d[<NUM_LIT:1>]))<EOL><DEDENT>else:<EOL><INDENT>spaces = name_len - len(d[<NUM_LIT:0>])<EOL>dot_aln.append(d[<NUM_LIT:0>] + '<STR_LIT:U+0020>' * spaces + d[<NUM_LIT:1>])<EOL><DEDENT><DEDENT>return '<STR_LIT:\n>'.join(dot_aln)<EOL>
Returns a multiple sequence alignment of all lineage sequence with the UCA
where matches to the UCA are shown as dots and mismatches are shown as the
mismatched residue.

Inputs (optional)
-----------------
seq_field: the sequence field to be used for alignment. Default is 'vdj_nt'.
name_field: field used for the sequence name. Default is 'seq_id'.
chain: either 'heavy' or 'light'. Default is 'heavy'.

Returns
-------
The dot alignment (string)