51
51
=head2 Reporting Bugs
53
53
Report bugs to the Bioperl bug tracking system to help us keep track
54
the bugs and their resolution.
55
Bug reports can be submitted via email or the web:
54
the bugs and their resolution. Bug reports can be submitted via the
57
bioperl-bugs@bio.perl.org
58
http://bugzilla.bioperl.org/
57
http://bugzilla.open-bio.org/
60
59
=head1 AUTHORS - Allen Day
120
118
my $line = $self->_readline;
121
119
$self->throw("This doesn't look like a MAF file. First line should start with ##maf, but it was: ".$line)
122
unless $line =~ /^##maf/;
120
unless $line =~ /^##maf/;
123
121
$seen_header = 1;
126
my $aln = Bio::SimpleAlign->new(-source => 'maf');
129
while(my $line = $self->_readline()){
124
my $aln = Bio::SimpleAlign->new(-source => 'maf');
127
while(my $line = $self->_readline()){
130
128
$aline = $line if $line =~ /^a/;
131
129
push @slines, $line if $line =~ /^s /;
132
130
last if $line !~ /\S/;
136
return undef unless $aline;
138
my($kvs) = $aline =~ /^a\s+(.+)$/;
139
my @kvs = split /\s+/, $kvs if $kvs;
141
foreach my $kv (@kvs){
142
my($k,$v) = $kv =~ /(.+)=(.+)/;
146
$aln->score($kv{score});
148
foreach my $sline (@slines){
134
return unless $aline;
136
my($kvs) = $aline =~ /^a\s+(.+)$/;
137
my @kvs = split /\s+/, $kvs if $kvs;
139
foreach my $kv (@kvs){
140
my($k,$v) = $kv =~ /(.+)=(.+)/;
144
$aln->score($kv{score});
146
foreach my $sline (@slines){
149
147
my($s,$src,$start,$size,$strand,$srcsize,$text) =
152
my $seq = new Bio::LocatableSeq('-seq' => $text,
155
'-end' => $start + $size,
149
# adjust coordinates to be one-based inclusive
151
my $seq = new Bio::LocatableSeq('-seq' => $text,
154
'-end' => $start + $size - 1,
155
'-strand' => $strand,
157
157
$aln->add_seq($seq);