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

« back to all changes in this revision

Viewing changes to Bio/OntologyIO/Handlers/InterPro_BioSQL_Handler.pm

  • 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
 
#
2
 
#
3
 
#
4
 
#
 
1
# $Id: InterPro_BioSQL_Handler.pm,v 1.7.6.1 2006/10/02 23:10:22 sendu Exp $
 
2
#
 
3
# BioPerl module for InterPro_BioSQL_Handler
 
4
#
 
5
# Cared for by Juguang Xiao, juguang@tll.org.sg
 
6
#
 
7
# Copyright Juguang Xiao 
 
8
#
 
9
# You may distribute this module under the same terms as perl itself
 
10
 
 
11
# POD documentation - main docs before the code
5
12
 
6
13
=head1 NAME
7
14
 
8
 
Bio::OntologyIO::Handlers::InterPro_BioSQL_Handler
 
15
Bio::OntologyIO::Handlers::InterPro_BioSQL_Handler - parse an InterPro XML file and persist the resulting terms to a Biosql database
9
16
 
10
17
=head1 SYNOPSIS
11
18
 
13
20
 
14
21
=head1 DESCRIPTION
15
22
 
16
 
This module take the advantage of SAX, a stream-based XML parser
17
 
technology, to keep the used memory as small as possible.
18
 
InterProHandler in the same directory use another scheme to keep all
19
 
interpro record in the engine and keep the ontology data in memory,
20
 
almost impossible to operate it!
 
23
This module is for parsing an InterPro XML file and persist the
 
24
resulting terms to a Biosql database as soon as the term is complete
 
25
as signaled by the appropriate xml tag. This parser takes advantage of
 
26
SAX, a stream-based XML parser technology, to keep the used memory as
 
27
small as possible. The alternative parser for InterPro, module
 
28
InterProHandler, builds up the entire ontology in memory, which given
 
29
the size of the latest InterPro releases requires a huge amount of
 
30
memory.
 
31
 
 
32
This module takes the following non-standard arguments upon
 
33
instantiation.
 
34
 
 
35
   -db           the adaptor factory as returned by a call to
 
36
                 Bio::DB::BioDB->new()
 
37
   -version      the InterPro version (not available as property!)
 
38
   -term_factory the object factory to use for creating terms
 
39
 
 
40
Note that there are two alternatives for how to persist the terms and
 
41
relationships to the database. The default is using the adaptor
 
42
factory passed as -db or set as a property to create persistent
 
43
objects and store them in the database. The alternative is to specify
 
44
a term persistence and a relationship persistence handler; if one or
 
45
both have been set, the respective handler will be called with each
 
46
term and relationship that is to be stored. See properties
 
47
persist_term_handler and persist_relationship_handler.
21
48
 
22
49
=head1 AUTHOR
23
50
 
24
51
Juguang Xiao, juguang@tll.org.sg
25
52
 
 
53
=head1 Contributors
 
54
 
 
55
Hilmar Lapp, hlapp at gmx.net
 
56
 
26
57
=head2 APPENDIX
27
58
 
28
59
The rest of the documentation details each of the object methods.
32
63
 
33
64
package Bio::OntologyIO::Handlers::InterPro_BioSQL_Handler;
34
65
use strict;
35
 
use vars qw(@ISA);
36
 
use Bio::OntologyIO::Handlers::BaseSAXHandler;
37
66
use Bio::Ontology::Ontology;
38
67
use Bio::Ontology::Term;
 
68
use Bio::Ontology::TermFactory;
39
69
use Bio::Ontology::RelationshipType;
40
70
use Bio::Ontology::Relationship;
41
71
use Bio::Annotation::DBLink;
42
72
use Bio::Annotation::Reference;
43
73
 
44
 
@ISA = qw(Bio::OntologyIO::Handlers::BaseSAXHandler);
 
74
use base qw(Bio::OntologyIO::Handlers::BaseSAXHandler);
45
75
 
46
76
my $is_a_rel;
47
77
my $count=0;
49
79
sub _initialize {
50
80
    my($self,@args)=@_;
51
81
    $self->SUPER::_initialize(@args);
52
 
    my ($db, $version) = $self->_rearrange(
53
 
        [qw(DB  VERSION)], @args);
54
 
    defined $db or $self->throw('db must be assigned');
55
 
    $self->_db($db);
56
 
    my $ontology = Bio::Ontology::Ontology->new(
57
 
        -name => 'InterPro',
58
 
        -definition => "InterPro, $version"
59
 
    );
 
82
    my ($db, $version, $fact) = $self->_rearrange(
 
83
        [qw(DB  VERSION TERM_FACTORY)], @args);
 
84
    $self->db($db) if $db; # this is now a property and may be set later
 
85
    if (!$fact) {
 
86
        $fact = Bio::Ontology::TermFactory->new(-type=>"Bio::Ontology::Term");
 
87
    }
 
88
    $self->term_factory($fact);
 
89
    my $ontology = Bio::Ontology::Ontology->new(-name => 'InterPro');
 
90
    if (defined($version)) {
 
91
        $version = "InterPro version $version";
 
92
        $ontology->definition($version);
 
93
    }
60
94
    $self->_ontology($ontology);
61
95
    $is_a_rel = Bio::Ontology::RelationshipType->get_instance('IS_A');
62
96
    $is_a_rel->ontology($ontology);
63
97
}
64
98
 
 
99
=head2 term_factory
 
100
 
 
101
 Title   : term_factory
 
102
 Usage   : $obj->term_factory($newval)
 
103
 Function: Get/set the ontology term factory to use.
 
104
 
 
105
           As a user of this module it is not necessary to call this
 
106
           method as there will be default. In order to change the
 
107
           default, the easiest way is to instantiate
 
108
           L<Bio::Ontology::TermFactory> with the proper -type
 
109
           argument. Most if not all parsers will actually use this
 
110
           very implementation, so even easier than the aforementioned
 
111
           way is to simply call
 
112
           $ontio->term_factory->type("Bio::Ontology::MyTerm").
 
113
 
 
114
 Example : 
 
115
 Returns : value of term_factory (a Bio::Factory::ObjectFactoryI object)
 
116
 Args    : on set, new value (a Bio::Factory::ObjectFactoryI object, optional)
 
117
 
 
118
 
 
119
=cut
 
120
 
 
121
sub term_factory{
 
122
    my $self = shift;
 
123
 
 
124
    return $self->{'term_factory'} = shift if @_;
 
125
    return $self->{'term_factory'};
 
126
}
 
127
 
 
128
=head2 db
 
129
 
 
130
 Title   : db
 
131
 Usage   : $obj->db($newval)
 
132
 Function: Sets or retrieves the database adaptor factory. 
 
133
 
 
134
           The adaptor factory is a Bio::DB::DBAdaptorI compliant
 
135
           object and will be used to obtain the persistence adaptors
 
136
           necessary to serialize terms and relationships to the
 
137
           database.
 
138
 
 
139
           Usually, you will obtain such an object from a call to
 
140
           Bio::DB::BioDB. You *must* set this property before
 
141
           starting the parse.
 
142
 
 
143
           Note that this property is immutable once set, except that
 
144
           you may set it to undef. Therefore, be careful not to set
 
145
           to undef before setting the desired real value.
 
146
 
 
147
 Example : 
 
148
 Returns : value of db (a Bio::DB::DBAdaptorI compliant object)
 
149
 Args    : on set, new value (a Bio::DB::DBAdaptorI compliant object
 
150
           or undef, optional)
 
151
 
 
152
 
 
153
=cut
 
154
 
 
155
sub db {
 
156
    my $self=shift;
 
157
    if(@_){
 
158
        my $db = shift;
 
159
        if ($db && exists($self->{_db}) && ($self->{_db} != $db)) { 
 
160
            $self->throw('db may not be modified once set'); 
 
161
        }
 
162
        $self->{_db}=$db;
 
163
    }
 
164
    return $self->{_db};
 
165
}
 
166
 
 
167
=head2 persist_term_handler
 
168
 
 
169
 Title   : persist_term_handler
 
170
 Usage   : $obj->persist_term_handler($handler,@args)
 
171
 Function: Sets or retrieves the persistence handler for terms along
 
172
           with the constant set of arguments to be passed to the 
 
173
           handler.
 
174
 
 
175
           If set, the first argument will be treated as a closure and
 
