[Bioperl-l] printing UnivAlgn

Peter Schattner schattner@alum.mit.edu
Fri, 15 Dec 2000 16:55:23 -0800


Murad Nayal wrote:

> Hello,
>
> I can not find a straightforward way to get a SimpleAlgn from a
> UnivAlgn. Why would you want a SimpleAlgn you may ask. well, because
> UnivAlgn seems limited in the number of output formats possible (only
> fasta and raw, neither is optimal in printing alignments for visual
> inspection). This seems to still be true in 0.7. also, AlignIO only
> takes SimpleAlgn (is that a bug or a 'feature'?).
>
> so I suppose the questions are
> 1- how do you get a SimpleAln from UnivAln (short of saving UnivAln to a
> file in fasta format and reading it back again in SimpleAln, which by
> the way does not seems to work smoothly?
> 2- how do you pretty print a UnivAlgn (say clustalw format)?
>
> thanks for the help.

Unfortunately there currently is no straightforward way to convert between
SimpleAlign and UnivAln objects.  This is neither a "feature" nor a bug.
Rather an unfortunate historical consequence of the fact that the two
modules were developed independently.

In developing AlignIO.pm, I chose to use SimpleAlign for the alignment
objects because it was easier and met all of my needs at the time.  As I've
later needed a few features from UnivAln, I've added them to SimpleAlign
recently.  If you need some specific feature of UnivAln, let me know and if
it's not too complicated I'll see about adding it to the methods of
SimpleAlign.  As for converting all of UnivAln's capabilities to
SimpleAlign format, it's a bear I don't want to take on at this point, but
if some else wants to, that would be fine (then UnivAln could just
disappear).

In the interim, both UnivAln and SimpleAlign (via AlignIO) read and write
fasta formatted alignment files so you can always convert between the two
alignment objects that way (it's kludgy but it should work)

- Peter