[Bioperl-l] "SeqIO-like" interface for alignment objects

Peter Schattner schattner@alum.swarthmore.edu
Tue, 05 Sep 2000 13:26:18 -0700


Hello all,

Last month I made a proposal
(http://bioperl.org/pipermail/bioperl-l/2000-August/001224.html)
for a perl interface to a good multiple sequence alignment program
(eg clustalw).  In the proposed module, the "alignment-factory object"
would return a reference to
a new alignment in the form of a SimpleAlign object.

In response to the proposal I received feedback (especially from Ewan -
the maintainer of the
SimpleAlign module), that the SimpleAlign module needed to be updated.
Specifically,
he recommended that a more modular form of IO for alignments (in the
spirit of the SeqIO
package) would be highly desirable and that any new module using
multiple alignments should be
based on such an architecture.

So before embarking on my "multiple alignment wrapper module", I am
proposing to write an "AlignIO.pm"
module which would strip out the IO capabilities of SimpleAlign.pm and
convert them to a more
"SeqIO-like" interface.

I have attached a brief outline describing the capabilities and usage of
the proposed module.

I would appreciate any feedback re the usefulness, structure, usage,
interaction with other
modules, etc. of this proposed object.

Thanks

Peter Schattner

============
AlignIO.pm: a proposed bioperl module for input-output of multiple
sequence alignments.

An "alignment stream IO object" is created by passing to the constructor
the name of a file
containing one or more alignment(s) and the file format.  Once the
stream has been created,
one can call a method to create SimpleAlign object(s) from the file
data. Similarly an
output IO stream object can be defined to output the alignment data to a
file in some other
format: eg

    use Bio::AlignIO;
    use Bio::SimpleAlign;

    $in  = Bio::AlignIO->new(-file => "inputfilename" , '-format' =>
'MSF');
    $out = Bio::AlignIO->new(-file => ">outputfilename" , '-format' =>
'fasta');
    # note: we quote -format to keep older perl's from complaining.

    while ( my $aln = $in->next_aln() ) {
 $out->write_aln($aln);
    }

In the future, I would envision this module might be extended so that
the created objects
would also be able to execute the (non-IO) methods of the UnivAln.pm
module