176
           be called for each term to persist to the database. The
 
177
           term will be passed as a named parameter (-term), followed
 
178
           by the other arguments passed to this setter. Note that
 
179
           this allows to pass an arbitrary configuration to the
 
180
           handler.
 
181
 
 
182
           If not set, terms will be persisted along with their
 
183
           relationships using the respective persistence adaptor
 
184
           returned by the adaptor factory (see property db).
 
185
 
 
186
 Example : 
 
187
 Returns : an array reference with the values passed on set, or an empty
 
188
           array if never set
 
189
 Args    : On set, an array of values. The first value is the handler
 
190
           as a closure; all other values will be passed to the handler
 
191
           as constant argument.
 
192
 
 
193
 
 
194
=cut
 
195
 
 
196
sub persist_term_handler{
 
197
    my $self = shift;
 
198
 
 
199
    return $self->{'persist_term_handler'} = [@_] if @_;
 
200
    return $self->{'persist_term_handler'} || [];
 
201
}
 
202
 
 
203
=head2 persist_relationship_handler
 
204
 
 
205
 Title   : persist_relationship_handler
 
206
 Usage   : $obj->persist_relationship_handler($handler,@args)
 
207
 Function: Sets or retrieves the persistence handler for relationships
 
208
           along with the constant set of arguments to be passed to
 
209
           the handler.
 
210
 
 
211
           If set, the first argument will be treated as a closure and
 
212
           be called for each relationship to persist to the database. The
 
213
           relationship will be passed as a named parameter (-rel), followed
 
214
           by the other arguments passed to this setter. Note that
 
215
           this allows to pass an arbitrary configuration to the
 
216
           handler.
 
217
 
 
218
           If not set, relationships will be persisted along with their
 
219
           relationships using the respective persistence adaptor
 
220
           returned by the adaptor factory (see property db).
 
221
 
 
222
 Example : 
 
223
 Returns : an array reference with the values passed on set, or an empty
 
224
           array if never set
 
225
 Args    : On set, an array of values. The first value is the handler
 
226
           as a closure; all other values will be passed to the handler
 
227
           as constant argument.
 
228
 
 
229
 
 
230
=cut
 
231
 
 
232
sub persist_relationship_handler{
 
233
    my $self = shift;
 
234
 
 
235
    return $self->{'persist_relationship_handler'} = [@_] if @_;
 
236
    return $self->{'persist_relationship_handler'} || [];
 
237
}
 
238
 
 
239
=head2 _persist_term
 
240
 
 
241
 Title   : _persist_term
 
242
 Usage   :
 
243
 Function: Persists a term to the database, using either a previously 
 
244
           set persistence handler, or the adaptor factory directly.
 
245
 Example :
 
246
 Returns : 
 
247
 Args    : the ontology term to persist
 
248
 
 
249
 
 
250
=cut
 
251
 
 
252
sub _persist_term {
 
253
    my $self = shift;
 
254
    my $term = shift;
 
255
 
 
256
    my ($handler,@args) = @{$self->persist_term_handler};
 
257
    if ($handler) {
 
258
        &$handler('-term' => $term, @args);
 
259
    } else {
 
260
        # no handler; we'll do this ourselves straight and simple
 
261
        my $db = $self->db();
 
262
        my $pterm = $db->create_persistent($term);
 
263
        eval { 
 
264
            $pterm->create(); 
 
265
            $pterm->commit();
 
266
        };
 
267
        if ($@) {
 
268
            $pterm->rollback();
 
269
            $self->warn("failed to store term '".$term->name."': ".$@);
 
270
        }
 
271
    }
 
272
}
 
273
 
 
274
=head2 _persist_relationship
 
275
 
 
276
 Title   : _persist_relationship
 
277
 Usage   :
 
278
 Function: Persists a relationship to the database, using either a
 
279
           previously set persistence handler, or the adaptor factory
 
280
           directly.
 
281
 
 
282
 Example :
 
283
 Returns : 
 
284
 Args    : the term relationship to persist
 
285
 
 
286
 
 
287
=cut
 
