Bio-EUtilities
view release on metacpan or search on metacpan
lib/Bio/DB/EUtilities.pm view on Meta::CPAN
of creating all data instances up front, then iterating through,
which is the default). Use of these iterators precludes use of
rewind() for the time being as we can't guarantee you can rewind(),
as this depends on whether the data source is seek()able and thus
'rewindable'. We will add rewind() support at a later time which
will work for 'seekable' data.
A callback specified using callback() will be used to filter objects
for any generated iterator. This behaviour is implemented for both
normal and lazy iterator types and is the default. If you don't want
this, make sure to reset any previously set callbacks via
reset_callback() (which just deletes the code ref).
TODO : generate seekable iterators ala HOP for seekable fh data
=head2 callback
Title : callback
Usage : $parser->callback(sub {$_[0]->get_database eq 'protein'});
Function : Get/set callback code ref used to filter returned data objects
Returns : code ref if previously set
Args : single argument:
lib/Bio/Tools/EUtilities.pm view on Meta::CPAN
Note : This function generates a simple coderef that one can use
independently of the various next_* functions (in fact, the next_*
functions use lazily created iterators generated via this method,
while rewind() merely deletes them so they can be regenerated on the
next call).
A callback specified using callback() will be used to filter objects
for any generated iterator. This behaviour is implemented for both
normal and lazy iterator types and is the default. If you don't want
this, make sure to reset any previously set callbacks via
reset_callback() (which just deletes the code ref). Note that setting
callback() also changes the behavior of the next_* functions as the
iterators are generated here (as described above); this is a feature
and not a bug.
'Lazy' iterators are considered an experimental feature and may be
modified in the future. A 'lazy' iterator, which loops through and
returns objects as they are created (instead of creating all data
instances up front, then iterating through) is returned if the
parser is set to 'lazy' mode. This mode is only present for elink
( run in 1.749 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )