how many times can you spot the letter t in:
bio.searchio support for exonerate output formats.
this module adds support for handling exonerate outputs. exonerate is a generic tool for pairwise sequence comparison that allows you to align sequences using several different models.
although model testing were not exhaustive, exonerateio should be able to cope with all exonerate models. please file a bug report if you stumble upon an unparseable file.
on exonerate, these output formats are not exclusive to one another. for example, you may have both plain text and vulgar output in the same file. exonerateio can only handle one of these at a time, however. if you have a file containing both plain text and vulgar lines, for example, you have to pick either ‘exonerate-text’ or ‘exonerate-vulgar’ to parse it.
due to the cigar format specification, many features of the alignments such as introns or frameshifts may be collapsed into a single feature (in this case, they are labelled ‘d’ for ‘deletion’). the parser does not attempt to guess whether the d label it encounters is a real deletion or a collapsed feature. as such, parsing or indexing using ‘exonerate-cigar’ may yield different results compared to ‘exonerate-text’ or ‘exonerate-vulgar’.
the plain text output / c4 alignment is the output triggered by the ‘–showalignemnt’ flag. compared to the two other output formats, this format contains the most information, having the complete query and hit sequences of the alignment.
exonerateio utilizes the hspfragment model quite extensively to deal with non- ungapped alignments. for any single hspfragment, if exonerateio sees an intron, a ner block, or a frameshift, it will break the fragment into two hspfragment objects and adjust each of their start and end coordinate appropriately.
you may notice that exonerate always uses the three letter amino acid codes to display protein sequences. if the protein itself is part of the query sequence, such as in the protein2dna model, exonerateio will transform the protein sequence into using one letter codes. this is because the seqrecord objects that store the sequences are designed for single-letter sequences only. if exonerate also outputs the underlying nucleotide sequence, it will be saved into an aln_annotation entry as a list of triplets.
if the protein sequence is not part of the actual alignment, such as in the est2genome or genome2genome models, exonerateio will keep the three letter codes and store them as aln_annotation entries. in these cases, the hit and query sequences may be used directly as seqrecord objects as they are one-letter nucleotide codes. the three-letter protein sequences are then stored as entries in the aln_annotation dictionary.
here you can see that for both query and hit introns, the coordinates in each tuple is always (start, end) where start <= end. but when you compare each tuple to the next, the coordinates decrease. this is an indication that both the query and hit sequences lie on the minus strand. exonerate outputs minus strand results in a decreasing manner; the start coordinate is always bigger than the end coordinate. exonerateio preserves the fragment ordering as a whole, but uses its own standard to store an individual fragment’s start and end coordinates.
you may also notice that the third tuple in query_inter_ranges is (198, 198), two exact same numbers. this means that the query sequence does not have any gaps at that position. the gap is only present in the hit sequence, where we see that the third tuple contains (208677, 386123), a gap of about 177k bases.
here you can see that the alignment as a whole has three frameshifts. the first one occurs in the query sequence, after the first fragment (1 -> 2 shift), the second one occurs in the hit sequence, after the second fragment (1 -> 3 shift), and the last one also occurs in the hit sequence, before the last fragment (3 -> 1 shift).
there are other default hsp properties that you can use to ease your workflow. please refer to the hsp object documentation for more details.
the vulgar format provides a compact way of representing alignments created by exonerate. in general, it contains the same information as the plain text output except for the ‘model’ information and the actual sequences themselves. you can expect that the coordinates obtained from using ‘exonerate-text’ and ‘exonerate-vulgar’ to be the same. both formats also creates hspfragment using the same triggers: introns, ner blocks, and/or frameshifts.
the cigar format provides an even more compact representation of exonerate alignments. however, this comes with a cost of losing information. in the cigar format, for example, introns are treated as simple deletions. this makes it impossible for the parser to distinguish between simple deletions or intron regions. as such, ‘exonerate-cigar’ may produce different sets of coordinates and fragments compared to ‘exonerate-vulgar’ or ‘exonerate-text’.
user
The text includes 433 "t"s in total.
assistant