288
 
 
289
sub _persist_relationship {
 
290
    my $self = shift;
 
291
    my $rel = shift;
 
292
 
 
293
    my ($handler,@args) = @{$self->persist_relationship_handler};
 
294
    if ($handler) {
 
295
        &$handler('-rel' => $rel, @args);
 
296
    } else {
 
297
        # no handler; we'll do this ourselves straight and simple
 
298
        my $db = $self->db();
 
299
        my $prel = $db->create_persistent($rel);
 
300
        eval { 
 
301
            $prel->create(); 
 
302
            $prel->commit();
 
303
        };
 
304
        if ($@) {
 
305
            $prel->rollback();
 
306
            $self->warn("failed to store relationship of subject '"
 
307
                        .$rel->subject_term->name."' to object '"
 
308
                        .$rel->object_term->name.": ".$@);
 
309
        }
 
310
    }
 
311
}
 
312
 
 
313
=head2 _persist_ontology
 
314
 
 
315
 Title   : _persist_ontology
 
316
 Usage   :
 
317
 Function: Perists the ontology itself to the database, by either 
 
318
           inserting or updating it.
 
319
 
 
320
           Note that this will only create or update the ontology as
 
321
           an entity, not any of its terms, relationships, or
 
322
           relationship types.
 
323
 
 
324
 Example :
 
325
 Returns : the ontology as a peristent object with primary key
 
326
 Args    : the ontology to persist as a Bio::Ontology::OntologyI
 
327
           compliant object
 
328
 
 
329
 
 
330
=cut
 
331
 
 
332
sub _persist_ontology{
 
333
    my $self = shift;
 
334
    my $ont = shift;
 
335
    my $db = $self->db();
 
336
 
 
337
    # do a lookup first; chances are we have this already in the database
 
338
    my $adp = $db->get_object_adaptor($ont);
 
339
    # to avoid clobbering this ontology's properties with possibly older ones
 
340
    # from the database we'll need an object factory
 
341
    my $ontfact = 
 
342
        Bio::Factory::ObjectFactory->new(-type=>"Bio::Ontology::Ontology");
 
343
    # do the lookup:
 
344
    my $found = $adp->find_by_unique_key($ont, '-obj_factory' => $ontfact);
 
345
    # make a persistent object of the ontology
 
346
    $ont = $db->create_persistent($ont);
 
347
    # transfer primary key if found in the lookup
 
348
    $ont->primary_key($found->primary_key) if $found;
 
349
    # insert or update
 
350
    my $result;
 
351
    eval {
 
352
        $result = $ont->store();
 
353
    };
 
354
    if ($@ || !$result) {
 
355
        $adp->rollback();
 
356
        $self->throw("failed to update ontology '"
 
357
                     .$ont->name."' in database".($@ ? ": $@" : ""));
 
358
    }
 
359
 
 
360
    # done - we don't commit here
 
361
    return ref($result) ? $result : $ont;
 
362
}
 
363
 
65
364
sub start_document {
66
365
    my $self = shift;
67
366
    my $ont = $self->_ontology;
68
 
    my $db = $self->_db;
69
 
    $ont->add_term($self->create_term(-identifier=>'Family', -name=>'Family'));
70
 
    $ont->add_term($self->create_term(-identifier=>'Domain', -name=>'Domain'));
71
 
    $ont->add_term($self->create_term(-identifier=>'Repeat', -name=>'Repeat'));
72
 
    $ont->add_term($self->create_term(-identifier=>'PTM', 
73
 
        -name=>'post-translational modification'));
74
 
    $ont->add_term($self->create_term(
75
 
        -identifier=>'Active_site', -name=>'Active_site'));
76
 
    $ont->add_term($self->create_term(
77
 
        -identifier=>'Binding_site', -name=>'Binding_site'));
78
 
 
 
367
    my @iprtypes = (
 
368
                    $self->create_term(-identifier=>'IPR:Family', 
 
369
                                       -name=>'Family',
 
370
                                       -ontology => $ont),
 
371
                    $self->create_term(-identifier=>'IPR:Domain', 
 
372
                                       -name=>'Domain',
 
373
                                       -ontology => $ont),
 
374
                    $self->create_term(-identifier=>'IPR:Repeat', 
 
375
                                       -name=>'Repeat',
 
376
                                       -ontology => $ont),
 
377
                    $self->create_term(-identifier=>'IPR:PTM', 
 
378
                                       -name=>'post-translational modification',
 
379
                                       -ontology => $ont),
 
380
                    $self->create_term(-identifier=>'IPR:Active_site', 
 
381
                                       -name=>'Active_site',
 
382
                                       -ontology => $ont),
 
383
                    $self->create_term(-identifier=>'IPR:Binding_site', 
 
384
                                       -name=>'Binding_site',
 
385
                                       -ontology => $ont),
 
386
                    );
 
387
    foreach my $iprtype (@iprtypes) {
 
388
        $self->_persist_term($iprtype);
 
389
        $ont->add_term($iprtype);
 
390
    }
79
391
}
80
392
 
