1
# $Id: idHandler.pm,v 1.8 2001/11/20 02:09:38 lstein Exp $
3
# BioPerl module for Bio::SeqIO::game::idHandler
5
# Cared for by Brad Marshall <bradmars@yahoo.com>
7
# Copyright Brad Marshall
9
# You may distribute this module under the same terms as perl itself
11
# June 25, 2000 written by Brad Marshall
13
# POD documentation - main docs before the code
17
Bio::SeqIO::game::idHandler - GAME helper via PerlSAX helper.
21
GAME helper for parsing new ID objects from GAME XML. Do not use directly
27
User feedback is an integral part of the evolution of this and
28
other Bioperl modules. Send your comments and suggestions preferably
29
to one of the Bioperl mailing lists. Your participation is much appreciated.
31
bioperl-l@bioperl.org - Bioperl list
32
bioxml-dev@bioxml.org - Technical discussion - Moderate volume
33
bioxml-announce@bioxml.org - General Announcements - Pretty dead
34
http://www.bioxml.org/MailingLists/ - About the mailing lists
36
=head1 AUTHOR - Brad Marshall
38
Email: bradmars@yahoo.com
42
The rest of the documentation details each of the object
43
methods. Internal methods are usually preceded with a _
47
# This template file is in the Public Domain.
48
# You may do anything you want with this file.
51
package Bio::SeqIO::game::idHandler;
54
use vars qw{ $AUTOLOAD @ISA };
56
@ISA = qw(Bio::Root::Root);
58
my ($class,@args) = @_;
59
my $self = $class->SUPER::new(@args);
69
Title : start_document
70
Usage : $obj->start_document
71
Function: PerlSAX method called when a new document is initialized
79
my ($self, $document) = @_;
85
Usage : $obj->end_document
86
Function: PerlSAX method called when a document is finished for cleaning up
87
Returns : list of ids seen
93
my ($self, $document) = @_;
94
return $self->{'ids'};
100
Usage : $obj->start_element
101
Function: PerlSAX method called when a new element is reached
103
Args : element object
108
my ($self, $element) = @_;
110
if ($element->{'Name'} eq 'bx-seq:seq') {
111
if ($element->{'Attributes'}->{'bx-seq:id'}) {
112
push @{$self->{'ids'}}, $element->{'Attributes'}->{'bx-seq:id'};
114
if ($self->can('warn')) {
115
$self->warn('WARNING: Attribute bx-seq:id is required on bx-seq:seq. Sequence will not be parsed.');
117
warn('WARNING: Attribute bx-seq:id is required on bx-seq:seq. Sequence will not be parsed.');
127
Usage : $obj->end_element
128
Function: PerlSAX method called when an element is finished
130
Args : element object
135
my ($self, $element) = @_;
142
Usage : $obj->end_element
143
Function: PerlSAX method called when text between XML tags is reached
150
my ($self, $text) = @_;
157
Usage : do not use directly
158
Function: autoload handling of missing DESTROY method
168
my $method = $AUTOLOAD;
170
return if $method eq 'DESTROY';
172
print "UNRECOGNIZED $method\n";