~ubuntu-branches/ubuntu/trusty/bioperl/trusty-proposed

« back to all changes in this revision

Viewing changes to Bio/Search/Result/BlastPullResult.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2011-06-17 13:51:18 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20110617135118-xgpxhaanue57cwqs
Tags: 1.6.901-1
* New upstream release.
* Point debian/watch to search.cpan.org.
* Build using dh and overrides:
  - Use Debhelper 8 (debian/rules, debian/control).
  - Simplified debian/rules.
* Split into libbio-perl-perl, as discussed with the Debian Perl team.
  (debian/control, debian/bioperl.install, debian libbio-perl-perl.install)
* debian/control:
  - Incremented Standards-Version to reflect conformance with Policy 3.9.2.
    No other changes needed.
  - Vcs-Browser URL made redirectable to viewvc.
  - Removed useless ‘svn’ in the Vcs-Svn URL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: BlastPullResult.pm 16123 2009-09-17 12:57:27Z cjfields $
2
1
#
3
2
# BioPerl module for Bio::Search::Result::BlastPullResult
4
3
#
60
59
of the bugs and their resolution. Bug reports can be submitted via the
61
60
web:
62
61
 
63
 
  http://bugzilla.open-bio.org/
 
62
  https://redmine.open-bio.org/projects/bioperl/
64
63
 
65
64
=head1 AUTHOR - Sendu Bala
66
65
 
112
111
        
113
112
        $self->_setup(@args);
114
113
        
115
 
        foreach my $field (qw( header hit_table hsp_table alignments next_model models query_length stats_and_params)) {
 
114
        foreach my $field (qw( header hit_table hsp_table alignments next_model
 
115
        models query_length stats_and_params)) {
116
116
                $self->_fields->{$field} = undef;
117
117
        }
118
118
        
119
119
        $self->_dependencies( { ( query_name => 'header',
120
120
                              query_accession => 'header',
121
121
                              query_description => 'header',
122
 
                                                          query_length => 'header',
 
122
                            query_length => 'header',
123
123
                              hit_table => 'header',
124
 
                                                          num_hits => 'hit_table',
125
 
                                                          no_hits_found => 'hit_table' ) } );
 
124
                            num_hits => 'hit_table',
 
125
                            no_hits_found => 'hit_table' ) } );
126
126
    
127
127
    return $self;
128
128
}
135
135
        my $self = shift;
136
136
        $self->_chunk_seek(0);
137
137
        my $header = $self->_get_chunk_by_end("Value\n");
 
138
        if (!$header) {
 
139
            $header = $self->_get_chunk_by_end("***** No hits found ******\n");
 
140
            $self->{_no_hits_found} = 1;
 
141
        }
 
142
        $self->throw("Invalid header returned") unless $header;
138
143
        $self->{_after_header} = $self->_chunk_tell;
139
144
        
140
145
        ($self->_fields->{query_name}) = $header =~ /^\s*(\S+)/;
159
164
 
160
165
sub _discover_hit_table {
161
166
        my $self = shift;
162
 
        
163
167
        $self->_chunk_seek($self->{_after_header});
 
168
        
164
169
        my $table = $self->_get_chunk_by_end("\n>");
165
170
        
166
 
        unless ($table) {
 
171
        if (!$table && !$self->{_no_hits_found}) {
167
172
                # no alignments, presumably; hit table comprises the remainder of this
168
173
                # result
169
174
                while (my $line = $self->_get_chunk_by_nol(1)) {
171
176
                }
172
177
        }
173
178
    
174
 
    $table ||= '';
175
 
    
 
179
        $table ||= '';
 
180
        
176
181
        $self->{_after_hit_table} = $self->_chunk_tell;
177
182
        
178
183
        my $evalue_cutoff = $self->get_field('evalue_cutoff');
223
228
        #*** needs to inherit piped_behaviour, and we need to deal with _sequential
224
229
        #    ourselves
225
230
        $self->_fields->{next_hit} = Bio::Search::Hit::BlastPullHit->new(-parent => $self,
226
 
                                                                                                                                        -chunk => [$self->chunk, $start, $end],
227
 
                                                                                                                                        -hit_data => $hit_row);
 
231
                                                                -chunk => [$self->chunk, $start, $end],
 
232
                                                                -hit_data => $hit_row);
228
233
        
229
234
        $self->{_next_hit_index}++;
230
235