81
393
sub start_element {
89
401
        my $term = $self->create_term(-identifier=>$id);
90
402
        $term->ontology($ont);
91
403
        $term->add_synonym($args{short_name});
92
 
        $term->definition();
 
404
        #$term->definition();
93
405
        
94
 
        my $object_term =
95
 
            ($ont->engine->get_term_by_identifier($args{type}))[0];
 
406
        my ($object_term) =
 
407
            ($ont->engine->get_term_by_identifier("IPR:".$args{type}));
96
408
        
97
409
        my $rel = Bio::Ontology::Relationship->new(
98
410
            -subject_term => $term,
110
422
            my $example = $self->_current_hash->{example};
111
423
            $example->database($args{db});
112
424
            $example->primary_id($args{dbkey});
113
 
            print "EXAmPLE:\t", $example->database, '|', $example->primary_id, "\n";
 
425
            #print "EXAmPLE:\t", $example->database, '|', $example->primary_id, "\n";
114
426
        }elsif($top eq 'child'){
115
427
            ;
116
428
        }elsif($top eq 'member_list'){
124
436
        }elsif($top eq 'publication'){
125
437
            if($args{db} eq 'MEDLINE'){
126
438
                $self->_current_hash->{medline} =$args{dbkey};
 
439
            } elsif($args{db} eq 'PUBMED'){
 
440
                $self->_current_hash->{pubmed} =$args{dbkey};
127
441
            }else{
128
 
                print "Anywhere else??!!\n";
 
442
                $self->warn("'".$args{dbkey}."' is not a MEDLINE publication, "
 
443
                            ."don't know how to handle");
129
444
            }
130
445
        }elsif($top eq 'structure_db_links'){
131
446
            ;
132
447
        }elsif($top eq 'abstract'){
133
448
            ;
134
 
        }else{
135
 
            print "Possible??--$top\n";
136
449
        }
 
450
        #else{
 
451
        #    $self->warn("unrecognized element '$top' in element '$tag', ignoring");
 
452
        #}
137
453
    }elsif($tag eq 'publication'){
138
 
        my $publication = Bio::Annotation::Reference->new(
139
 
            -medline => $args{id});
 
454
        my $publication = Bio::Annotation::Reference->new();
140
455
        $self->_current_hash->{publication} = $publication;
141
456
    }elsif($tag eq 'author_list'){
142
457
        ;
146
461
        ;
147
462
    }elsif($tag eq 'year'){
148
463
        ;
149
 
    }else{
150
 
        ;
 
464
    } elsif (($tag eq 'dbinfo') && ($self->_top_tag eq 'release')) {
 
465
        my $entrydate = $args{file_date} || '';
 
466
        $entrydate =~ s/ \d{2}:\d{2}:\d{2}//;
 
467
        my $def = $ont->definition() || '';
 
468
        $def .= "\n" if length($def) > 0;
 
469
        $def .= $args{dbname}." version ".$args{version}.", "
 
470
            .$args{entry_count}." entries, ".$entrydate;
 
471
        $ont->definition($def);
151
472
    }
 
473
    #else{
 
474
    #    $self->warn("unrecognized element '$tag', ignoring");
 
475
    #}
152
476
        
153
477
    $self->_visited_count_inc($tag);
154
478
    $self->_push_tag($tag);
161
485
    my $chars_in=$self->_chars_hash->{$tag};
