49
49
# again reading all citation but now a callback defined in your
50
50
# code is used (note that the reading starts already when new()
52
$io = new Bio::Biblio::IO ('-format' => 'medlinexml',
52
$io = Bio::Biblio::IO->new('-format' => 'medlinexml',
53
53
'-file' => $testfile,
54
54
'-callback' => \&callback);
64
64
use Bio::Biblio::IO;
65
my $xml = new Bio::Biblio->get_by_id ('12368254');
65
my $xml = Bio::Biblio->new->get_by_id ('12368254');
66
66
my $reader = Bio::Biblio::IO->new ('-data' => $xml,
67
67
'-format' => 'medlinexml');
73
73
#And, finally, the resulting citation can be received in different
76
$io = new Bio::Biblio::IO ('-format' => 'medlinexml',
76
$io = Bio::Biblio::IO->new('-format' => 'medlinexml',
77
77
'-result' => 'raw');
80
$io = new Bio::Biblio::IO ('-format' => 'medlinexml',
80
$io = Bio::Biblio::IO->new('-format' => 'medlinexml',
81
81
'-result' => 'medline2ref');
85
$io = new Bio::Biblio::IO ('-format' => 'pubmedxml',
85
$io = Bio::Biblio::IO->new('-format' => 'pubmedxml',
86
86
'-result' => 'pubmed2ref');
111
111
I<-result>. One result type is I<raw> and it is represented by a
112
112
simple, not blessed hash table:
114
$io = new Bio::Biblio::IO ('-result' => 'raw');
114
$io = Bio::Biblio::IO->new('-result' => 'raw');
116
116
What other result formats are available depends on the module who
117
117
reads the citations in the first place. At the moment, the following
118
118
ones are available:
120
$io = new Bio::Biblio::IO ('-result' => 'medline2ref');
120
$io = Bio::Biblio::IO->new('-result' => 'medline2ref');
122
122
This is a default result format for reading citations by the
123
123
I<medlinexml> module. The C<medlinexml> module is again the default
124
124
one. Which means that you can almost omit arguments (you still need to
125
125
say where the citations come from):
127
$io = new Bio::Biblio::IO ('-file' => 'data/medline_data.xml');
127
$io = Bio::Biblio::IO->new('-file' => 'data/medline_data.xml');
129
129
Another result format available is for PUBMED citations (which is a
130
130
super-set of the MEDLINE citations having few more tags):
132
$io = new Bio::Biblio::IO ('-format' => 'pubmedxml',
132
$io = Bio::Biblio::IO->new('-format' => 'pubmedxml',
133
133
'-result' => 'pubmed2ref',
134
134
'-data' => $citation);
136
136
Or, because C<pubmed2ref> is a default one for PUBMED citations, you can say just:
138
$io = new Bio::Biblio::IO ('-format' => 'pubmedxml',
138
$io = Bio::Biblio::IO->new('-format' => 'pubmedxml',
139
139
'-data' => $citation);
141
141
Both C<medline2ref> and C<pubmed2ref> results are objects defined in