~ubuntu-branches/ubuntu/trusty/bioperl/trusty-proposed

« back to all changes in this revision

Viewing changes to Bio/Biblio/IO/medline2ref.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: medline2ref.pm,v 1.15.4.1 2006/10/02 23:10:13 sendu Exp $
 
1
# $Id: medline2ref.pm 15149 2008-12-12 10:52:28Z heikki $
2
2
#
3
3
# BioPerl module Bio::Biblio::IO::medline2ref.pm
4
4
#
301
301
#
302
302
sub _convert_date {
303
303
    my ($date) = @_;
304
 
    return undef unless
 
304
    return unless
305
305
        exists $$date{'year'} or
306
306
            exists $$date{'month'} or
307
307
                exists $$date{'day'} or
340
340
        $$person{"_$key"} = $$person{$key};
341
341
        delete $$person{$key};
342
342
    }
343
 
    new Bio::Biblio::Person (%$person);
 
343
    Bio::Biblio::Person->new(%$person);
344
344
}
345
345
 
346
346
#
354
354
 
355
355
    # create and populate both a Journal and a resulting Article objects
356
356
    my $from_journal = $$article{'journal'};
357
 
    my $journal = new Bio::Biblio::MedlineJournal;
 
357
    my $journal = Bio::Biblio::MedlineJournal->new();
358
358
    $journal->name ($$from_journal{'title'}) if defined $$from_journal{'title'};
359
359
    $journal->issn ($$from_journal{'iSSN'}) if defined $$from_journal{'iSSN'};
360
360
    $journal->abbreviation ($$from_journal{'iSOAbbreviation'}) if defined $$from_journal{'iSOAbbreviation'};
400
400
 
401
401
    # create and populate both book and resulting article objects
402
402
    my $from_book = $$article{'book'};
403
 
    my $book = new Bio::Biblio::MedlineBook;
 
403
    my $book = Bio::Biblio::MedlineBook->new();
404
404
    $book->title ($$from_book{'title'}) if defined $$from_book{'title'};
405
405
    $book->volume ($$from_book{'volume'}) if defined $$from_book{'volume'};
406
406
    $book->series ($$from_book{'collectionTitle'}) if defined $$from_book{'collectionTitle'};
417
417
    }
418
418
 
419
419
    if (defined $$from_book{'publisher'}) {
420
 
        my $publisher = new Bio::Biblio::Organisation;
 
420
        my $publisher = Bio::Biblio::Organisation->new();
421
421
        $publisher->name ($$from_book{'publisher'});
422
422
        $book->publisher ($publisher);
423
423
    }
485
485
            my $db_name = $$bank{'dataBankName'};
486
486
            if (defined $$bank{'accessionNumbers'}) {
487
487
                foreach my $accn ( @{ $$bank{'accessionNumbers'} } ) {
488
 
                    my $dblink = new Bio::Annotation::DBLink (-primary_id => $accn);
 
488
                    my $dblink = Bio::Annotation::DBLink->new(-primary_id => $accn);
489
489
                    $dblink->database ($db_name);   # it does not matter if it is undef
490
490
                    push (@references, $dblink);
491
491
                }
520
520
            my $converted = &_convert_personal_name ($$provider{'personalName'});
521
521
            push (@results, $converted) if defined $converted;
522
522
        } elsif (defined $$provider{'collectiveName'}) {
523
 
            push (@results, new Bio::Biblio::Organisation (-name => $$provider{'collectiveName'}));
 
523
            push (@results, Bio::Biblio::Organisation->new(-name => $$provider{'collectiveName'}));
524
524
        } else {
525
 
            new Bio::Biblio::Provider;
 
525
            Bio::Biblio::Provider->new();
526
526
        }
527
527
    }
528
528
    return () unless @results;