Trees | Indices | Help |
---|
|
1 """ 2 For conversion between different formats for representing alignments (OBSOLETE). 3 4 This module is considered obsolete and likely to be deprecated. Please use 5 Bio.AlignIO instead for reading and writing alignments in different file 6 formats. 7 8 classes: 9 FormatConverter 10 """ 11 12 # biopython 13 from Bio.Fasta.FastaAlign import FastaAlignment 14 from Bio.Clustalw import ClustalAlignment 15 1618 """Convert between different alignment representation formats. 19 20 The basic idea behind the converter is that it takes a given format, 21 converts it into the base Alignment class, and then can return an object 22 in any other supported format with the info from the basal alignment. 23 24 Supported formats are: 25 o Clustal format (*.aln) 26 o Fasta format (*.fasta) 27 """6229 """Initialize a converter with a given object. 30 31 Arguments: 32 o to_convert - The class which we are going to be converting. 33 """ 34 self.orig_format = to_convert 35 36 self._base_alphabet, self._base_records = self._get_base_info()3739 """Retrieve all of the basal (ie Generic.Alignment) info. 40 41 The idea is that this info is present in all of the classes and 42 this is the information that will be retained in a conversion. 43 Format specific information will be lost. 44 """ 45 return self.orig_format._alphabet, self.orig_format._records4648 """Convert the current info into a FastaAlignment object. 49 """ 50 return_format = FastaAlignment(self._base_alphabet) 51 return_format._records = self._base_records 52 53 return return_format5456 """Convert the current info into a ClustalAlignment object. 57 """ 58 return_format = ClustalAlignment(self._base_alphabet) 59 return_format._records = self._base_records 60 61 return return_format
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Dec 25 10:44:31 2008 | http://epydoc.sourceforge.net |