Bio::SeqIO::game
gameHandler
Summary
Bio::SeqIO::game::gameHandler -- PerlSAX handler for game-XML
Package variables
No package variables defined.
Included modules
Inherit
Synopsis
This modules is not used directly
Description
Bio::SeqIO::game::gameHandler is the top-level XML handler invoked by PerlSAX
Methods
Methods description
Title : start_document
Function: begin parsing the document |
Title : end_document
Function: finish parsing the document |
Title : load
Usage : $seqs = $handler->load
Function: start parsing
Returns : a ref to a list of sequence objects
Args : an optional flag to supress elements (not used yet) |
Title : s_game
Function: begin parsing game element |
Title : e_game
Function: process the game element |
Title : e_seq
Function: process the sequence element |
Title : e_map_position
Function: process the map_position element |
Title : e_annotation
Function: process the annotation |
Methods code
sub start_document
{ my ($self, $document) = @_;
$self->SUPER::start_document($document);
$self->{sequences} = {};
$self->{annotations} = {};
$self->{computations} = {};
$self->{map_position} = {};
$self->{focus} = {};} |
sub end_document
{ my ($self, $document) = @_;
$self->SUPER::end_document($document);
return $self;} |
sub load
{ my $self = shift;
my $suppress_comps = shift;
my @seqs = ();
for ( 1..$self->{game} ) {
my $seq = $self->{sequences}->{$_}
or $self->throw("No sequences defined");
my $ann = $self->{annotations}->{$_}
or $self->throw("No annotations");
my $comp = $self->{computations}->{$_};
my $map = $self->{map_position}->{$_}
or $self->complain("No map position defined");
my $foc = $self->{focus}->{$_}
or $self->throw("No main sequence defined");
my $src = $self->{has_source};
my $bio = Bio::SeqIO::game::seqHandler->new( $seq, $ann, $comp, $map, $src );
push @seqs, $bio->convert;
}\@
seqs;} |
sub s_game
{ my ($self, $e) = @_;
my $el = $self->curr_element;
$self->{game}++;
my $version = $el->{Attributes}->{version};
unless ( defined $version ) {
$self->complain("No GAME-xml version specified -- guessing v1.2\n");
$version = 1.2;
}
if ( defined($version) && $version == 1.2) {
$self->{origin_offset} = 1;
} else {
$self->{origin_offset} = 0;
}
if (defined($version) && ($version != 1.2)) {
$self->complain("GAME version $version is not supported\n",
"I'll try anyway but I may fail!\n");
}} |
sub e_game
{ my ($self, $el) = @_;
$self->flush( $el );} |
sub e_seq
{ my ($self, $e) = @_;
my $el = $self->curr_element();
$self->{sequences}->{$self->{game}} ||= [];
my $seqs = $self->{sequences}->{$self->{game}};
if ( defined $el->{Attributes}->{focus} ) {
$self->{focus}->{$self->{game}} = $el;
}
push @{$seqs}, $el;
$self->flush;} |
sub e_map_position
{ my ($self, $e) = @_;
my $el = $self->curr_element;
$self->{map_position}->{$self->{game}} = $el;} |
sub e_annotation
{ my ($self, $e) = shift;
my $el = $self->curr_element;
$self->{annotations}->{$self->{game}} ||= [];
my $anns = $self->{annotations}->{$self->{game}};
push @{$anns}, $el;} |
General documentation
User feedback is an integral part of the evolution of this
and other Bioperl modules. Send your comments and suggestions preferably
to one of the Bioperl mailing lists.
Your participation is much appreciated.
bioperl-l@bioperl.org - General discussion
http://bioperl.org/MailList.shtml - About the mailing lists
Report bugs to the Bioperl bug tracking system to help us keep track
of the bugs and their resolution.
Bug reports can be submitted via email or the web:
bioperl-bugs@bioperl.org
http://bugzilla.bioperl.org/
| AUTHOR - Sheldon McKay | Top |
The rest of the documentation details each of the object
methods. Internal methods are usually preceded with a _