Trees | Indices | Help |
---|
|
Interfaces.AlignmentIterator --+ | FastaM10Iterator
Alignment iterator for the FASTA tool's pairwise alignment output. This is for reading the pairwise alignments output by Bill Pearson's FASTA program when called with the -m 10 command line option for machine readable output. For more details about the FASTA tools, see the website http://fasta.bioch.virginia.edu/ and the paper: W.R. Pearson & D.J. Lipman PNAS (1988) 85:2444-2448 This class is intended to be used via the Bio.AlignIO.parse() function by specifying the format as "fasta-m10" as shown in the following code: from Bio import AlignIO handle = ... for a in AlignIO.parse(handle, "fasta-m10") : assert len(a.get_all_seqs()) == 2, "Should be pairwise!" print "Alignment length %i" % a.get_alignment_length() for record in a : print record.seq, record.name, record.id Note that this is not a full blown parser for all the information in the FASTA output - for example, most of the header and all of the footer is ignored. Also, the alignments are not batched according to the input queries. Also note that there can be up to about 30 letters of flanking region included in the raw FASTA output as contextual information. This is NOT part of the alignment itself, and is not included in the resulting Alignment objects returned.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
Reads from the handle to construct and return the next alignment. This returns the pairwise alignment of query and match/library sequences as an Alignment object containing two rows.
|
Helper function for the main parsing code. Skips over the file header region. |
Helper function for the main parsing code. Skips over the free format query header, extracting the tagged parameters. If there are no hits for the current query, it is skipped entirely. |
Helper function for the main parsing code. To get the actual pairwise alignment sequences, we must first translate the un-gapped sequence based coordinates into positions in the gapped sequence (which may have a flanking region shown using leading - characters). To date, I have never seen any trailing flanking region shown in the m10 file, but the following code should also cope with that. Note that this code seems to work fine even when the "sq_offset" entries are prsent as a result of using the -X command line option. |
Helper function for the main parsing code. line - supply line just read from the handle containing the start of the tagged section. dictionary - where to record the tagged values Returns a string, the first line following the tagged section. |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Sep 15 09:26:30 2008 | http://epydoc.sourceforge.net |