[Bioperl-l] automation of translation based on alignment

Chris Fields cjfields at illinois.edu
Mon Mar 22 12:58:00 UTC 2010


On Mar 22, 2010, at 12:30 AM, Ross KK Leung wrote:

> Dear Chris,
> 
> It seems that Bioperl is "clever" enough to "rectify" my start and stop by
> reversing the order.
> 
> e.g.
> start = 2300
> stop = 1600
> 
> It will reverse back to 1600 and then 2300.
> What else to tell that I'm now working on a circular genome?

Reverse it where, the alignment or the feature?  The svn version of BioPerl, for alignments, retains strand information (this was a bug that was fixed).  For features, start is always less than end, with directionality determined by strand.  For a circular genome, the feature is split across the origin, as you have seen in the original sequence you posted:

...
    gene            join(2307..3215,1..1623)
                    /gene="P"
...


This would be represented as a Bio::Location::SplitLocation in the feature; it would joined based on that order if $seq->is_circular() is true (or at least it should).  In cases like this, the safe bet is to call spliced_seq() to get the joined sequence in all cases, then call translate() to get the protein sequence.

chris



More information about the Bioperl-l mailing list