3 # BioPerl module for Bio::Biblio::Ref
5 # Cared for by Martin Senger <senger@ebi.ac.uk>
6 # For copyright and disclaimer see below.
8 # POD documentation - main docs before the code
12 Bio::Biblio::Ref - Representation of a bibliographic reference
16 $obj = Bio::Biblio::Ref->new(-type => 'Letter',
17 -title => 'Onegin to Tatiana');
20 $obj = Bio::Biblio::Ref->new();
21 $obj->type ('Letter');
25 A storage object for a general bibliographic reference (a citation).
26 See its place in the class hierarchy in
27 http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif
31 The following attributes are specific to this class,
32 and they are inherited by all citation types.
34 author_list_complete values: 'Y' (default) or 'N'
35 authors type: array ref of Bio::Biblio::Provider's
36 cross_references type: array ref of Bio::Annotation::DBLink's
37 cross_references_list_complete values: 'Y' (default) or 'N'
42 contributors type: array ref of Bio::Biblio::Provider's
52 publisher type: Bio::Biblio::Provider
56 subject_headings type: hash ref
57 subject_headings_source
70 OpenBQS home page: http://www.ebi.ac.uk/~senger/openbqs/
74 Comments to the Perl client: http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html
82 User feedback is an integral part of the evolution of this and other
83 Bioperl modules. Send your comments and suggestions preferably to
84 the Bioperl mailing list. Your participation is much appreciated.
86 bioperl-l@bioperl.org - General discussion
87 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
91 Report bugs to the Bioperl bug tracking system to help us keep track
92 of the bugs and their resolution. Bug reports can be submitted via the
95 http://bugzilla.open-bio.org/
99 Heikki Lehvaslaiho (heikki-at-bioperl-dot-org),
100 Martin Senger (senger@ebi.ac.uk)
104 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
106 This module is free software; you can redistribute it and/or modify
107 it under the same terms as Perl itself.
111 This software is provided "as is" without warranty of any kind.
115 The rest of the documentation details each of the object
116 methods. Internal methods are preceded with a _
121 # Let the code begin...
124 package Bio
::Biblio
::Ref
;
126 use vars
qw($AUTOLOAD);
128 use Bio::Annotation::DBLink;
130 use base qw(Bio::Biblio::BiblioBase);
133 # a closure with a list of allowed attribute names (these names
134 # correspond with the allowed 'get' and 'set' methods); each name also
135 # keep what type the attribute should be (use 'undef' if it is a
141 _author_list_complete
=> undef,
142 _authors
=> 'ARRAY', # of Bio::Biblio::Provider
143 _cross_references
=> 'ARRAY', # of Bio::Annotation::DBLink
144 _cross_references_list_complete
=> undef,
146 _abstract_language
=> undef,
147 _abstract_type
=> undef,
149 _contributors
=> 'ARRAY', # of Bio::Biblio::Provider
151 _date_completed
=> undef,
152 _date_created
=> undef,
153 _date_revised
=> undef,
155 _identifier
=> undef,
158 _last_modified_date
=> undef,
159 _publisher
=> 'Bio::Biblio::Provider',
160 _repository_subset
=> undef,
162 _spatial_location
=> undef,
163 _subject_headings
=> 'HASH',
164 _subject_headings_source
=> undef,
165 _temporal_period
=> undef,
172 # return 1 if $attr is allowed to be set/get in this class
174 my ($self, $attr) = @_;
175 exists $_allowed{$attr};
178 # return an expected type of given $attr
180 my ($self, $attr) = @_;
186 =head2 add_cross_reference
188 Usage : $self->add_cross_reference
189 (Bio::Annotation::DBLink->new(-database => 'EMBL',
190 -primary_id => 'V00808');
191 Function: adding a link to a database entry
192 Returns : new value of 'cross_references'
193 Args : an object of type Bio::Annotation::DBLink
197 sub add_cross_reference
{
198 my ($self, $value) = @_;
199 $self->throw ($self->_wrong_type_msg (ref $value, 'Bio::Annotation::DBLink'))
200 unless (UNIVERSAL
::isa
($value, 'Bio::Annotation::DBLink'));
201 (defined $self->cross_references) ?
202 push (@
{ $self->cross_references }, $value) :
203 return $self->cross_references ( [$value] );
204 return $self->cross_references;
210 Usage : $self->add_author (Bio::Biblio::Person->new(-lastname => 'Novak');
211 Function: adding an author to a list of authors
212 Returns : new value of 'authors' (a full list)
213 Args : an object of type Bio::Biblio::Provider
219 my ($self, $value) = @_;
220 $self->throw ($self->_wrong_type_msg (ref $value, 'Bio::Biblio::Provider'))
221 unless (UNIVERSAL
::isa
($value, 'Bio::Biblio::Provider'));
222 (defined $self->authors) ?
223 push (@
{ $self->authors }, $value) :
224 return $self->authors ( [$value] );
225 return $self->authors;
228 =head2 add_contributor
230 Usage : $self->add_contributor (Bio::Biblio::Person->new(-lastname => 'Novak');
231 Function: adding a contributor to a list of contributors
232 Returns : new value of 'contributors' (a full list)
233 Args : an object of type Bio::Biblio::Provider
237 sub add_contributor
{
238 my ($self, $value) = @_;
239 $self->throw ($self->_wrong_type_msg (ref $value, 'Bio::Biblio::Provider'))
240 unless (UNIVERSAL
::isa
($value, 'Bio::Biblio::Provider'));
241 (defined $self->contributors) ?
242 push (@
{ $self->contributors }, $value) :
243 return $self->contributors ( [$value] );
244 return $self->contributors;