| Summary | Included libraries | Package variables | Synopsis | Description | General documentation | Methods |
# Bio::Search::Iteration::IterationI objects cannot be
# instantiated since this module defines a pure interface.
# Given an object that implements the
# Bio::Search::Iteration::IterationI interface,
# you can do the following things with it:
# First, open up a SearchIO stream
use Bio::SearchIO;
my $file = shift or die "Usage: $0 \n";
my $in = new Bio::SearchIO(-format => 'blast',
-file => $file # comment out this line to read STDIN
);
# Iterate over all results in the input stream
while (my $result = $in->next_result) {
printf "Result #%d: %s\n", $in->result_count, $result->to_string;
printf "Total Iterations: %d\n", $result->num_iterations();
# Iterate over all iterations and process old and new hits
# separately.
while( my $it = $result->next_iteration) {
printf "\nIteration %d\n", $it->number;
printf "Converged: %d\n", $it->converged;
# Print out the hits not found in previous iteration
printf "New hits: %d\n", $it->num_hits_new;
while( my $hit = $it->next_hit_new ) {
printf " %s, Expect=%g\n", $hit->name, $hit->expect;
}
# Print out the hits found in previous iteration
printf "Old hits: %d\n", $it->num_hits_old;
while( my $hit = $it->next_hit_old ) {
printf " %s, Expect=%g\n", $hit->name, $hit->expect;
}
}
printf "%s\n\n", '-' x 50;
}
printf "Total Reports processed: %d: %s\n", $in->result_count;
__END__
# NOTE: The following functionality is just proposed
# (does not yet exist but might, given sufficient hew and cry):
# Zero-in on the new hits found in last iteration.
# By default, iteration() returns the last one.
my $last_iteration = $result->iteration();
while( my $hit = $last_iteration->next_hit) {
# Do something with new hit...
}
# Get the first iteration
my $first_iteration = $result->iteration(1);
All hits
(A)
_______________|_________________
| |
New hits Old hits
(B) (C)
_________|________ _______|_________
| | | |
Below Above Below Above
threshold threshold threshold threshold
(D) (E) (F) (G)
_________|___________
| |
Occurred in a Occurred in a
previous iteration previous iteration
below threshold above threshold
(H) (I)
Notes: The term threshold in the diagram and descriptions below| number | Description | Code |
| converged | Description | Code |
| next_hit | Description | Code |
| next_hit_new | Description | Code |
| next_hit_old | Description | Code |
| num_hits | Description | Code |
| num_hits_new | Description | Code |
| num_hits_old | Description | Code |
| hits | Description | Code |
| newhits | Description | Code |
| oldhits | Description | Code |
| newhits_below_threshold | Description | Code |
| oldhits_below_threshold | Description | Code |
| oldhits_newly_below_threshold | Description | Code |
| oldhits_not_below_threshold | Description | Code |
| newhits_not_below_threshold | Description | Code |
| hits_below_threshold | Description | Code |
| add_hit | Description | Code |
| get_hit | Description | Code |
| number | code | next | Top |
Title : number
Usage : $it_number = $iteration->number();
Purpose : returns the number of the iteration (a.k.a "round")
within the Result.
Returns : integer
Args : [optional] integer to set the number of the iteration |
| converged | code | prev | next | Top |
Title : converged Usage : $it_converged = $iteration->converged(); Purpose : Indicates whether or not the iteration has converged Returns : boolean Args : [optional] boolean value to set the converged of the iteration |
| next_hit | code | prev | next | Top |
Title : next_hit
Usage : while( $hit = $iteration->next_hit( [$found_again]) ) { ... }
Purpose : Iterates through all of the HitI objects
including new hits and old hits found in a previous iteration
and both below and above the inclusion threshold.
Corresponds to subset A in the "Classification of Hits"
documentation section of this module.
Returns : A Bio::Search::Hit::HitI object or undef if there are no more.
Hits will be returned in the order in which they occur in the report
unless otherwise specified.
Args : none
See Also: hits, Classification of Hitsnext_hit() iterates through all hits, including the new ones for this iteration and those found in previous iterations. You can interrogate each hit using Bio::Search::Hit::HitI::found_again to determine whether it is new or old. To get just the new hits, use next_hit_new. To get just the old hits, use next_hit_old. |
| next_hit_new | code | prev | next | Top |
Title : next_hit_new
Usage : while( $hit = $iteration->next_hit_new() ) { ... }
Purpose : Iterates through all newly found hits (did not occur in a
previous iteration) and are either below or above the inclusion threshold.
Corresponds to subset B in the "Classification of Hits"
documentation section of this module.
Returns : A Bio::Search::Hit::HitI object or undef if there are no more.
Hits will be returned in the order in which they occur in the report
unless otherwise specified.
Args : none
See Also: next_hit, next_hit_old, newhits, Classification of Hits |
| next_hit_old | code | prev | next | Top |
Title : next_hit_old
Usage : while( $hit = $iteration->next_hit_old() ) { ... }
Purpose : Iterates through the Hit objects representing just the
hits that have been found in a previous iteration, whether
below or above the inclusion threshold.
Corresponds to subset C in the "Classification of Hits"
documentation section of this module.
Returns : A Bio::Search::Hit::HitI object or undef if there are no more.
Hits will be returned in the order in which they occur in the report
unless otherwise specified.
Args : none
See Also: next_hit, next_hit_old, oldhits, Classification of Hits |
| num_hits | code | prev | next | Top |
Title : num_hits
Usage : my $hitcount_total = $iteration->num_hits
Purpose : Returns the total number of hits for this query result, including new and old
below and above inclusion threshold.
Returns : integer
Args : none
See Also: num_hits_new, num_hits_old, Classification of Hits |
| num_hits_new | code | prev | next | Top |
Title : num_hits_new
Usage : my $hitcount_new = $result->num_hits_new;
: my $hitcount_new_below_thresh = $result->num_hits_new( 1 );
Purpose : Returns the number of new hits in this iteration that were not
found in a previous iteration and are either below or above the
the inclusion threshold.
Corresponds to subset B in the "Classification of Hits"
documentation section of this module.
Returns : integer
Args : (optional) boolean, true if you want to get a count of just the new hits
that are below the inclusion threshold.
See Also: num_hits, num_hits_old, Classification of Hits |
| num_hits_old | code | prev | next | Top |
Title : num_hits_old
Usage : my $hitcount_old = $result->num_hits_old;
: my $hitcount_old_below_thresh = $result->num_hits_old( 1 );
Purpose : Returns the number of new hits in this iteration that were
found in a previous iteration and are either below or above the
the inclusion threshold.
Corresponds to subset C in the "Classification of Hits"
documentation section of this module.
Returns : integer
Args : (optional) boolean, true if you want to get a count of just the old hits
that are below the inclusion threshold.
See Also: num_hits, num_hits_new, Classification of Hits |
| hits | code | prev | next | Top |
Title : hits
Usage : foreach( $obj->hits() ) { ... };
Purpose : Provides access to all hits, both new and old, and either
below or above the inclusion threshold.
Corresponds to subset A in the "Classification of Hits"
documentation section of this module.
Returns : An array containing all HitI objects.
Hits will be ordered according to their occurrence in the report
unless otherwise specified.
Args : none
See Also: newhits, oldhits, Classification of Hits |
| newhits | code | prev | next | Top |
Title : newhits
Usage : foreach( $obj->newhits() ) { ... };
Purpose : Provides access to hits that were not found in a previous iteration
and may be either below or above the inclusion threshold.
Corresponds to subset B in the "Classification of Hits"
documentation section of this module.
Returns : An array containing Bio::Search::Hit::HitI objects.
Hits will be ordered according to their occurrence in the report
unless otherwise specified.
Args : none
See Also: hits, oldhits, newhits_below_threshold + newhits_not_below_threshold, Classification of Hits |
| oldhits | code | prev | next | Top |
Title : oldhits
Usage : foreach( $obj->oldhits() ) { ... };
Purpose : Provides access to hits that were found in a previous iteration
and are either below or above the inclusion threshold in the current iteration.
Corresponds to subset C in the "Classification of Hits"
documentation section of this module.
Returns : An array containing Bio::Search::Hit::HitI objects.
Hits will be ordered according to their occurrence in the report
unless otherwise specified.
Args : none
See Also: hits, newhits, oldhits_below_threshold, oldhits_newly_below_threshold, oldhits_not_below_threshold, Classification of Hits |
| newhits_below_threshold | code | prev | next | Top |
Title : newhits_below_threshold
Usage : foreach( $obj->newhits_below_threshold() ) { ... };
Purpose : Provides access to hits that did not appear in a
previous iteration and are below threshold.
Corresponds to subset D in the "Classification of Hits"
documentation section of this module.
Returns : An array containing Bio::Search::Hit::HitI objects.
Hits will be returned in the order in which they occur in the report
unless otherwise specified.
Args : none
See Also: newhits_not_below_threshold, oldhits_newly_below_threshold, newhits, Classification of Hits |
| oldhits_below_threshold | code | prev | next | Top |
Title : oldhits_below_threshold
Usage : foreach( $obj->oldhits_below_threshold() ) { ... };
Purpose : Provides access to hits that appeared in a
previous iteration below inclusion threshold and are still below threshold.
Corresponds to subset H in the "Classification of Hits"
documentation section of this module.
Returns : An array containing Bio::Search::Hit::HitI objects.
Hits will be returned in the order in which they occur in the report
unless otherwise specified.
Args : none
See Also: oldhits_not_below_threshold, oldhits_newly_below_threshold, oldhits, Classification of Hits |
| oldhits_newly_below_threshold | code | prev | next | Top |
Title : oldhits_newly_below_threshold
Usage : foreach( $obj->oldhits_newly_below_threshold() ) { ... };
Purpose : Provides access to hits that appeared in a previous
iteration above threshold but are below threshold in the
current iteration. Not applicable to the first iteration.
Corresponds to subset I in the "Classification of Hits"
documentation section of this module.
Returns : An array containing Bio::Search::Hit::HitI objects.
Hits will be returned in the order in which they occur in the report
unless otherwise specified.
Args : none
See Also: newhits_below_threshold, oldhits, Classification of Hits |
| oldhits_not_below_threshold | code | prev | next | Top |
Title : oldhits_not_below_threshold
Usage : foreach( $obj->oldhits_not_below_threshold() ) { ... };
Purpose : Provides access to hits that appeared in a previous iteration
not below threshold and are still not below threshold.
Corresponds to subset G in the "Classification of Hits"
documentation section of this module.
Returns : An array containing Bio::Search::Hit::HitI objects.
Hits will be returned in the order in which they occur in the report
unless otherwise specified.
Args : none
See Also: oldhits_below_threshold, oldhits, Classification of Hits |
| newhits_not_below_threshold | code | prev | next | Top |
Title : newhits_not_below_threshold
Usage : foreach( $obj->newhits_not_below_threshold() ) { ... };
Purpose : Provides access to hits that did not appear in a
previous iteration and are not below threshold
in the current iteration.
Corresponds to subset E in the "Classification of Hits"
documentation section of this module.
Returns : An array containing Bio::Search::Hit::HitI objects.
Hits will be returned in the order in which they occur in the report
unless otherwise specified.
Args : none
See Also: newhits_below_threshold, newhits, Classification of Hits |
| hits_below_threshold | code | prev | next | Top |
Title : hits_below_threshold
Usage : foreach( $obj->hits_below_threshold() ) { ... };
Purpose : Provides access to all hits, old and new, that are below the inclusion threshold.
Corresponds to the union of subset D and subset F in the
"Classification of Hits" documentation section of this module.
Returns : An array containing Bio::Search::Hit::HitI objects.
Hits will be returned in the order in which they occur in the report
unless otherwise specified.
Args : none
See Also: newhits_below_threshold, oldhits_newly_below_threshold, oldhits_below_threshold, Classification of Hits |
| add_hit | code | prev | next | Top |
Title : add_hit
Usage : $report->add_hit(-hit =>$hit_obj,
-old =>$boolean,
-below_threshold =>$boolean,
-newly_below =>$boolean )
Purpose : Adds a HitI to the stored list of hits
Returns : Number of HitI currently stored for the class of the added hit.
Args : Tagged values, the only required one is -hit. All others are used
only for PSI-BLAST reports.
-hit => Bio::Search::Hit::HitI object
-old => boolean, true indicates that the hit was found in a previous
iteration. Default=false.
-below_threshold => boolean, true indicates that the hit is below
the inclusion threshold.
-newly_below => boolean, true indicates that the hit is below
the inclusion threshold in this iteration but was above
the inclusion threshold in a previous iteration. Only appropriate
for old hits. Default=false.
Throws : Bio::Root::BadParameter if the hit is not a
Bio::Search::Hit::HitI.
Bio::Root::BadParameter if -old=>false and -newly_below=>true. |
| get_hit | code | prev | next | Top |
Title : get_hit
Usage : $hit = $report->get_hit( $hit_name )
Purpose : Gets a HitI object given its name
if a hit with this name exists within this Iteration.
Returns : Bio::Search::Hit::HitI object or undef if there is no such hit.
Args : $hit_name = string containing name of the hit
Throws : n/a
The name string must be the same as that returned byBio::Search::Hit::HitI::name(). The lookup should be case-insensitive. |
| number | description | prev | next | Top |
my ($self,@args) = @_; $self->throw_not_implemented;}
| converged | description | prev | next | Top |
my ($self,@args) = @_; $self->throw_not_implemented;}
| next_hit | description | prev | next | Top |
my ($self,@args) = @_; $self->throw_not_implemented;}
| next_hit_new | description | prev | next | Top |
my ($self,@args) = @_; $self->throw_not_implemented;}
| next_hit_old | description | prev | next | Top |
my ($self,@args) = @_; $self->throw_not_implemented;}
| num_hits | description | prev | next | Top |
my ($self,@args) = @_; $self->throw_not_implemented();}
| num_hits_new | description | prev | next | Top |
my ($self,@args) = @_; $self->throw_not_implemented();}
| num_hits_old | description | prev | next | Top |
my ($self,@args) = @_; $self->throw_not_implemented();}
| hits | description | prev | next | Top |
shift->throw_not_implemented();}
| newhits | description | prev | next | Top |
shift->throw_not_implemented();}
| oldhits | description | prev | next | Top |
shift->throw_not_implemented();}
| newhits_below_threshold | description | prev | next | Top |
shift->throw_not_implemented();}
| oldhits_below_threshold | description | prev | next | Top |
shift->throw_not_implemented();}
| oldhits_newly_below_threshold | description | prev | next | Top |
shift->throw_not_implemented();}
| oldhits_not_below_threshold | description | prev | next | Top |
shift->throw_not_implemented();}
| newhits_not_below_threshold | description | prev | next | Top |
shift->throw_not_implemented();}
| hits_below_threshold | description | prev | next | Top |
shift->throw_not_implemented();}
| add_hit | description | prev | next | Top |
shift->throw_not_implemented}
| get_hit | description | prev | next | Top |
shift->throw_not_implemented}
| FEEDBACK | Top |
| Mailing Lists | Top |
bioperl-l@bioperl.org - General discussion http://bio.perl.org/MailList.html - About the mailing lists
| Reporting Bugs | Top |
bioperl-bugs@bio.perl.org http://bugzilla.bioperl.org/
| AUTHOR | Top |
| COPYRIGHT | Top |
| DISCLAIMER | Top |
| APPENDIX | Top |