1 """
2 Code to deal with alignments written in Fasta format (DEPRECATED).
3
4 This module is considered obsolete and has been deprecated. It will be
5 removed in a future release of Biopython. Please use Bio.AlignIO instead
6 for reading and writing alignments in FASTA format.
7
8 This mostly just uses the regular Fasta parsing stuff written by Jeff
9 to deal with all of the input and output formats.
10
11 functions:
12 o parse_file()
13
14 classes:
15 FastaAlignment"""
16
17 import os
18
19
20 from Bio.Align.Generic import Alignment
21 from Bio import Alphabet
22 from Bio.Alphabet import IUPAC
23 from Bio import Fasta
24
58
60 """Work with the Fasta Alignment format.
61
62 The fasta alignment format is basically the same as the regular ol'
63 Fasta format we know and love, except the sequences have gaps
64 (represented by -'s).
65 """
68
70 """Print out a fasta version of the alignment info."""
71 return_string = ''
72 for item in self._records:
73 new_f_record = Fasta.Record()
74 new_f_record.title = item.description
75 new_f_record.sequence = item.seq.data
76
77 return_string = return_string + str(new_f_record) + os.linesep + os.linesep
78
79
80 return return_string.rstrip() + os.linesep
81