Stone::Cursor(3pm) User Contributed Perl Documentation Stone::Cursor(3pm)NAME
Stone::Cursor - Traverse tags and values of a Stone
SYNOPSIS
use Boulder::Store;
$store = Boulder::Store->new('./soccer_teams');
my $stone = $store->get(28);
$cursor = $stone->cursor;
while (my ($key,$value) = $cursor->each) {
print "$value: Go Bluejays!
" if $key eq 'State' and $value eq 'Katonah';
}
DESCRIPTION
Boulder::Cursor is a utility class that allows you to create one or more iterators across a Stone object. This is used for traversing
large Stone objects in order to identify or modify portions of the record.
CLASS METHODS
Boulder::Cursor->new($stone)
Return a new Boulder::Cursor over the specified Stone object. This will return an error if the object is not a Stone or a descendent.
This method is usually not called directly, but rather indirectly via the Stone cursor() method:
my $cursor = $stone->cursor;
OBJECT METHODS
$cursor->each()
Iterate over the attached Stone. Each iteration will return a two-valued list consisting of a tag path and a value. The tag path is
of a form that can be used with Stone::index() (in fact, a cursor is used internally to implement the Stone::dump() method. When the
end of the Stone is reached, "each()" will return an empty list, after which it will start over again from the beginning. If you
attempt to insert or delete from the stone while iterating over it, all attached cursors will reset to the beginnning.
For example:
$cursor = $s->cursor;
while (($key,$value) = $cursor->each) {
print "$value: BOW WOW!
" if $key=~/pet/;
}
$cursor->reset()
This resets the cursor back to the beginning of the associated Stone.
AUTHOR
Lincoln D. Stein <lstein@cshl.org>.
COPYRIGHT
Copyright 1997-1999, Cold Spring Harbor Laboratory, Cold Spring Harbor NY. This module can be used and distributed on the same terms as
Perl itself.
SEE ALSO
Boulder, Stone
perl v5.10.1 2011-03-05 Stone::Cursor(3pm)
Check Out this Related Man Page
Stone::GB_Sequence(3pm) User Contributed Perl Documentation Stone::GB_Sequence(3pm)NAME
Stone::GB_Sequence - Specialized Access to GenBank Records
SYNOPSIS
use Boulder::Genbank; # No need to use Stone::GB_Sequence directly
$gb = Boulder::Genbank->newFh qw(M57939 M28274 L36028);
while ($entry = <$gb>) {
print "Entry's length is ",$entry->length,"
";
@cds = $entry->match_features(-type=>'CDS');
@exons = $entry->match_features(-type=>'Exon',-start=>100,-end=>300);
}
}
DESCRIPTION
Stone::GB_Sequence provides several specialized access methods to the various fields in a GenBank flat file record. You can return the
sequence as a Bio::Seq object, or query the sequence for features that match positional or descriptional criteria that you provide.
CONSTRUCTORS
This class is not intended to be created directly, but via a Boulder::Genbank stream.
METHODS
In addition to the standard Stone methods and accessors, the following methods are provided. In the synopses, the variable $entry refers
to a previously-created Stone::GB_Sequence object.
$length = $entry->length
Get the length of the sequence.
$start = $entry->start
Get the start position of the sequence, currently always "1".
$end = $entry->end
Get the end position of the sequence, currently always the same as the length.
@feature_list = $entry->features(-pos=>[50,450],-type=>['CDS','Exon'])
features() will search the entry feature list for those features that meet certain criteria. The criteria are specified using the -pos
and/or -type argument names, as shown below.
-pos
Provide a position or range of positions which the feature must overlap. A single position is specified in this way:
-pos => 1500; # feature must overlap postion 1500
or a range of positions in this way:
-pos => [1000,1500]; # 1000 to 1500 inclusive
If no criteria are provided, then features() returns all the features, and is equivalent to calling the Features() accessor.
-type, -types
Filter the list of features by type or a set of types. Matches are case-insensitive, so "exon", "Exon" and "EXON" are all equivalent.
You may call with a single type as in:
-type => 'Exon'
or with a list of types, as in
-types => ['Exon','CDS']
The names "-type" and "-types" can be used interchangeably.
$seqObj = $entry->bioSeq;
Returns a Bio::Seq object from the Bioperl project. Dies with an error message unless the Bio::Seq module is installed.
AUTHOR
Lincoln D. Stein <lstein@cshl.org>.
COPYRIGHT
Copyright 1997-1999, Cold Spring Harbor Laboratory, Cold Spring Harbor NY. This module can be used and distributed on the same terms as
Perl itself.
SEE ALSO
Boulder, <Boulder:Genbank>, Stone
perl v5.10.1 2011-03-05 Stone::GB_Sequence(3pm)