sync w/ main trunk
[bioperl-live.git] / Bio / Biblio / MedlineArticle.pm
blob89a81b730f6d67b0f9819094bd495bba05f746e6
1 # $Id$
3 # BioPerl module for Bio::Biblio::MedlineArticle
5 # Please direct questions and support issues to <bioperl-l@bioperl.org>
7 # Cared for by Martin Senger <senger@ebi.ac.uk>
8 # For copyright and disclaimer see below.
10 # POD documentation - main docs before the code
12 =head1 NAME
14 Bio::Biblio::MedlineArticle - Representation of a MEDLINE article
16 =head1 SYNOPSIS
18 $obj = Bio::Biblio::MedlineArticle->new(-mesh_headings =>
19 #array ref of hashes
22 # how are Mesh terms stored:
23 use Data::Dumper;
24 print Data::Dumper->Dump ( [$obj->mesh_headings], ['MeshHeadings']);
26 #It produces (something like) this:
27 #'MeshHeadings' => [
28 # { 'descriptorName' => 'Adult' },
29 # { 'descriptorName' => 'Cardiovascular Diseases',
30 # 'subHeadings' => [ { 'subHeading' => 'etiology' },
31 # { 'majorTopic' => 'Y',
32 # 'subHeading' => 'mortality' } ] },
33 # { 'descriptorName' => 'Child Development',
34 # 'subHeadings' => [ { 'majorTopic' => 'Y',
35 # 'subHeading' => 'physiology' } ] },
36 # { 'descriptorName' => 'Human' },
37 # ]
39 =head1 DESCRIPTION
41 A storage object for a MEDLINE article.
42 See its place in the class hierarchy in
43 http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif
45 =head2 Attributes
47 The following attributes are specific to this class
48 (however, you can also set and get all attributes defined in the parent classes):
50 affiliation
51 chemicals type: array ref of hashes
52 citation_owner
53 comment_ins type: array ref of hashes
54 comment_ons type: array ref of hashes
55 date_of_electronic_publication
56 erratum_fors type: array ref of hashes
57 erratum_in type: array ref of hashes
58 gene_symbols
59 general_notes type: array ref of hashes
60 grant_list_complete
61 grants type: array ref of hashes
62 medline_date
63 medline_id
64 medline_page
65 mesh_headings type: array ref of hashes
66 number_of_references
67 original_report_ins type: array ref of hashes
68 other_abstracts type: array ref of hashes
69 other_ids type: array ref of hashes
70 other_languages
71 pmid
72 republished_froms type: array ref of hashes
73 republished_ins type: array ref of hashes
74 retraction_ins type: array ref of hashes
75 retraction_ofs type: array ref of hashes
76 season
77 status
78 summary_for_patients_ins type: array ref of hashes
79 update_ins type: array ref of hashes
80 update_ofs type: array ref of hashes
81 vernacular_title
83 =head1 SEE ALSO
85 =over 4
87 =item *
89 OpenBQS home page: http://www.ebi.ac.uk/~senger/openbqs/
91 =item *
93 Comments to the Perl client: http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html
95 =back
97 =head1 FEEDBACK
99 =head2 Mailing Lists
101 User feedback is an integral part of the evolution of this and other
102 Bioperl modules. Send your comments and suggestions preferably to
103 the Bioperl mailing list. Your participation is much appreciated.
105 bioperl-l@bioperl.org - General discussion
106 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
108 =head2 Support
110 Please direct usage questions or support issues to the mailing list:
112 L<bioperl-l@bioperl.org>
114 rather than to the module maintainer directly. Many experienced and
115 reponsive experts will be able look at the problem and quickly
116 address it. Please include a thorough description of the problem
117 with code and data examples if at all possible.
119 =head2 Reporting Bugs
121 Report bugs to the Bioperl bug tracking system to help us keep track
122 of the bugs and their resolution. Bug reports can be submitted via the
123 web:
125 http://bugzilla.open-bio.org/
127 =head1 AUTHORS
129 Heikki Lehvaslaiho (heikki-at-bioperl-dot-org),
130 Martin Senger (senger@ebi.ac.uk)
132 =head1 COPYRIGHT
134 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
136 This module is free software; you can redistribute it and/or modify
137 it under the same terms as Perl itself.
139 =head1 DISCLAIMER
141 This software is provided "as is" without warranty of any kind.
143 =cut
146 # Let the code begin...
149 package Bio::Biblio::MedlineArticle;
150 use strict;
153 use base qw(Bio::Biblio::Article);
156 # a closure with a list of allowed attribute names (these names
157 # correspond with the allowed 'get' and 'set' methods); each name also
158 # keep what type the attribute should be (use 'undef' if it is a
159 # simple scalar)
162 my %_allowed =
164 _affiliation => undef,
165 _chemicals => 'ARRAY',
166 _citation_owner => undef,
167 _comment_ins => 'ARRAY',
168 _comment_ons => 'ARRAY',
169 _date_of_electronic_publication => undef,
170 _erratum_fors => 'ARRAY',
171 _erratum_ins => 'ARRAY',
172 _gene_symbols => undef,
173 _general_notes => 'ARRAY',
174 _grant_list_complete => undef,
175 _grants => 'ARRAY',
176 _medline_date => undef,
177 _medline_id => undef,
178 _medline_page => undef,
179 _mesh_headings => 'ARRAY',
180 _number_of_references => undef,
181 _original_report_ins => 'ARRAY',
182 _other_abstracts => 'ARRAY',
183 _other_ids => 'ARRAY',
184 _other_languages => undef,
185 _pmid => undef,
186 _republished_froms => 'ARRAY',
187 _republished_ins => 'ARRAY',
188 _retraction_ins => 'ARRAY',
189 _retraction_ofs => 'ARRAY',
190 _season => undef,
191 _status => undef,
192 _summary_for_patients_ins => 'ARRAY',
193 _update_ins => 'ARRAY',
194 _update_ofs => 'ARRAY',
195 _vernacular_title => undef,
198 # return 1 if $attr is allowed to be set/get in this class
199 sub _accessible {
200 my ($self, $attr) = @_;
201 exists $_allowed{$attr} or $self->SUPER::_accessible ($attr);
204 # return an expected type of given $attr
205 sub _attr_type {
206 my ($self, $attr) = @_;
207 if (exists $_allowed{$attr}) {
208 return $_allowed{$attr};
209 } else {
210 return $self->SUPER::_attr_type ($attr);
217 __END__