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

Ewan Birney birney@ebi.ac.uk
Wed, 6 Sep 2000 08:09:03 +0100 (GMT)

On Tue, 5 Sep 2000, Peter Schattner wrote:

> 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

This looks *great*. (I hope you have cvs access...).

print out SeqIO.pm to see how that works, but otherwise it should be
reasonably straight forward to get this to work. 

This will make SimpleAlign a far smaller module (removing the format
stuff) and encourage us to look at merging simplealign/univalign or
probably rewriting both to give us a better system...

> ============
> 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
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l

Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420