~ubuntu-branches/ubuntu/raring/bioperl/raring

« back to all changes in this revision

Viewing changes to examples/biblio/biblio_examples.pl

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2008-03-18 14:44:57 UTC
  • mfrom: (4 hardy)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20080318144457-1jjoztrvqwf0gruk
* debian/control:
  - Removed MIA Matt Hope (dopey) from the Uploaders field.
    Thank you for your work, Matt. I hope you are doing well.
  - Downgraded some recommended package to the 'Suggests' priority,
    according to the following discussion on Upstream's mail list.
    http://bioperl.org/pipermail/bioperl-l/2008-March/027379.html
    (Closes: #448890)
* debian/copyright converted to machine-readable format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
# simple examples of Bio::Biblio usage
3
 
# Brian Osborne
4
 
 
5
 
use strict;
6
 
use Bio::Biblio;
7
 
use Bio::Biblio::IO;
8
 
use Data::Dumper;
9
 
 
10
 
# number of articles in Medline with author Osborne...
11
 
my $num = new Bio::Biblio->find("Osborne","authors")->get_count;
12
 
 
13
 
# number of articles in Medline with author Osborne in year 2000...
14
 
$num = new Bio::Biblio->find("Osborne","authors")->
15
 
  find("2000","year")->get_count;
16
 
 
17
 
# number of JBC articles...
18
 
$num = new Bio::Biblio->find("J Biol Chem","journal")->get_count;
19
 
 
20
 
# a reference as XML...
21
 
my $xml = new Bio::Biblio->get_by_id("3047008");
22
 
 
23
 
# get a reference to an array of ids...
24
 
my $arr_ref = new Bio::Biblio->find ("Osborne","authors")->
25
 
  find("2000","year")->get_all_ids;
26
 
 
27
 
# retrieve the entry as text or retrieve specific text fields...
28
 
my $medline_id = "88329717";
29
 
my $ref = new Bio::Biblio->get_by_id($medline_id);
30
 
my $io = Bio::Biblio::IO->new( -result => "raw",
31
 
                               -data   => $ref );
32
 
my $nextref = $io->next_bibref;
33
 
# print the entire hash...
34
 
my $dump = Data::Dumper->Dump([$nextref],["$medline_id"]);
35
 
# or just the abstract...
36
 
my $abstract = $nextref->{article}->{abstract}->{abstractText};
37
 
# some hash references are stored in arrays
38
 
foreach my $ref ( @{$nextref->{article}->{authors}} ) {
39
 
   foreach my $val (values %{$ref}) {
40
 
      print $val->{lastName}," ",$val->{initials},"\n";
41
 
   }
42
 
}
43
 
# a few more values
44
 
my $year = $nextref->{article}->{journal}->{journalIssue}->{pubDate}->{year};
45
 
my $title = $nextref->{article}->{articleTitle};
46
 
 
47
 
__END__
48
 
 
49
 
Output from Data::Dumper->Dump:
50
 
 
51
 
88329717 = {
52
 
            'chemicals' => [
53
 
                            {
54
 
                             'nameOfSubstance' => 'DNA, Fungal',
55
 
                             'registryNumber'  => '0'
56
 
                            },
57
 
                            {
58
 
                             'nameOfSubstance' => 'DNA, Superhelical',
59
 
                             'registryNumber'  => '0'
60
 
                            },
61
 
                            {
62
 
                             'nameOfSubstance' => 'RNA Polymerase II',
63
 
                             'registryNumber'  => 'EC 2.7.7.-'
64
 
                            }
65
 
                           ],
66
 
            'journalInfo' => {
67
 
                              'medlineTA'   => 'Genes Dev',
68
 
                              'country'     => 'UNITED STATES',
69
 
                              'nlmUniqueID' => '8711660'
70
 
                             },
71
 
            'PMID'      => '3047008',
72
 
            'medlineID' => '88329717',
73
 
            'status'    => 'Completed',
74
 
            'article'   => {
75
 
                            'journal' => {
76
 
                                          'journalIssue' => {
77
 
                                                             'volume'       => '2',
78
 
                                                             'issue'        => '6',
79
 
                                                             'pubDate'      => {
80
 
                                                                                'month' => 'Jun',
81
 
                                                                                'year'  => '1988'
82
 
                                                                               }
83
 
                                                            },
84
 
                                          'iSSN' => '0890-9369'
85
 
                                         },
86
 
                            'grants' => [
87
 
                                         {
88
 
                                          'agency'  => 'NIGMS',
89
 
                                          'grantID' => '5R01 GM30454-05',
90
 
                                          'acronym' => 'GM'
91
 
                                         }
92
 
                                        ],
93
 
                            'pagination' => {
94
 
                                             'medlinePgn' => '766-72'
95
 
                                            },
96
 
                            'abstract' => {
97
 
                                           'abstractText' => 'We show that induction of transcription of a CYC1-lacZ fusion gene, borne on a yeast plasmid, causes an increase in negative superhelicity of approximately five turns. This increase is abolished by deletion of either essential element of the CYC1 promoter, the upstream activation site (UAS), or the TATA boxes. Several experiments indicate that the size of the increase is proportional to the size of the transcribed region. First, an internal deletion removing half of the CYC1-lacZ transcribed region results in a plasmid whose negative superhelicity on induction is intermediate between promoter-deletion plasmids and the parental plasmid. Second, plasmids bearing insertions of a fragment containing the putative CYC1 terminator into the CYC1-lacZ fusion gene have relative negative superhelicities proportional to the length of the truncated fusion transcripts generated. A plausible model explaining these observations is that local unwinding of the double helix by transcribing RNA polymerase generates positively supercoiled DNA, which is subsequently relaxed by a topoisomerase.'
98
 
                                          },
99
 
                            'languages' => [
100
 
                                            'eng'
101
 
                                           ],
102
 
                            'publicationTypes' => [
103
 
                                                   'Journal Article'
104
 
                                                  ],
105
 
                            'authors' => [
106
 
                                          {
107
 
                                           'personalName' => {
108
 
                                                              'initials' => 'BI',
109
 
                                                              'lastName' => 'Osborne',
110
 
                                                              'foreName' => 'B I',
111
 
                                                              'type'     => 'PersonalName'
112
 
                                                             }
113
 
                                          },
114
 
                                          {
115
 
                                           'personalName' => {
116
 
                                                              'initials' => 'L',
117
 
                                                              'lastName' => 'Guarente',
118
 
                                                              'foreName' => 'L',
119
 
                                                              'type'     => 'PersonalName'
120
 
                                                             }
121
 
                                          }
122
 
                                         ],
123
 
                            'articleTitle' => 'Transcription by RNA polymerase II induces changes of DNA topology in yeast.',
124
 
                            'affiliation' => 'Massachusetts Institute of Technology, Department of Biology, Cambridge 02139.'
125
 
                           },
126
 
            'dateRevised' => {
127
 
                              'day' => '18',
128
 
                              'month' => '12',
129
 
                              'year' => '2000'
130
 
                             },
131
 
            'meshHeadings' => [
132
 
                               {
133
 
                                'descriptorName' => 'Chromosome Deletion'
134
 
                               },
135
 
                               {
136
 
                                'descriptorName' => 'DNA, Fungal',
137
 
                                'subHeadings' => [
138
 
                                                  {
139
 
                                                   'subHeading' => 'genetics',
140
 
                                                   'majorTopic' => 'Y'
141
 
                                                  },
142
 
                                                  {
143
 
                                                   'subHeading' => 'ultrastructure'
144
 
                                                  }
145
 
                                                 ]
146
 
                               },
147
 
                               {
148
 
                                'descriptorName' => 'DNA, Superhelical',
149
 
                                'subHeadings' => [
150
 
                                                  {
151
 
                                                   'subHeading' => 'genetics'
152
 
                                                  }
153
 
                                                 ]
154
 
                               },
155
 
                               {
156
 
                                'descriptorName' => 'Genes, Fungal'
157
 
                               },
158
 
                               {
159
 
                                'descriptorName' => 'Promoter Regions (Genetics)'
160
 
                               },
161
 
                               {
162
 
                                'descriptorName' => 'RNA Polymerase II',
163
 
                                'subHeadings' => [
164
 
                                                  {
165
 
                                                   'subHeading' => 'metabolism',
166
 
                                                   'majorTopic' => 'Y'
167
 
                                                  }
168
 
                                                 ]
169
 
                               },
170
 
                               {
171
 
                                'descriptorName' => 'Saccharomyces cerevisiae',
172
 
                                'subHeadings' => [
173
 
                                                  {
174
 
                                                   'subHeading' => 'genetics',
175
 
                                                   'majorTopic' => 'Y'
176
 
                                                  }
177
 
                                                 ]
178
 
                               },
179
 
                               {
180
 
                                'descriptorName' => 'Support, Non-U.S. Gov\'t'
181
 
                               },
182
 
                               {
183
 
                                'descriptorName' => 'Support, U.S. Gov\'t, P.H.S.'
184
 
                               },
185
 
                               {
186
 
                                'descriptorName' => 'Transcription, Genetic'
187
 
                               }
188
 
                              ],
189
 
            'dateCreated' => {
190
 
                              'day' => '24',
191
 
                              'month' => '10',
192
 
                              'year' => '1988'
193
 
                             },
194
 
            'citationSubsets' => [
195
 
                                  'IM'
196
 
                                 ],
197
 
            'type' => 'MedlineCitation',
198
 
            'dateCompleted' => {
199
 
                                'day' => '24',
200
 
                                'month' => '10',
201
 
                                'year' => '1988'
202
 
                               }
203
 
           };