2 # BioPerl module for Bio::AlignIO::prodom
4 # based on the Bio::SeqIO::prodom module
5 # by Ewan Birney <birney@ebi.ac.uk>
6 # and Lincoln Stein <lstein@cshl.org>
8 # and the SimpleAlign.pm module of Ewan Birney
10 # Copyright Peter Schattner
12 # You may distribute this module under the same terms as perl itself
15 # POD documentation - main docs before the code
19 Bio::AlignIO::prodom - prodom sequence input/output stream
23 Do not use this module directly. Use it via the L<Bio::AlignIO> class.
27 This object can transform L<Bio::Align::AlignI> objects to and from prodom flat
34 Please direct usage questions or support issues to the mailing list:
36 I<bioperl-l@bioperl.org>
38 rather than to the module maintainer directly. Many experienced and
39 reponsive experts will be able look at the problem and quickly
40 address it. Please include a thorough description of the problem
41 with code and data examples if at all possible.
45 Report bugs to the Bioperl bug tracking system to help us keep track
46 the bugs and their resolution. Bug reports can be submitted via the
49 https://github.com/bioperl/bioperl-live/issues
51 =head1 AUTHORS - Peter Schattner
53 Email: schattner@alum.mit.edu
58 The rest of the documentation details each of the object
59 methods. Internal methods are usually preceded with a _
63 # Let the code begin...
65 package Bio
::AlignIO
::prodom
;
70 use base
qw(Bio::AlignIO);
75 Usage : $aln = $stream->next_aln()
76 Function: returns the next alignment in the stream.
77 Returns : L<Bio::Align::AlignI> object
85 my ($acc, $fake_id, $start, $end, $seq, $add, %names);
87 my $aln = Bio
::SimpleAlign
->new(-source
=> 'prodom');
89 while( $entry = $self->_readline) {
91 if ($entry =~ /^AC\s+(\S+)\s*$/) { #ps 9/12/00
94 elsif ($entry =~ /^AL\s+(\S+)\|(\S+)\s+(\d+)\s+(\d+)\s+\S+\s+(\S+)\s*$/){ #ps 9/12/00
96 $fake_id=$2; # Accessions have _species appended
101 $names{'fake_id'} = $fake_id;
103 $add = Bio
::LocatableSeq
->new('-seq' => $seq,
107 '-alphabet' => $self->alphabet,
112 elsif ($entry =~ /^CO/) {
113 # the consensus line marks the end of the alignment part of the entry
118 return $aln if $aln->num_sequences;
127 Usage : $stream->write_aln(@aln)
128 Function: writes the $aln object into the stream in prodom format ###Not yet implemented!###
129 Returns : 1 for success and 0 for error
130 Args : L<Bio::Align::AlignI> object
136 my ($self,@aln) = @_;
137 $self->throw_not_implemented();