0
|
1 # $Id: PubmedArticle.pm,v 1.3 2002/10/22 07:45:11 lapp Exp $
|
|
2 #
|
|
3 # BioPerl module for Bio::Biblio::PubmedArticle
|
|
4 #
|
|
5 # Cared for by Martin Senger <senger@ebi.ac.uk>
|
|
6 # For copyright and disclaimer see below.
|
|
7
|
|
8 # POD documentation - main docs before the code
|
|
9
|
|
10 =head1 NAME
|
|
11
|
|
12 Bio::Biblio::PubmedArticle - Representation of a PUBMED article
|
|
13
|
|
14 =head1 SYNOPSIS
|
|
15
|
|
16 $obj = new Bio::Biblio::PubmedArticle
|
|
17 (-pubmed_history_list =>
|
|
18 [ { 'pub_status' => 'pubmed',
|
|
19 'date' => '2001-12-1T10:0:00Z' },
|
|
20 { 'pub_status' => 'medline',
|
|
21 'date' => '2002-1-5T10:1:00Z' } ],
|
|
22 -pubmed_status => 'ppublish');
|
|
23 --- OR ---
|
|
24
|
|
25 $obj = new Bio::Biblio::PubmedArticle;
|
|
26 $obj->pubmed_status ('ppublish');
|
|
27
|
|
28 =head1 DESCRIPTION
|
|
29
|
|
30 A storage object for a general PUBMED article.
|
|
31 See its place in the class hierarchy in
|
|
32 http://industry.ebi.ac.uk/openBQS/images/bibobjects_perl.gif
|
|
33
|
|
34 =head2 Attributes
|
|
35
|
|
36 The following attributes are specific to this class
|
|
37 (however, you can also set and get all attributes defined in the parent classes):
|
|
38
|
|
39 pubmed_status
|
|
40 pubmed_provider_id
|
|
41 pubmed_history_list type: array ref of hashes
|
|
42 pubmed_article_id_list type: array ref of hashes
|
|
43 pubmed_url_list type: array ref of hashes
|
|
44
|
|
45 =head1 SEE ALSO
|
|
46
|
|
47 =over
|
|
48
|
|
49 =item *
|
|
50
|
|
51 OpenBQS home page: http://industry.ebi.ac.uk/openBQS
|
|
52
|
|
53 =item *
|
|
54
|
|
55 Comments to the Perl client: http://industry.ebi.ac.uk/openBQS/Client_perl.html
|
|
56
|
|
57 =back
|
|
58
|
|
59 =head1 FEEDBACK
|
|
60
|
|
61 =head2 Mailing Lists
|
|
62
|
|
63 User feedback is an integral part of the evolution of this and other
|
|
64 Bioperl modules. Send your comments and suggestions preferably to
|
|
65 the Bioperl mailing list. Your participation is much appreciated.
|
|
66
|
|
67 bioperl-l@bioperl.org - General discussion
|
|
68 http://bioperl.org/MailList.shtml - About the mailing lists
|
|
69
|
|
70 =head2 Reporting Bugs
|
|
71
|
|
72 Report bugs to the Bioperl bug tracking system to help us keep track
|
|
73 of the bugs and their resolution. Bug reports can be submitted via
|
|
74 email or the web:
|
|
75
|
|
76 bioperl-bugs@bioperl.org
|
|
77 http://bugzilla.bioperl.org/
|
|
78
|
|
79 =head1 AUTHOR
|
|
80
|
|
81 Martin Senger (senger@ebi.ac.uk)
|
|
82
|
|
83 =head1 COPYRIGHT
|
|
84
|
|
85 Copyright (c) 2002 European Bioinformatics Institute. All Rights Reserved.
|
|
86
|
|
87 This module is free software; you can redistribute it and/or modify
|
|
88 it under the same terms as Perl itself.
|
|
89
|
|
90 =head1 DISCLAIMER
|
|
91
|
|
92 This software is provided "as is" without warranty of any kind.
|
|
93
|
|
94 =cut
|
|
95
|
|
96
|
|
97 # Let the code begin...
|
|
98
|
|
99
|
|
100 package Bio::Biblio::PubmedArticle;
|
|
101 use strict;
|
|
102 use vars qw(@ISA);
|
|
103
|
|
104 use Bio::Biblio::MedlineArticle;
|
|
105 @ISA = qw(Bio::Biblio::MedlineArticle);
|
|
106
|
|
107 #
|
|
108 # a closure with a list of allowed attribute names (these names
|
|
109 # correspond with the allowed 'get' and 'set' methods); each name also
|
|
110 # keep what type the attribute should be (use 'undef' if it is a
|
|
111 # simple scalar)
|
|
112 #
|
|
113 {
|
|
114 my %_allowed =
|
|
115 (
|
|
116 _pubmed_status => undef,
|
|
117 _pubmed_provider_id => undef,
|
|
118 _pubmed_history_list => 'ARRAY',
|
|
119 _pubmed_article_id_list => 'ARRAY',
|
|
120 _pubmed_url_list => 'ARRAY',
|
|
121 );
|
|
122
|
|
123 # return 1 if $attr is allowed to be set/get in this class
|
|
124 sub _accessible {
|
|
125 my ($self, $attr) = @_;
|
|
126 return 1 if exists $_allowed{$attr};
|
|
127 foreach my $parent (@ISA) {
|
|
128 return 1 if $parent->_accessible ($attr);
|
|
129 }
|
|
130 }
|
|
131
|
|
132 # return an expected type of given $attr
|
|
133 sub _attr_type {
|
|
134 my ($self, $attr) = @_;
|
|
135 if (exists $_allowed{$attr}) {
|
|
136 return $_allowed{$attr};
|
|
137 } else {
|
|
138 foreach my $parent (@ISA) {
|
|
139 if ($parent->_accessible ($attr)) {
|
|
140 return $parent->_attr_type ($attr);
|
|
141 }
|
|
142 }
|
|
143 }
|
|
144 return 'unknown';
|
|
145 }
|
|
146 }
|
|
147
|
|
148 1;
|
|
149 __END__
|