162
486
    if($tag eq 'interpro'){
163
487
        my $rel = $self->_relationship;
164
 
        my $db = $self->_db;
165
 
        my $prel = $db->create_persistent($rel);
166
 
        eval {$prel->create};
167
 
        if($@){
168
 
            my $interpro = $rel->subject_term;
169
 
            print STDERR "$@\n\n\n\n";
170
 
            print STDERR "$interpro\n\n\n", '-'x80, "\n";
171
 
        }
172
 
#        print $count++, "\n";
 
488
        # store subject term first in order to give the handler a chance to
 
489
        # apply whatever custom behaviour
 
490
        # (note that the object term is the InterPro type and has been stored
 
491
        # at the start of the whole document)
 
492
        $self->_persist_term($rel->subject_term);
 
493
        # the store the relationship to the InterPro type
 
494
        $self->_persist_relationship($rel);
173
495
    }elsif($tag eq 'name'){
174
496
        my $rel = $self->_relationship;
175
497
        $rel->subject_term->name($self->_chars_hash->{name});
194
516
        $self->_current_hash->{author} =$chars_in;
195
517
    }elsif($tag eq 'title'){
196
518
        $self->_current_hash->{title}=$chars_in;
 
519
    } elsif ($tag eq 'release') {
 
520
        my $ont = $self->_persist_ontology($self->_ontology);
 
521
        $self->_ontology($ont) if $ont;
197
522
    }
198
523
    $self->_pop_tag;
199
524
    $self->_visited_count_dec($tag);
211
536
}
212
537
 
213
538
sub create_term {
214
 
    my ($self, @args) = @_;
215
 
    my $term = Bio::Ontology::Term->new(@args);
216
 
    return $term;
217
 
}
218
 
 
219
 
sub _db {
220
 
    my $self=shift;
221
 
    if(@_){
222
 
        my $db = shift;
223
 
        if(exists $self->{_db}){ $self->throw('db can be set only once'); }
224
 
        $self->{_db}=$db;
225
 
    }
226
 
    return $self->{_db};
 
539
    return shift->term_factory->create_object(@_);
227
540
}
228
541
 
229
542
sub _ontology {
230
543
    my $self = shift;
231
 
    $self->{_ontology}=shift if @_;
 
544
    return $self->{_ontology}=shift if @_;
232
545
    return $self->{_ontology};
233
546
}
234
547
 
239
552
}
240
553
sub _create_publication {
241
554
    my $self=shift;
242
 
    my $publication = $self->_current_hash->{publication};
243
 
    my $author = $self->_current_hash->{author};
244
 
    my $journal = $self->_current_hash->{journal};
245
 
    my $year = $self->_current_hash->{year};
246
 
    my $page_location = $self->_current_hash->{page_location};
247
 
    my $volumn = $self->_current_hash->{volumn};
248
 
    $publication->authors($author);
249
 
    $publication->location("$journal, $year, V $volumn, $page_location");
250
 
    my $title = $self->_current_hash->{title};
251
 
    $publication->title($title);
252
 
    my $medline = $self->_current_hash->{medline};
253
 
    $publication->medline($medline);
 
555
    my $publ = $self->_current_hash->{publication};
 
556
    my $journal = $self->_current_hash->{journal} || '<no journal>';
 
557
    my $year = $self->_current_hash->{year} || '<no year>';
 
558
    my $page_location = $self->_current_hash->{page_location} || '<no pages>';
 
559
    my $volumn = $self->_current_hash->{volumn} || '<no volume>';
 
560
    my $medline = 
 
561
        $self->_current_hash->{medline} || $self->_current_hash->{pubmed};
 
562
 
 
563
    $publ->authors($self->_current_hash->{author});
 
564
    $publ->location("$journal, $year, V $volumn, $page_location");
 
565
    $publ->title($self->_current_hash->{title});
 
566
    $publ->medline($medline);
 
567
    if ($self->_current_hash->{pubmed}
 
568
        && ($self->_current_hash->{pubmed} != $medline)) {
 
569
        $publ->pubmed($self->_current_hash->{pubmed});
 
570
    }
254
571
    
255
572
# Clear the above in current hash
256
573
    $self->_current_hash->{publication} = undef;
261
578
    $self->_current_hash->{volumn}      = undef;
262
579
    $self->_current_hash->{title}       = undef;
263
580
    $self->_current_hash->{medline}     = undef;
 
581
    $self->_current_hash->{pubmed}      = undef;
264
582
}
265
583
1;