Bio-Biblio-1.70/0000755000175000017500000000000012123443121014341 5ustar carandraugcarandraugBio-Biblio-1.70/bin/0000755000175000017500000000000012123443121015111 5ustar carandraugcarandraugBio-Biblio-1.70/bin/bp_biblio0000644000175000017500000003653712123443121016773 0ustar carandraugcarandraug#!perl use utf8; # ABSTRACT: bioperl client for accessing and querying a bibliographic repository # PODNAME: bp_biblio # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 use strict; use warnings; sub get_usage { exec('perldoc',$0); } BEGIN { # add path to the directory with this script my $mylib; ($mylib = $0) =~ s|/[^/]+$||; unshift @INC, $mylib; # be prepare for command-line options/arguments use Getopt::Std; # general options use vars qw/ $opt_h $opt_v $opt_q /; # specialized options use vars qw/ $opt_a $opt_b $opt_c $opt_d $opt_D $opt_e $opt_k $opt_n $opt_p $opt_r $opt_s /; # options with a value use vars qw/ $opt_f $opt_F $opt_g $opt_i $opt_l $opt_m $opt_O $opt_V /; my $switches = 'fFgilmOV'; # these are switches taking an argument (a value) getopt ($switches); # help wanted? if ($opt_h) { print get_usage; exit 0; } } use Bio::Biblio; # to read data via SOAP use Bio::Biblio::IO; # to convert resulting XML to Biblio objects use Data::Dumper; # to print resulting data in a raw form # --- print version and exit if ($opt_v) { print "$Bio::Biblio::VERSION\n"; print "$Bio::Biblio::Revision\n"; exit 0; } # --- deal with a local file &convert_and_print ($opt_f) if $opt_f; # --- create a Biblio object; # the new() method understands the following parameters # (but none of them is mandatory - unless the default service location # is not where you want to go today): # # -location (taken from '-l' option if given) # -collection_id (taken from '-i' option if given) # -destroy_on_exit (set to false if '-k' or '-p' or '-i' are given) # # And just for information (these can be used from your script but # they are not set-able by this script): # # -access => 'soap' (not set-able here, a default value will be used) # -namespace => '...' (not set-able here, a default value will be used) # -soap (not set-able here) # # Additionally, it uses env. variable HTTPPROXY to create parameter # '-httpproxy'. # my @location = ('-location', $opt_l) if defined $opt_l; my @collection = ('-collection_id', $opt_i) if defined $opt_i; my @destroy = ('-destroy_on_exit', 0) if $opt_k or $opt_p or $opt_i; my @httpproxy = ('-httpproxy', $ENV{'HTTPPROXY'}) if defined $ENV{'HTTPPROXY'}; my $biblio = Bio::Biblio->new(@location, @collection, @destroy, @httpproxy); die "Stopped. No success in accessing the bibliographic repository.\n" unless $biblio; # # all remaining command-line arguments (if any remains after getopts) are: # -find [-attrs ] # and these (up-to-)pairs can be repeated... # # ...and it creates a query collection (perhaps more than one) and # assigns it (or the last one in case on 'chained' finds) to $bp_biblio # my ($keywords, $attrs, $next); while ($next = shift) { if ($next eq '-find') { $biblio = &_find ($biblio, $keywords, $attrs) if $keywords; $keywords = shift; undef $attrs; } elsif ($next eq '-attrs') { $attrs = shift; } } $biblio = &_find ($biblio, $keywords, $attrs) if $keywords; # # now we have either the top-level collection (if there were no -find # arguments), or a resulting collection from the -find queries above # ...let's do with it what was asked by options # # ...print the number of citations print $biblio->get_count . "\n" if $opt_c; # ...get one particular citation (this method does not use any -finds above) &convert_and_print ($biblio->get_by_id ($opt_g)) if $opt_g; # ...print all citation IDs print join ("\n", @{ $biblio->get_all_ids }) . "\n" if $opt_d; # ...print all citations - returned as one big string from the server &convert_and_print ($biblio->get_all) if $opt_s; # ... reset iteration in the collection again to the first citation if ($opt_r) { $biblio->reset_retrieval; print "Reset OK.\n" unless $opt_q; } # ...print more citations (perhaps all) - returned as an array of citations $opt_m = 100000000 if $opt_a; if (defined $opt_m) { foreach my $cit (@{ $biblio->get_more ($opt_m) }) { &convert_and_print ($cit); } } # ...print next citation from the current collection &convert_and_print ($biblio->get_next) if $opt_n; # ...check existence of a collection and completeness of its iterator if ($opt_e) { my $exists = $biblio->exists; my $has_next = $biblio->has_next if $exists; $exists = '0' unless $exists; $has_next = '0' unless $has_next; if ($opt_q) { print "$exists\n$has_next\n"; } else { print "Exists: $exists\tHas next: $has_next\n"; } } # ...destroy collection if ($opt_D) { $biblio->destroy; print "Destroyed OK.\n" unless $opt_q; } # ...print the collection ID if ($opt_p) { my $id = $biblio->get_collection_id; print "$id\n" if $id; } # ...controlled vocabularies if ($opt_V) { # ...print all vocabulary names (-Vn) if ($opt_V =~ /^n/) { print join ("\n", @{ $biblio->get_vocabulary_names }) . "\n"; } else { my ($arg, $name, $value) = split (/\:\:/, $opt_V, 3); # ...print all values from a given vocabulary (-Vv::) if ($opt_V =~ /^v/) { print join ("\n", @{ $biblio->get_all_values ($name) }) . "\n"; # ...print all entries from a given vocabulary (-Va::) } elsif ($opt_V =~ /^a/) { print Data::Dumper->Dump ( [$biblio->get_all_entries ($name)], ['All entries']); # ...print description of a given vocabulary entry (-Vd::::) } elsif ($opt_V =~ /^d/) { print $biblio->get_entry_description ($name, $value) . "\n"; # ...check existence of a vocabulary value (-Ve::::) } elsif ($opt_V =~ /^e/) { my $contains = $biblio->contains ($name, $value); $contains = '0' unless $contains; print "Value '$value' in vocabulary '$name': $contains\n" unless $opt_q; print "$contains\n" if $opt_q; } } } sub _find { my ($biblio, $keywords, $attrs) = @_; $| = 1; print "Looking for '$keywords'" . ($attrs ? " in attributes '$attrs'..." : "...") unless $opt_q; my ($new_biblio) = $biblio->find ($keywords, $attrs); print "\tFound " . $new_biblio->get_count . "\n" unless $opt_q; print "\tReturned collection is '" . $new_biblio->get_collection_id . "'.\n" if $opt_k and not $opt_q; return $new_biblio; } sub convert_and_print { my ($citation) = @_; # if no -O option given or if it is -Ox we are happy returning XML string unless (defined $opt_O and $opt_O !~ /^x/) { return if $opt_f; # we do not do a simple file reading &print_one ($citation); return; } my @args; # -Or means to return a raw hash, everything else means to return # Biblio objects - but there may be more types of them depending # also on -F (which format the citation is in) if ($opt_O =~ /^r/) { push (@args, ('-result' => 'raw')); } elsif ($opt_F and $opt_F =~ /^p/) { push (@args, ('-result' => 'pubmed2ref')); } # default: -result => 'medline2ref' # an argument to specify that we want parse XML (which we always want # but there can be various XML formats) if ($opt_F and $opt_F =~ /^p/) { push (@args, ('-format' => 'pubmedxml')); } else { push (@args, ('-format' => 'medlinexml')); } # where to take the citation from if ($opt_f) { push (@args, ('-file' => $citation)); } else { push (@args, ('-data' => $citation)); } # make an instance of a converter my $io = new Bio::Biblio::IO (@args); # and finally make the conversion while (my $bibref = $io->next_bibref) { &print_one ($bibref); } # return $io->next_bibref; } sub print_one { my ($citation) = @_; return unless defined $citation; if (ref (\$citation) eq 'SCALAR') { print $citation; } elsif (ref ($citation) =~ /^HASH|ARRAY|SCALAR$/o) { print Data::Dumper->Dump ( [$citation], ['Citation']); } else { print $citation->print_me; } } =pod =encoding utf-8 =head1 NAME bp_biblio - bioperl client for accessing and querying a bibliographic repository =head1 VERSION version 1.70 =head1 SYNOPSIS Usage: bp_biblio [vh] bp_biblio [bcFgOpq] [-l ] bp_biblio [abcdDeFknmOpqrs] [-l ] -i bp_biblio [abcdDeFknmOpqrs] [-l ] - -find \ [-attrs ]... bp_biblio [Vq] [-l ] bp_biblio [FOq] [-f ] =head1 DESCRIPTION A client showing how to use Bio::Biblio module, a module for accessing and querying a bibliographic repository. It also shows how to use modules Bio::Biblio::IO::medlinexml Bio::Biblio::IO::medline2ref which converts XML MEDLINE citations into a simple hash table and into full Perl objects. It has many options in order to cover as many methods as possible. Because of that, it can be also used as a fully functional command-line client for querying repository and retrieving citations from it. =head1 OPTIONS =head2 What service to contact: -l ... a location where a Bibliographic Query service is provided as a WebService (default: http://www.ebi.ac.uk/openbqs/services/MedlineSRS) =head2 What query collection to use: Some options do not need to specify a collection, some do. -i ... the collection ID can be obtained in a previous invocation by specifying argument '-p' (print ID) -find [-attrs ] ... create a collection from citations containing given keywords - either in all default attributes, or only in the given attributes; it is possible to repeat it, for example: -find brazma -attrs authors -find -study (the repetitions refine previous results) both and may be comma-delimited multi-values; note that '-find' must be separated from the rest of options by '-'; note that this script is a bit stupid regarding quoted keywords, or keywords containing commans... TBD better what XML format is used for citations: -Fm ... MEDLINE (default) -Fp ... PubMed =head2 What to do (with the query collection): -g ... get citation -c ... get count (a number of citations) -p ... print collection ID (which may be used in the next invocation as an '-i' argument); it implies also '-k' -b ... print citations in a non-XML format (TBD) Other options can be used only on a sub-collection - which can be obtained directly by specifying '-i' argument, or indirectly by specifying one or more queries by '-find' arguments: -d ... get all citation IDs -n ... get next citation -m [] ... get 'how_many' more -r ... reset iteration to the first citation in the collection (now you can use '-n' or '-m' again) -a ... get all citations - as an array -s ... as '-a' but get it as one string -e ... check if given collection exists and has more citations -k ... keep resulting collection persistent (makes sense only when collection IDs are being printed otherwise you would not know how to contact the persistent collection next time) -D ... destroy given collection (makes sense together with '-i') Options specifying output format of the results: -Ox ... output in XML format (default) -Oo ... output as Biblio objects -Or ... output as a raw hashtable The options above can be used also for converting an XML MEDLINE local file without using any SOAP connection at all; -f ... an XML file to be read and converted Options dealing with controlled vocabularies: -Vn ... get all vocabulary names -Vv:: ... get all values from vocabulary -Va:: ... get everything from vocabulary -Vd:::: ... get description of from vocabulary -Ve:::: ... return 1 if exists in vocabulary And the remaining options: -h ... get help -v ... get version -q ... be quiet (less verbose) =head1 EXAMPLES bp_biblio - -find Java -attrs abstract -find perl Several separate invocations sharing the same query collection: bp_biblio -p -q - -find Brazma,Robinson > b.tmp bp_biblio -i `cat b.tmp` -d MEDLINE2005/10693778 MEDLINE2005/10977099 MEDLINE2005/11726920 MEDLINE2005/12225585 MEDLINE2005/12227734 bp_biblio -i `cat b.tmp` -g 10693778 ... bp_biblio -i `cat b.tmp` -e Exists: 1 Has next: 1 bp_biblio -i `cat b.tmp` -D Destroyed OK. bp_biblio -i `cat b.tmp` -e Exists: 0 Has next: 0 Access to controlled vocabularies: bp_biblio -Vn MEDLINE2005/JournalArticle/properties MEDLINENEW/resource_types MEDLINE2005/resource_types MEDLINE2005/Person/properties MEDLINE2005/*/publication_type MEDLINENEW/JournalArticle/properties repository_subsets MEDLINE2005/*/citation_subset bp_biblio -Vv::MEDLINE2005/JournalArticle/properties AllText ID PMID ISSN ... Converting local XML MEDLINE file: bp_biblio -g 10693778 > a_file.xml bp_biblio -f a_file.xml -Oo ... to Perl objects bp_biblio -f a_file.xml -Or ... as a raw hash =head1 ENVIRONMENT VARIABLES HTTPPROXY = Use this if you use this script on a machine which needs to access remote HTTP targets via a proxy server. For example: export HTTPPROXY=http://128.243.220.41:3128 bp_biblio -c =head1 HISTORY Written February 2002 Updated July 2005 =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut __END__ Bio-Biblio-1.70/t/0000755000175000017500000000000012123443121014604 5ustar carandraugcarandraugBio-Biblio-1.70/t/release-pod-coverage.t0000644000175000017500000000076512123443121020772 0ustar carandraugcarandraug#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; eval "use Pod::Coverage::TrustPod"; plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" if $@; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Bio-Biblio-1.70/t/References.t0000644000175000017500000003211512123443121017054 0ustar carandraugcarandraug## test script for Bio::Biblio::* use utf8; use strict; use warnings; use Bio::Annotation::DBLink; use Test::More tests => 537; my @modules; BEGIN { @modules = qw( Bio::Biblio::Article Bio::Biblio::Book Bio::Biblio::BookArticle Bio::Biblio::Journal Bio::Biblio::JournalArticle Bio::Biblio::MedlineArticle Bio::Biblio::MedlineBook Bio::Biblio::MedlineBookArticle Bio::Biblio::MedlineJournal Bio::Biblio::MedlineJournalArticle Bio::Biblio::Organisation Bio::Biblio::Patent Bio::Biblio::Person Bio::Biblio::Proceeding Bio::Biblio::Provider Bio::Biblio::Ref Bio::Biblio::Service Bio::Biblio::TechReport Bio::Biblio::Thesis Bio::Biblio::WebResource Bio::Biblio::PubmedArticle Bio::Biblio::PubmedBookArticle Bio::Biblio::PubmedJournalArticle ); use_ok($_) foreach (@modules); } my ($biblio, $count, $str, @args); my ($citation, $provider); foreach my $object (@modules) { ok (defined ($biblio = $object->new())); } my @scalar_methods_for_ref = qw( abstract abstract_language abstract_type author_list_complete cross_references_list_complete date date_completed date_created date_revised format identifier language last_modified_date repository_subset rights spatial_location subject_headings_source temporal_period title toc toc_type type ); my @other_methods_for_ref = qw( authors cross_references codes contributors keywords publisher subject_headings ); my @scalar_methods_for_book = qw( edition isbn series volume ); my @other_methods_for_book = qw( editor ); my @scalar_methods_for_bookarticle = qw( ); my @other_methods_for_bookarticle = qw( book ); my @scalar_methods_for_article = qw( first_page last_page ); my @other_methods_for_article = qw( ); my @scalar_methods_for_journalarticle = qw( issue issue_supplement volume ); my @other_methods_for_journalarticle = qw( journal ); my @scalar_methods_for_medlinearticle = qw( affiliation citation_owner date_of_electronic_publication gene_symbols grant_list_complete medline_date medline_id medline_page number_of_references other_languages pmid season status vernacular_title ); my @other_methods_for_medlinearticle = qw( chemicals comment_ins comment_ons erratum_fors erratum_ins general_notes grants mesh_headings original_report_ins other_abstracts other_ids republished_froms republished_ins retraction_ins retraction_ofs summary_for_patients_ins update_ins update_ofs ); my @scalar_methods_for_medlinejournalarticle = qw( ); my @other_methods_for_medlinejournalarticle = qw( journal ); my @scalar_methods_for_medlinebookarticle = qw( ); my @other_methods_for_medlinebookarticle = qw( book ); my @scalar_methods_for_medlinebook = qw( ); my @other_methods_for_medlinebook = qw( ); my @scalar_methods_for_pubmedarticle = qw( pubmed_status pubmed_provider_id ); my @other_methods_for_pubmedarticle = qw( pubmed_history_list pubmed_article_id_list pubmed_url_list ); my @scalar_methods_for_journal = qw( abbreviation issn name ); my @other_methods_for_journal = qw( ); my @scalar_methods_for_medlinejournal = qw( coden country medline_code medline_ta nlm_unique_id ); my @other_methods_for_medlinejournal = qw( ); my @scalar_methods_for_patent = qw( doc_number doc_office doc_type ); my @other_methods_for_patent = qw( applicants ); my @scalar_methods_for_webresource = qw( url estimated_size cost ); my @other_methods_for_webresource = qw( ); my @scalar_methods_for_provider = qw( type ); my @scalar_methods_for_person = qw( affiliation email firstname forename initials lastname middlename postal_address suffix ); my @scalar_methods_for_organisation = qw( name ); my @scalar_methods_for_service = qw( name ); # # Bio::Biblio::MedlineJournalArticle # $citation = Bio::Biblio::MedlineJournalArticle->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_ref, @scalar_methods_for_article, @scalar_methods_for_journalarticle, @scalar_methods_for_medlinearticle, @scalar_methods_for_medlinejournalarticle) { $str = 'string' . ($count++); is $citation->$method ($str), $str, "set '$method'"; is $citation->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::MedlineJournalArticle->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $citation->$method(), $args[$i+1], $method; } foreach my $method (@other_methods_for_ref, @other_methods_for_article, @other_methods_for_journalarticle, @other_methods_for_medlinearticle, @other_methods_for_medlinejournalarticle) { is $citation->$method(), undef, "get '$method'"; } my ($me) = Bio::Biblio::Person->new(-lastname => 'me'); my ($you) = Bio::Biblio::Person->new(-lastname => 'you'); ok $citation->add_author ($me), "add_author 1"; ok $citation->add_author ($you), "add_author 2"; is ${ $citation->authors }[1]->lastname, 'you', "get authors"; ok $citation->add_contributor ($me), "add_contributor 1"; ok $citation->add_contributor ($you), "add_contributor 2"; is ${ $citation->contributors }[1]->lastname, 'you', "get contributors"; my $link1 = Bio::Annotation::DBLink->new(-database => 'here', -primary_id => '001' ); my $link2 = Bio::Annotation::DBLink->new(-database => 'there', -primary_id => '002' ); ok $citation->add_cross_reference ($link1), "add_cross_reference 1"; ok $citation->add_cross_reference ($link2), "add_cross_reference 2"; is ${ $citation->cross_references }[0]->database, 'here', "get cross_references"; is ${ $citation->cross_references }[1]->primary_id, '002', "get cross_references"; # # Bio::Biblio::MedlineBookArticle # $citation = Bio::Biblio::MedlineBookArticle->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_ref, @scalar_methods_for_article, @scalar_methods_for_bookarticle, @scalar_methods_for_medlinearticle, @scalar_methods_for_medlinebookarticle) { $str = 'string' . ($count++); is $citation->$method ($str), $str, "set '$method'"; is $citation->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::MedlineBookArticle->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $citation->$method(), $args[$i+1], $method; } foreach my $method (@other_methods_for_ref, @other_methods_for_article, @other_methods_for_bookarticle, @other_methods_for_medlinearticle, @other_methods_for_medlinebookarticle) { is $citation->$method(), undef, "get '$method'"; } # # Bio::Biblio::MedlineBook # $citation = Bio::Biblio::MedlineBook->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_ref, @scalar_methods_for_book, @scalar_methods_for_medlinebook) { $str = 'string' . ($count++); is $citation->$method ($str), $str, "set '$method'"; is $citation->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::MedlineBook->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $citation->$method(), $args[$i+1], $method; } foreach my $method (@other_methods_for_ref, @other_methods_for_book, @other_methods_for_medlinebook) { is $citation->$method(), undef, "get '$method'"; } # # Bio::Biblio::MedlineJournal # $citation = Bio::Biblio::MedlineJournal->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_journal, @scalar_methods_for_medlinejournal) { $str = 'string' . ($count++); is $citation->$method ($str), $str, "set '$method'"; is $citation->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::MedlineJournal->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $citation->$method(), $args[$i+1], $method; } foreach my $method (@other_methods_for_journal, @other_methods_for_medlinejournal) { is $citation->$method(), undef, "get '$method'"; } # # Bio::Biblio::Patent # $citation = Bio::Biblio::Patent->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_patent) { $str = 'string' . ($count++); is $citation->$method ($str), $str, "set '$method'"; is $citation->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::Patent->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $citation->$method(), $args[$i+1], $method; } foreach my $method (@other_methods_for_patent) { is $citation->$method(), undef, "get '$method'"; } # # Bio::Biblio::WebResource # $citation = Bio::Biblio::WebResource->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_webresource) { $str = 'string' . ($count++); is $citation->$method ($str), $str, "set '$method'"; is $citation->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::WebResource->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $citation->$method(), $args[$i+1], $method; } foreach my $method (@other_methods_for_webresource) { is $citation->$method(), undef, "get '$method'"; } # # Bio::Biblio::Person # $provider = Bio::Biblio::Person->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_provider, @scalar_methods_for_person) { $str = 'string' . ($count++); is $provider->$method ($str), $str, "set '$method'"; is $provider->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::Person->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $provider->$method(), $args[$i+1], $method; } # # Bio::Biblio::Organisation # $provider = Bio::Biblio::Organisation->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_provider, @scalar_methods_for_organisation) { $str = 'string' . ($count++); is $provider->$method ($str), $str, "set '$method'"; is $provider->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::Organisation->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $provider->$method(), $args[$i+1], $method; } # # Bio::Biblio::Service # $provider = Bio::Biblio::Service->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_provider, @scalar_methods_for_organisation) { $str = 'string' . ($count++); is $provider->$method ($str), $str, "set '$method'"; is $provider->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::Service->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $provider->$method(), $args[$i+1], $method; } # # Bio::Biblio::PubmedJournalArticle # $citation = Bio::Biblio::PubmedJournalArticle->new(); @args = (); $count = 1; foreach my $method (@scalar_methods_for_pubmedarticle) { $str = 'string' . ($count++); is $citation->$method ($str), $str, "set '$method'"; is $citation->$method(), $str, "get '$method'"; push (@args, ("-$method" => $str)); } ok defined ($biblio = Bio::Biblio::PubmedJournalArticle->new(@args)); for (my $i = 0; $i < @args; $i += 2) { my $method = substr ($args[$i], 1); is $citation->$method(), $args[$i+1], $method; } foreach my $method (@other_methods_for_pubmedarticle) { is $citation->$method(), undef, "get '$method'"; } Bio-Biblio-1.70/t/00-compile.t0000644000175000017500000000312612123443121016640 0ustar carandraugcarandraug#!perl use strict; use warnings; use Test::More; use File::Find; use File::Temp qw{ tempdir }; my @modules; find( sub { return if $File::Find::name !~ /\.pm\z/; my $found = $File::Find::name; $found =~ s{^lib/}{}; $found =~ s{[/\\]}{::}g; $found =~ s/\.pm$//; # nothing to skip push @modules, $found; }, 'lib', ); sub _find_scripts { my $dir = shift @_; my @found_scripts = (); find( sub { return unless -f; my $found = $File::Find::name; # nothing to skip open my $FH, '<', $_ or do { note( "Unable to open $found in ( $! ), skipping" ); return; }; my $shebang = <$FH>; return unless $shebang =~ /^#!.*?\bperl\b\s*$/; push @found_scripts, $found; }, $dir, ); return @found_scripts; } my @scripts; do { push @scripts, _find_scripts($_) if -d $_ } for qw{ bin script scripts }; my $plan = scalar(@modules) + scalar(@scripts); $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run"); { # fake home for cpan-testers # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 ); like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" ) for sort @modules; SKIP: { eval "use Test::Script 1.05; 1;"; skip "Test::Script needed to test script compilation", scalar(@scripts) if $@; foreach my $file ( @scripts ) { my $script = $file; $script =~ s!.*/!!; script_compiles( $file, "$script script compiles" ); } } } Bio-Biblio-1.70/t/eutils.t0000644000175000017500000000105212123443121016274 0ustar carandraugcarandraug## test script for Bio::DB::Biblio::eutils use utf8; use strict; use warnings; use Test::More tests => 3; BEGIN { use_ok("Bio::Biblio"); } my $db = Bio::Biblio->new(-access => "eutils"); ok (defined ($db) && ref ($db) eq "Bio::DB::Biblio::eutils"); ## these aren't exactly the most stringent of tests my $search = '"Day A"[AU] AND ("Database Management Systems"[MH] OR "Databases,'. ' Genetic"[MH] OR "Software"[MH] OR "Software Design"[MH])'; $db->find($search); my $ct = 0; $ct++ while (my $xml = $db->get_next); cmp_ok ($ct, ">=", 4); Bio-Biblio-1.70/t/release-pod-syntax.t0000644000175000017500000000045012123443121020514 0ustar carandraugcarandraug#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); Bio-Biblio-1.70/t/release-mojibake.t0000644000175000017500000000064412123443121020174 0ustar carandraugcarandraug#!perl BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings qw(all); use Test::More; ## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval) eval q(use Test::Mojibake); plan skip_all => q(Test::Mojibake required for source encoding testing) if $@; all_files_encoding_ok(); Bio-Biblio-1.70/t/release-no-tabs.t0000644000175000017500000000045012123443121017751 0ustar carandraugcarandraug BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; eval 'use Test::NoTabs'; plan skip_all => 'Test::NoTabs required' if $@; all_perl_files_ok(); Bio-Biblio-1.70/t/biofetch.t0000644000175000017500000000117612123443121016561 0ustar carandraugcarandraug## test script for Bio::DB::Biblio::biofetch use utf8; use strict; use warnings; use Test::More tests => 10; BEGIN { use_ok("Bio::Biblio"); } my $db = Bio::Biblio->new(-access => 'biofetch'); ok (defined ($db) && ref ($db) eq "Bio::DB::Biblio::biofetch"); my $ref; my @ids; $ref = $db->get_by_id("10592273"); ok (defined ($ref)); is ($ref->identifier, "10592273"); @ids = qw(10592273 9613206); $ref = $db->get_all(\@ids); ok (defined ($ref)); is ($ref->next_bibref->identifier, $_) for (@ids); @ids = qw(10592273 9613206); $ref = $db->get_Stream_by_id(\@ids); ok (defined ($ref)); is ($ref->next_bibref->identifier, $_) for (@ids); Bio-Biblio-1.70/t/release-eol.t0000644000175000017500000000047612123443121017175 0ustar carandraugcarandraug BEGIN { unless ($ENV{RELEASE_TESTING}) { require Test::More; Test::More::plan(skip_all => 'these tests are for release candidate testing'); } } use strict; use warnings; use Test::More; eval 'use Test::EOL'; plan skip_all => 'Test::EOL required' if $@; all_perl_files_ok({ trailing_whitespace => 1 }); Bio-Biblio-1.70/t/Biblio.t0000644000175000017500000000701612123443121016175 0ustar carandraugcarandraug## test script for Bio::Biblio and Bio::Biblio::IO use utf8; use strict; use warnings; use File::Spec; use Test::More tests => 24; BEGIN { use_ok("Bio::Biblio"); } BEGIN { use_ok("Bio::Biblio::IO"); } my $tfile_medline = File::Spec->catfile('t', 'data', 'stress_test_medline.xml'); my $tfile_pubmed = File::Spec->catfile('t', 'data', 'stress_test_pubmed.xml'); my $biblio = Bio::Biblio->new(-location => 'http://localhost:4567'); ok (defined ($biblio)); my $io; ## ## check MEDLINE XML parser ## $io = Bio::Biblio::IO->new('-format' => 'medlinexml', '-file' => $tfile_medline, '-result' => 'raw'); ok (defined ($io)); is ($io->next_bibref->{'medlineID'}, 'Text1', 'citation 1'); is ($io->next_bibref->{'medlineID'}, 'Text248', 'citation 2'); is ($io->next_bibref->{'medlineID'}, 'Text495', 'citation 3'); ## Getting citations using callback my @ids = ('Text1', 'Text248', 'Text495'); my $callback_used = 'no'; sub callback { my $citation = shift; $callback_used = 'yes'; is ($citation->{'_identifier'}, shift @ids, 'in callback'); } $io = Bio::Biblio::IO->new('-format' => 'medlinexml', '-file' => $tfile_medline, '-callback' => \&callback); is ($callback_used, 'yes', 'calling callback'); $io = Bio::Biblio::IO->new('-format' => 'medlinexml', '-data' => " 12345678
abcdefgh
"); is ($io->next_bibref->identifier, '12345678', 'citation 1'); is ($io->next_bibref->identifier, 'abcdefgh', 'citation 2'); ## Reading and parsing XML string handle my $data = " 87654321
hgfedcba
"; open (my $dataio, "<", \$data); $io = Bio::Biblio::IO->new('-format' => 'medlinexml', '-fh' => $dataio); is ($io->next_bibref->identifier, '87654321', 'citation 1'); is ($io->next_bibref->identifier, 'hgfedcba', 'citation 2'); ## ## check PUBMED XML parser ## $io = Bio::Biblio::IO->new('-format' => 'pubmedxml', '-file' => $tfile_pubmed); ok (defined ($io)); is ($io->next_bibref->identifier, '11223344', 'citation 1'); is ($io->next_bibref->identifier, '21583752', 'citation 2'); is ($io->next_bibref->identifier, '21465135', 'citation 3'); is ($io->next_bibref->identifier, '21138228', 'citation 4'); ## Testing FH my @expvals = qw(11223344 21583752 21465135 21138228); $io = Bio::Biblio::IO->newFh('-format' => 'pubmedxml', '-file' => $tfile_pubmed, '-result' => 'pubmed2ref'); is ($_->identifier, shift (@expvals), 'filehandle test') while (<$io>); Bio-Biblio-1.70/t/data/0000755000175000017500000000000012123443121015515 5ustar carandraugcarandraugBio-Biblio-1.70/t/data/stress_test_pubmed.xml0000644000175000017500000003543212123443121022164 0ustar carandraugcarandraug 11223344
TESTING ARTICLE
2001 12 1 10 0 2002 1 5 10 1 2003 12 1 10 0 2004 1 5 10 1 ppublish Testing provider 11726920 10.1038/ng1201-365 ng1201-365 21583752 http://myserver/mydata http://yourserver/yourdata http://anyserver/anydata
21583752 11726920 2001 11 29 2001 12 20
1061-4036 29 4 2001 Dec Minimum information about a microarray experiment (MIAME)-toward standards for microarray data. 365-71 Microarray analysis has become a widely used tool for the generation of gene expression data on a genomic scale. Although many significant results have been derived from microarray studies, one limitation has been the lack of standards for presenting and exchanging such data. Here we present a proposal, the Minimum Information About a Microarray Experiment (MIAME), that describes the minimum information required to ensure that microarray data can be easily interpreted and that results derived from its analysis can be independently verified. The ultimate goal of this work is to establish a standard for recording and reporting microarray-based gene expression data, which will in turn facilitate the establishment of databases and public repositories and enable the development of data analysis tools. With respect to MIAME, we concentrate on defining the content and structure of the necessary information rather than the technical format for capturing it. European Bioinformatics Institute, EMBL outstation, Wellcome Trust Genome Campus, Hinxton, Cambridge CB10 1SD, UK. brazma@ebi.ac.uk Brazma A A Hingamp P P Quackenbush J J Sherlock G G Spellman P P Stoeckert C C Aach J J Ansorge W W Ball C A CA Causton H C HC Gaasterland T T Glenisson P P Holstege F C FC Kim I F IF Markowitz V V Matese J C JC Parkinson H H Robinson A A Sarkans U U Schulze-Kremer S S Stewart J J Taylor R R Vilo J J Vingron M M eng Journal Article
United States Nat Genet 9216904 IM Computational Biology Gene Expression Profiling methods Oligonucleotide Array Sequence Analysis standards Support, Non-U.S. Gov't Support, U.S. Gov't, P.H.S.
2001 12 1 10 0 2002 1 5 10 1 ppublish 11726920 10.1038/ng1201-365 ng1201-365 21583752
21465135 11580977 2001 10 02 2001 12 04
1286-4579 3 10 2001 Aug Gene expression data analysis. 823-9 Microarrays are one of the latest breakthroughs in experimental molecular biology, which allow monitoring of gene expression for tens of thousands of genes in parallel and are already producing huge amounts of valuable data. Analysis and handling of such data is becoming one of the major bottlenecks in the utilization of the technology. The raw microarray data are images, which have to be transformed into gene expression matrices, tables where rows represent genes, columns represent various samples such as tissues or experimental conditions, and numbers in each cell characterize the expression level of the particular gene in the particular sample. These matrices have to be analyzed further if any knowledge about the underlying biological processes is to be extracted. In this paper we concentrate on discussing bioinformatics methods used for such analysis. We briefly discuss supervised and unsupervised data analysis and its applications, such as predicting gene function classes and cancer classification as well as some possible future directions. European Molecular Biology Laboratory, Outstation Hinxton--the European Bioinformatics Institute, Wellcome Trust Genome Campus, Hinxton, CB10 1SD, Cambridge, UK. brazma@ebi.ac.uk Brazma A A Vilo J J eng Journal Article Review Review, Tutorial
France Microbes Infect 100883508 IM Animal Computational Biology Gene Expression Regulation Human Oligonucleotide Array Sequence Analysis Statistics methods 29
2001 10 3 10 0 2002 1 5 10 1 ppublish 11580977 S128645790101440X 21465135
21138228 11238066 2001 03 12 2001 05 31
1367-4803 17 2 2001 Feb On the importance of standardisation in life sciences. 113-4 Brazma A A eng Editorial
England Bioinformatics 9808944 IM Biological Sciences Databases, Factual standards Gene Expression Profiling methods standards Human Information Storage and Retrieval standards Oligonucleotide Array Sequence Analysis methods standards Sequence Analysis, DNA
2001 3 10 10 0 2001 6 2 10 1 ppublish 11238066 21138228
Bio-Biblio-1.70/t/data/stress_test_medline.xml0000644000175000017500000011160612123443121022323 0ustar carandraugcarandraug Text1 Text2 1998 1 1 0 0 0 1999 2 2 1 1 1 2000 3 3 2 2 2
Text3 Text4 Text5 2001 4 4 Text6 Text7 Text8 Text9 Text10 Text11 Text12 Text13 Text14 Text15 Text16 Text17 Text18 Text19 Text20 Text21 Text22 Text23 Text24 Text25 Text26 Text27 Text28 Text29 Text30 Text31 Text32 Text33 Text34 Text35 Text36 Text37 Text38 Text39 Text40 Text41 Text42 Text43 Text44 Text45 Text46 Text47 Text48 Text49 Text50 Text51 Text52 Text53 Text54 Text55 Text56 Text57 Text58 Text59
Text60 Text61 Text62 Text63 Text64 Text65 Text66 Text67 Text68 Text69 Text70 Text71 Text72 Text73 Text74 Text75 Text76 Text77 Text78 Text79 Text80 Text81 Text82 Text83 Text84 Text85 Text86 Text87 Text88 Text89 Text90 Text91 Text92 Text93 Text94 Text95 Text96 Text97 Text98 Text99 Text100 Text101 Text102 Text103 Text104 Text105 Text106 Text107 Text108 Text109 Text110 Text111 Text112 Text113 Text114 Text115 Text116 Text117 Text118 Text119 Text120 Text121 Text122 Text123 Text124 Text125 Text126 Text127 Text128 Text129 Text130 Text131 Text132 Text133 Text134 Text135 Text136 Text137 Text138 Text139 Text140 Text141 Text142 Text143 Text144 Text145 Text146 Text147 Text148 Text149 Text150 Text151 Text152 Text153 Text154 Text155 Text156 Text157 Text158 Text159 Text160 Text161 Text162 Text163 Text164 Text165 Text166 Text167 Text168 Text169 Text170 Text171 Text172 Text173 Text174 Text175 Text176 Text177 Text178 Text179 Text180 Text181 Text182 Text183 Text184 Text185 Text186 Text187 Text188 Text189 Text190 Text191 Text192 Text193 Text194 Text195 Text196 Text197 Text198 Text199 Text200 Text201 Text202 Text203 Text204 Text205 Text206 Text207 Text208 Text209 Text210 Text211 Text212 Text213 Text214 Text215 Text216 Text217 Text218 Text219 Text220 Text221 Text222 Text223 Text224 Text225 Text226 Text227 Text228 Text229 Text230 Text231 Text232 Text233 Text234 Text235 Text236 Text237 Text238 Text239 Text240 Text241 Text242 Text243 Text244 Text245 Text246 Text247
Text248 Text249 1997 5 5 3 3 3 1998 6 6 4 4 4 1999 7 7 5 5 5
Text250 Text251 Text252 2000 8 8 Text253 Text254 Text255 Text256 Text257 Text258 Text259 Text260 Text261 Text262 Text263 Text264 Text265 Text266 Text267 Text268 Text269 Text270 Text271 Text272 Text273 Text274 Text275 Text276 Text277 Text278 Text279 Text280 Text281 Text282 Text283 Text284 Text285 Text286 Text287 Text288 Text289 Text290 Text291 Text292 Text293 Text294 Text295 Text296 Text297 Text298 Text299 Text300 Text301 Text302 Text303 Text304 Text305 Text306
Text307 Text308 Text309 Text310 Text311 Text312 Text313 Text314 Text315 Text316 Text317 Text318 Text319 Text320 Text321 Text322 Text323 Text324 Text325 Text326 Text327 Text328 Text329 Text330 Text331 Text332 Text333 Text334 Text335 Text336 Text337 Text338 Text339 Text340 Text341 Text342 Text343 Text344 Text345 Text346 Text347 Text348 Text349 Text350 Text351 Text352 Text353 Text354 Text355 Text356 Text357 Text358 Text359 Text360 Text361 Text362 Text363 Text364 Text365 Text366 Text367 Text368 Text369 Text370 Text371 Text372 Text373 Text374 Text375 Text376 Text377 Text378 Text379 Text380 Text381 Text382 Text383 Text384 Text385 Text386 Text387 Text388 Text389 Text390 Text391 Text392 Text393 Text394 Text395 Text396 Text397 Text398 Text399 Text400 Text401 Text402 Text403 Text404 Text405 Text406 Text407 Text408 Text409 Text410 Text411 Text412 Text413 Text414 Text415 Text416 Text417 Text418 Text419 Text420 Text421 Text422 Text423 Text424 Text425 Text426 Text427 Text428 Text429 Text430 Text431 Text432 Text433 Text434 Text435 Text436 Text437 Text438 Text439 Text440 Text441 Text442 Text443 Text444 Text445 Text446 Text447 Text448 Text449 Text450 Text451 Text452 Text453 Text454 Text455 Text456 Text457 Text458 Text459 Text460 Text461 Text462 Text463 Text464 Text465 Text466 Text467 Text468 Text469 Text470 Text471 Text472 Text473 Text474 Text475 Text476 Text477 Text478 Text479 Text480 Text481 Text482 Text483 Text484 Text485 Text486 Text487 Text488 Text489 Text490 Text491 Text492 Text493 Text494
Text495 Text496 2001 9 9 6 6 6 1997 10 10 7 7 7 1998 11 11 8 8 8
Text497 Text498 Text499 1999 12 12 Text500 Text501 Text502 Text503 Text504 Text505 Text506 Text507 Text508 Text509 Text510 Text511 Text512 Text513 Text514 Text515 Text516 Text517 Text518 Text519 Text520 Text521 Text522 Text523 Text524 Text525 Text526 Text527 Text528 Text529 Text530 Text531 Text532 Text533 Text534 Text535 Text536 Text537 Text538 Text539 Text540 Text541 Text542 Text543 Text544 Text545 Text546 Text547 Text548 Text549 Text550 Text551 Text552 Text553
Text554 Text555 Text556 Text557 Text558 Text559 Text560 Text561 Text562 Text563 Text564 Text565 Text566 Text567 Text568 Text569 Text570 Text571 Text572 Text573 Text574 Text575 Text576 Text577 Text578 Text579 Text580 Text581 Text582 Text583 Text584 Text585 Text586 Text587 Text588 Text589 Text590 Text591 Text592 Text593 Text594 Text595 Text596 Text597 Text598 Text599 Text600 Text601 Text602 Text603 Text604 Text605 Text606 Text607 Text608 Text609 Text610 Text611 Text612 Text613 Text614 Text615 Text616 Text617 Text618 Text619 Text620 Text621 Text622 Text623 Text624 Text625 Text626 Text627 Text628 Text629 Text630 Text631 Text632 Text633 Text634 Text635 Text636 Text637 Text638 Text639 Text640 Text641 Text642 Text643 Text644 Text645 Text646 Text647 Text648 Text649 Text650 Text651 Text652 Text653 Text654 Text655 Text656 Text657 Text658 Text659 Text660 Text661 Text662 Text663 Text664 Text665 Text666 Text667 Text668 Text669 Text670 Text671 Text672 Text673 Text674 Text675 Text676 Text677 Text678 Text679 Text680 Text681 Text682 Text683 Text684 Text685 Text686 Text687 Text688 Text689 Text690 Text691 Text692 Text693 Text694 Text695 Text696 Text697 Text698 Text699 Text700 Text701 Text702 Text703 Text704 Text705 Text706 Text707 Text708 Text709 Text710 Text711 Text712 Text713 Text714 Text715 Text716 Text717 Text718 Text719 Text720 Text721 Text722 Text723 Text724 Text725 Text726 Text727 Text728 Text729 Text730 Text731 Text732 Text733 Text734 Text735 Text736 Text737 Text738 Text739 Text740 Text741
Text742 Text743 Text744
Bio-Biblio-1.70/README.md0000644000175000017500000000074512123443121015626 0ustar carandraugcarandraugBio-Biblio ========== The Bio-Biblio distribution, implements both methods to access bibliographic repositories, and to handle citation files in different formats. This distribution is part of the [BioPerl](http://www.bioperl.org/) project. Dependencies ------------ This distribution requires these other modules to be installed on the system: * Bio::Annotation::DBLink * Bio::DB::DBFetch * Bio::Root::Root * Bio::Root::RootI * LWP::Simple * SOAP::Lite * URI::Escape * XML::Twig Bio-Biblio-1.70/Changes0000644000175000017500000000032012123443121015627 0ustar carandraugcarandraugSummary of important user-visible changes for Bio-Biblio -------------------------------------------------------- 1.70 2013-03-24 00:18:00 Europe/Dublin * First release after split from bioperl-live. Bio-Biblio-1.70/META.yml0000644000175000017500000001217112123443121015614 0ustar carandraugcarandraug--- abstract: 'Modules to access bibliographics repositories and handle citation files.' author: - 'BioPerl Team ' build_requires: File::Find: 0 File::Spec: 0 File::Temp: 0 Test::More: 0 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300020, CPAN::Meta::Converter version 2.120921' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Bio-Biblio requires: Bio::Annotation::DBLink: 0 Bio::DB::DBFetch: 0 Bio::Root::IO: 0 Bio::Root::Root: 0 Bio::Root::RootI: 0 Data::Dumper: 0 Getopt::Std: 0 LWP::Simple: 0 SOAP::Lite: 0 Symbol: 0 URI::Escape: 0 XML::Parser: 0 XML::Twig: 0 parent: 0 strict: 0 utf8: 0 vars: 0 warnings: 0 resources: bugtracker: https://redmine.open-bio.org/projects/bioperl/ homepage: http://search.cpan.org/dist/Bio-Biblio repository: git://github.com/bioperl/bio-biblio.git version: 1.70 x_Dist_Zilla: plugins: - class: Dist::Zilla::Plugin::GatherDir name: '@BioPerl/@Filter/GatherDir' version: 4.300020 - class: Dist::Zilla::Plugin::PruneCruft name: '@BioPerl/@Filter/PruneCruft' version: 4.300020 - class: Dist::Zilla::Plugin::ManifestSkip name: '@BioPerl/@Filter/ManifestSkip' version: 4.300020 - class: Dist::Zilla::Plugin::MetaYAML name: '@BioPerl/@Filter/MetaYAML' version: 4.300020 - class: Dist::Zilla::Plugin::License name: '@BioPerl/@Filter/License' version: 4.300020 - class: Dist::Zilla::Plugin::ExtraTests name: '@BioPerl/@Filter/ExtraTests' version: 4.300020 - class: Dist::Zilla::Plugin::ExecDir name: '@BioPerl/@Filter/ExecDir' version: 4.300020 - class: Dist::Zilla::Plugin::ShareDir name: '@BioPerl/@Filter/ShareDir' version: 4.300020 - class: Dist::Zilla::Plugin::MakeMaker name: '@BioPerl/@Filter/MakeMaker' version: 4.300020 - class: Dist::Zilla::Plugin::Manifest name: '@BioPerl/@Filter/Manifest' version: 4.300020 - class: Dist::Zilla::Plugin::TestRelease name: '@BioPerl/@Filter/TestRelease' version: 4.300020 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@BioPerl/@Filter/ConfirmRelease' version: 4.300020 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@BioPerl/@Filter/UploadToCPAN' version: 4.300020 - class: Dist::Zilla::Plugin::MetaConfig name: '@BioPerl/MetaConfig' version: 4.300020 - class: Dist::Zilla::Plugin::MetaJSON name: '@BioPerl/MetaJSON' version: 4.300020 - class: Dist::Zilla::Plugin::PkgVersion name: '@BioPerl/PkgVersion' version: 4.300020 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@BioPerl/PodSyntaxTests' version: 4.300020 - class: Dist::Zilla::Plugin::NoTabsTests name: '@BioPerl/NoTabsTests' version: 0.01 - class: Dist::Zilla::Plugin::NextRelease name: '@BioPerl/NextRelease' version: 4.300020 - class: Dist::Zilla::Plugin::Test::Compile name: '@BioPerl/Test::Compile' version: 2.001 - class: Dist::Zilla::Plugin::PodCoverageTests name: '@BioPerl/PodCoverageTests' version: 4.300020 - class: Dist::Zilla::Plugin::MojibakeTests name: '@BioPerl/MojibakeTests' version: 0.5 - class: Dist::Zilla::Plugin::AutoPrereqs name: '@BioPerl/AutoPrereqs' version: 4.300020 - class: Dist::Zilla::Plugin::AutoMetaResources name: '@BioPerl/AutoMetaResources' version: 1.110050 - class: Dist::Zilla::Plugin::MetaResources name: '@BioPerl/MetaResources' version: 4.300020 - class: Dist::Zilla::Plugin::Authority name: '@BioPerl/Authority' version: 1.006 - class: Dist::Zilla::Plugin::EOLTests name: '@BioPerl/EOLTests' version: 0.02 - class: Dist::Zilla::Plugin::PodWeaver name: '@BioPerl/PodWeaver' version: 3.101641 - class: Dist::Zilla::Plugin::Git::Check name: '@BioPerl/Git::Check' version: 2.009 - class: Dist::Zilla::Plugin::Git::Commit name: '@BioPerl/Git::Commit' version: 2.009 - class: Dist::Zilla::Plugin::Git::Tag name: '@BioPerl/Git::Tag' version: 2.009 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 4.300020 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 4.300020 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 4.300020 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 4.300020 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 4.300020 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 4.300020 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 4.300020 x_authority: cpan:BIOPERLML Bio-Biblio-1.70/dist.ini0000644000175000017500000000042612123443121016007 0ustar carandraugcarandraugname = Bio-Biblio abstract = Modules to access bibliographics repositories and handle citation files. version = 1.70 author = BioPerl Team license = Perl_5 copyright_holder = BioPerl Team [@BioPerl] Bio-Biblio-1.70/MANIFEST0000644000175000017500000000253212123443121015474 0ustar carandraugcarandraugChanges LICENSE MANIFEST META.json META.yml Makefile.PL README.md bin/bp_biblio dist.ini eg/biblio-eutils.pl eg/biblio-soap-test.pl eg/biblio-soap.pl lib/Bio/Biblio.pm lib/Bio/Biblio/Article.pm lib/Bio/Biblio/BiblioBase.pm lib/Bio/Biblio/Book.pm lib/Bio/Biblio/BookArticle.pm lib/Bio/Biblio/IO.pm lib/Bio/Biblio/IO/medline2ref.pm lib/Bio/Biblio/IO/medlinexml.pm lib/Bio/Biblio/IO/pubmed2ref.pm lib/Bio/Biblio/IO/pubmedxml.pm lib/Bio/Biblio/Journal.pm lib/Bio/Biblio/JournalArticle.pm lib/Bio/Biblio/MedlineArticle.pm lib/Bio/Biblio/MedlineBook.pm lib/Bio/Biblio/MedlineBookArticle.pm lib/Bio/Biblio/MedlineJournal.pm lib/Bio/Biblio/MedlineJournalArticle.pm lib/Bio/Biblio/Organisation.pm lib/Bio/Biblio/Patent.pm lib/Bio/Biblio/Person.pm lib/Bio/Biblio/Proceeding.pm lib/Bio/Biblio/Provider.pm lib/Bio/Biblio/PubmedArticle.pm lib/Bio/Biblio/PubmedBookArticle.pm lib/Bio/Biblio/PubmedJournalArticle.pm lib/Bio/Biblio/Ref.pm lib/Bio/Biblio/Service.pm lib/Bio/Biblio/TechReport.pm lib/Bio/Biblio/Thesis.pm lib/Bio/Biblio/WebResource.pm lib/Bio/DB/Biblio/biofetch.pm lib/Bio/DB/Biblio/eutils.pm lib/Bio/DB/Biblio/soap.pm lib/Bio/DB/BiblioI.pm t/00-compile.t t/Biblio.t t/References.t t/biofetch.t t/data/stress_test_medline.xml t/data/stress_test_pubmed.xml t/eutils.t t/release-eol.t t/release-mojibake.t t/release-no-tabs.t t/release-pod-coverage.t t/release-pod-syntax.t Bio-Biblio-1.70/META.json0000644000175000017500000001763512123443121015776 0ustar carandraugcarandraug{ "abstract" : "Modules to access bibliographics repositories and handle citation files.", "author" : [ "BioPerl Team " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.300020, CPAN::Meta::Converter version 2.120921", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Bio-Biblio", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "runtime" : { "requires" : { "Bio::Annotation::DBLink" : "0", "Bio::DB::DBFetch" : "0", "Bio::Root::IO" : "0", "Bio::Root::Root" : "0", "Bio::Root::RootI" : "0", "Data::Dumper" : "0", "Getopt::Std" : "0", "LWP::Simple" : "0", "SOAP::Lite" : "0", "Symbol" : "0", "URI::Escape" : "0", "XML::Parser" : "0", "XML::Twig" : "0", "parent" : "0", "strict" : "0", "utf8" : "0", "vars" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Find" : "0", "File::Spec" : "0", "File::Temp" : "0", "Test::More" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bioperl-l@bioperl.org", "web" : "https://redmine.open-bio.org/projects/bioperl/" }, "homepage" : "http://search.cpan.org/dist/Bio-Biblio", "repository" : { "type" : "git", "url" : "git://github.com/bioperl/bio-biblio.git", "web" : "https://github.com/bioperl/bio-biblio" } }, "version" : "1.70", "x_Dist_Zilla" : { "plugins" : [ { "class" : "Dist::Zilla::Plugin::GatherDir", "name" : "@BioPerl/@Filter/GatherDir", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@BioPerl/@Filter/PruneCruft", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@BioPerl/@Filter/ManifestSkip", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@BioPerl/@Filter/MetaYAML", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@BioPerl/@Filter/License", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@BioPerl/@Filter/ExtraTests", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@BioPerl/@Filter/ExecDir", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@BioPerl/@Filter/ShareDir", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "@BioPerl/@Filter/MakeMaker", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@BioPerl/@Filter/Manifest", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@BioPerl/@Filter/TestRelease", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@BioPerl/@Filter/ConfirmRelease", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@BioPerl/@Filter/UploadToCPAN", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@BioPerl/MetaConfig", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@BioPerl/MetaJSON", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@BioPerl/PkgVersion", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@BioPerl/PodSyntaxTests", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::NoTabsTests", "name" : "@BioPerl/NoTabsTests", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@BioPerl/NextRelease", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "name" : "@BioPerl/Test::Compile", "version" : "2.001" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@BioPerl/PodCoverageTests", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@BioPerl/MojibakeTests", "version" : "0.5" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@BioPerl/AutoPrereqs", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@BioPerl/AutoMetaResources", "version" : "1.110050" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@BioPerl/MetaResources", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@BioPerl/Authority", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::EOLTests", "name" : "@BioPerl/EOLTests", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "name" : "@BioPerl/PodWeaver", "version" : "3.101641" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@BioPerl/Git::Check", "version" : "2.009" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@BioPerl/Git::Commit", "version" : "2.009" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@BioPerl/Git::Tag", "version" : "2.009" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "4.300020" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "4.300020" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "4.300020" } }, "x_authority" : "cpan:BIOPERLML" } Bio-Biblio-1.70/LICENSE0000644000175000017500000004365312123443121015361 0ustar carandraugcarandraugThis software is copyright (c) 2013 by BioPerl Team. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2013 by BioPerl Team. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2013 by BioPerl Team. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Bio-Biblio-1.70/eg/0000755000175000017500000000000012123443121014734 5ustar carandraugcarandraugBio-Biblio-1.70/eg/biblio-eutils.pl0000755000175000017500000002271712123443121020050 0ustar carandraugcarandraug#!/usr/bin/perl use utf8; =encoding utf-8 =head1 NAME biblio-eutils.pl =head1 SYNOPSIS Script that uses Bio::Biblio, accessing 'eutils' at PubMed. As of Bioperl version 1.4 there are 3 bibliographic repositories, stipulated by the -access argument: soap, eutils, and biofetch. The default is 'soap'. Not all of these repositories support all the Biblio methods nor are the contents of these repositories necessarily the same. Choose wisely! =head2 PubMed Queries The syntax of the queries is the same as at PubMed, see http://www.ncbi.nlm.nih.gov/entrez/query/Pmc/pmchelp.html#SearchFieldDescriptionsandTags for more information on how to construct queries. =head2 Parsing Results Bio::Biblio will give you XML when querying eutils so you have choose a method to parse XML. A fairly simple approach uses XML::Twig, shown here. This example shows how query by title and how to retrieve the titles of the abstracts found. =cut use strict; use Bio::Biblio; use XML::Twig; # one-liner to get the number of abstracts found my $num = new Bio::Biblio(-access => "eutils")->find("Osborne","authors")-> get_count; my $biblio = Bio::Biblio->new(-access => "eutils"); my $result = $biblio->find("brain [TI] AND MDM2 [TI]"); my $pmids = $result->get_all_ids; my $parser = XML::Twig->new(twig_roots => {"ArticleTitle" => \&print_title} ); for my $pmid (@$pmids) { my $xml = $biblio->get_by_id($pmid); eval { $parser->parse($xml); }; if ($@) { warn "Problem parsing PubMed $pmid XML: $!\n"; } } sub print_title { my ($twig, $elt) = @_; print $elt->text,"\n"; $twig->purge; } =head1 PubMed XML Example 15815077 2005 04 07 2005 08 29
0231-5882 23 4 2004 Dec Rabbit liver microsomal system: study of interaction with two model N-nitrosamines and their metabolism. 423-33 Rabbit liver microsomes of control (non-treated) or animals induced either by ethanol (EtOH) or phenobarbital (PB) were incubated with N-nitrosodimethylamine (NDMA) or N-nitrosomethylaniline (NMA). Difference spectroscopy showed that NMA is bound to the substrate-binding site of cytochrome P-450 (CYP) isoforms as heme ligand in control and EtOH pre-treated microsomes. On the other hand, PB-induced microsomes exhibit with NMA substrate type of spectra. NDMA does not provide any type of binding spectra with used microsomal systems. Oxidative bio-activation of N-nitrosamines by the microsomal CYP isoforms was measured as formaldehyde formation. Analysis of reaction kinetics in control microsomes revealed, for both substrates, two values of Michaelis-Menten constant (K(m)) for, K(m) values of 0.03 and 0.13 mmol/l for NDMA, and 0.30 and 0.82 mmol/l for NMA. Induction of animals with EtOH resulted in a decrease in the K(m) value for both substrates. In contrast, PB treatment caused an elevation of K(m) value for NDMA. Based on these data, we conclude that EtOH-inducible microsomal CYP isoforms (mainly CYP2E1) are responsible for binding and N-demethylation metabolism of both studied N-nitrosamines in rabbit liver microsomal system. The role of the other CYP isoforms involved in the metabolism of mentioned N-nitrosamines is discussed. Department of Biochemistry, Faculty of Science, Charles University, Hlavova 2030, 128 43 Prague 2, Czech Republic. mis@natur.cuni.cz Sulc B B KubE<237>ckovE<225> B B ME<225>slovE<225> F B Hodek C B eng Journal Article
Slovakia Gen Physiol Biophys 8400604 0 N-nitrosodimethylamine 0 Nitrosamines 50-06-6 Phenobarbital 614-00-6 N-methyl-N-nitrosoaniline 64-17-5 Ethanol 9035-51-2 Cytochrome P-450 Enzyme System I Animals Cytochrome P-450 Enzyme System metabolism Ethanol administration & dosage Liver drug effects metabolism Male Microsomes, Liver drug effects metabolism Nitrosamines metabolism Phenobarbital administration & dosage Rabbits Research Support, Non-U.S. Govt
2005 4 9 9 0 2005 8 30 9 0 ppublish 15815077
=cut Bio-Biblio-1.70/eg/biblio-soap-test.pl0000755000175000017500000000640712123443121020460 0ustar carandraugcarandraug#!/usr/bin/perl use utf8; # # This was actually a part of the test suite - but because it starts # an external process it was safer not to use it as a test (the process # could be left running if an error occurs). # # It is an example of a TCP-based SOAP exchange. # use strict; eval { require SOAP::Lite; }; if( $@ ){ die("must have SOAP::Lite installed to run this script"); } use vars qw($NUMTESTS); my $error; BEGIN { # to handle systems with no installed Test module # we include the t dir (where a copy of Test.pm is located) # as a fallback eval { require Test; }; $error = 0; if( $@ ) { use lib 't'; } use Test; plan tests => 10; } my $testnum; my $verbose = 0; use Bio::Biblio; # --- launch a testing SOAP server my ($pid, $port, $max_port); $port = 4444; $max_port = $port + 100; if ($pid = fork) { # parent here sleep 1; my $biblio = new Bio::Biblio (-location => "tcp://localhost:$port", -namespace => 'soap_server'); ok ($biblio->get_count, '43'); ok ($biblio->get_by_id ('X'), 'X'); ok ($biblio->find ('a,b','c,d')->get_collection_id, 'a,b,c,d'); ok ($biblio->find (['x', 'y'], ['u', 'v'])->get_collection_id, 'x,y,u,v'); ok ( eval { join (',', @{ $biblio->find ('AAA')->get_all_ids }) }, 'AAA'); print STDERR $@ if $@; ok ( eval { join (',', @{ $biblio->find ('XXX')->get_all }) }, 'XXX'); print STDERR $@ if $@; ok ( eval { $biblio->find (46)->has_next }, 1); print STDERR $@ if $@; ok ( eval { $biblio->find ('BBB')->get_next }, 'BBB'); print STDERR $@ if $@; ok ( eval { join (',', @{ $biblio->find ('CCC')->get_more (3) }) }, 'CCC,CCC,CCC'); print STDERR $@ if $@; ok ( eval { $biblio->find (46)->exists }, 0); print STDERR $@ if $@; # clean-up the running server kill 9, $pid if defined $pid; print " SOAP server $pid killed\n"; } elsif (defined $pid) { # child here - a testing SOAP server package soap_server; use strict; use SOAP::Transport::TCP; my $daemon; while ($port < $max_port) { eval { $daemon = SOAP::Transport::TCP::Server -> new (LocalAddr => 'localhost', LocalPort => $port, Listen => 5, Reuse => 1) -> dispatch_to('soap_server'); }; last unless $@; $port++; } print " Contact to SOAP server at ", join(':', $daemon->sockhost, $daemon->sockport), " (server PID: $$)\n"; $daemon->handle; sub getBibRefCount { shift; return 43; } sub getById { shift; return shift; } sub find { my ($self, $keywords, $attrs) = @_; return join (',', (@{ $keywords }, @{ $attrs })) if $attrs; return join (',', @{ $keywords }); } sub getAllIDs { shift; return [ shift ] } sub getAllBibRefs { shift; return [ shift ] } sub hasNext { return SOAP::Data->type (boolean => 'true'); } sub getNext { shift; return [ '1', shift]; } sub getMore { my ($self, $id, $how_many) = @_; my @result = ('1'); push (@result, $id) for (1..$how_many); return \@result; } sub exists { return SOAP::Data->type (boolean => '0'); } sub destroy {} package main; } else { # fork failed print STDERR "Testing SOAP services FAILED: $!.\n"; } Bio-Biblio-1.70/eg/biblio-soap.pl0000755000175000017500000002730512123443121017503 0ustar carandraugcarandraug#!/usr/bin/perl use utf8; =head1 NAME biblio-soap-example.pl =head1 SYNOPSIS Script showing code that uses Bio::Biblio, with 'soap' at OpenBQS. As of Bioperl version 1.4 there are 3 bibliographic repositories, stipulated by the -access argument: soap, eutils, and biofetch. The default is 'soap'. Not all of these repositories support all the Biblio methods nor are the contents of these repositories necessarily the same. Choose wisely! =cut use strict; use Bio::Biblio; use Bio::Biblio::IO; use Data::Dumper; # number of articles in 'soap' with author Osborne... my $num = new Bio::Biblio->find("Osborne","authors")-> get_count; # number of articles in OpenBQS with 'topoisomerase' in the title, year 2000, # ("J Biol Chem","journal") is another example query $num = new Bio::Biblio->find("topoisomerase","title")-> find("2000","year")->get_count; # a reference as XML... my $xml = new Bio::Biblio->get_by_id("3047008"); # get a reference to an array of ids... my $arr_ref = new Bio::Biblio->find ("Osborne","authors")-> find("2000","year")->get_all_ids; # get the vocabulary of a specific repository, but not all repositories # support these methods as of Bioperl 1.4... my $biblio = Bio::Biblio->new(-access => "soap"); my $biblio_ref = $biblio->get_vocabulary_names; my $val_ref = $biblio->get_all_values('MEDLINE2004/JournalArticle/properties'); # retrieve the entry as text or retrieve specific text fields... my $medline_id = "88329717"; my $ref = Bio::Biblio->new(-access => "soap")->get_by_id($medline_id); my $io = Bio::Biblio::IO->new( -result => "raw", -data => $ref ); my $nextref = $io->next_bibref; # print the entire hash... my $dump = Data::Dumper->Dump([$nextref],["$medline_id"]); # or just the abstract... my $abstract = $nextref->{article}->{abstract}->{abstractText}; # some hash references are stored in arrays foreach my $ref ( @{$nextref->{article}->{authors}} ) { foreach my $val (values %{$ref}) { print $val->{lastName}," ",$val->{initials},"\n"; } } # a few more values my $year = $nextref->{article}->{journal}->{journalIssue}->{pubDate}->{year}; my $title = $nextref->{article}->{articleTitle}; # put it all together... my $refs = new Bio::Biblio->find("Osborne","authors")->find("2000","year"); while ($refs->has_next){ my $ref = $refs->get_next; my $io = Bio::Biblio::IO->new( -result => "raw", -data => $ref ); my $nextref = $io->next_bibref; my $abstract = $nextref->{article}->{abstract}->{abstractText}; # you could also write: # my $abstract = Bio::Biblio::IO->new( -result => "raw", # -data => $refs->get_next )->next_bibref->{article}->{abstract}->{abstractText}; print $abstract,"\n"; } =head1 Output from Data::Dumper->Dump: 88329717 = { 'chemicals' => [ { 'nameOfSubstance' => 'DNA, Fungal', 'registryNumber' => '0' }, { 'nameOfSubstance' => 'DNA, Superhelical', 'registryNumber' => '0' }, { 'nameOfSubstance' => 'RNA Polymerase II', 'registryNumber' => 'EC 2.7.7.-' } ], 'journalInfo' => { 'medlineTA' => 'Genes Dev', 'country' => 'UNITED STATES', 'nlmUniqueID' => '8711660' }, 'PMID' => '3047008', 'medlineID' => '88329717', 'status' => 'Completed', 'article' => { 'journal' => { 'journalIssue' => { 'volume' => '2', 'issue' => '6', 'pubDate' => { 'month' => 'Jun', 'year' => '1988' } }, 'iSSN' => '0890-9369' }, 'grants' => [ { 'agency' => 'NIGMS', 'grantID' => '5R01 GM30454-05', 'acronym' => 'GM' } ], 'pagination' => { 'medlinePgn' => '766-72' }, 'abstract' => { '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.' }, 'languages' => [ 'eng' ], 'publicationTypes' => [ 'Journal Article' ], 'authors' => [ { 'personalName' => { 'initials' => 'BI', 'lastName' => 'Osborne', 'foreName' => 'B I', 'type' => 'PersonalName' } }, { 'personalName' => { 'initials' => 'L', 'lastName' => 'Guarente', 'foreName' => 'L', 'type' => 'PersonalName' } } ], 'articleTitle' => 'Transcription by RNA polymerase II induces changes of DNA topology in yeast.', 'affiliation' => 'Massachusetts Institute of Technology, Department of Biology, Cambridge 02139.' }, 'dateRevised' => { 'day' => '18', 'month' => '12', 'year' => '2000' }, 'meshHeadings' => [ { 'descriptorName' => 'Chromosome Deletion' }, { 'descriptorName' => 'DNA, Fungal', 'subHeadings' => [ { 'subHeading' => 'genetics', 'majorTopic' => 'Y' }, { 'subHeading' => 'ultrastructure' } ] }, { 'descriptorName' => 'DNA, Superhelical', 'subHeadings' => [ { 'subHeading' => 'genetics' } ] }, { 'descriptorName' => 'Genes, Fungal' }, { 'descriptorName' => 'Promoter Regions (Genetics)' }, { 'descriptorName' => 'RNA Polymerase II', 'subHeadings' => [ { 'subHeading' => 'metabolism', 'majorTopic' => 'Y' } ] }, { 'descriptorName' => 'Saccharomyces cerevisiae', 'subHeadings' => [ { 'subHeading' => 'genetics', 'majorTopic' => 'Y' } ] }, { 'descriptorName' => 'Support, Non-U.S. Gov\'t' }, { 'descriptorName' => 'Support, U.S. Gov\'t, P.H.S.' }, { 'descriptorName' => 'Transcription, Genetic' } ], 'dateCreated' => { 'day' => '24', 'month' => '10', 'year' => '1988' }, 'citationSubsets' => [ 'IM' ], 'type' => 'MedlineCitation', 'dateCompleted' => { 'day' => '24', 'month' => '10', 'year' => '1988' } }; =cut Bio-Biblio-1.70/lib/0000755000175000017500000000000012123443121015107 5ustar carandraugcarandraugBio-Biblio-1.70/lib/Bio/0000755000175000017500000000000012123443121015620 5ustar carandraugcarandraugBio-Biblio-1.70/lib/Bio/DB/0000755000175000017500000000000012123443121016105 5ustar carandraugcarandraugBio-Biblio-1.70/lib/Bio/DB/Biblio/0000755000175000017500000000000012123443121017305 5ustar carandraugcarandraugBio-Biblio-1.70/lib/Bio/DB/Biblio/biofetch.pm0000644000175000017500000002133612123443121021433 0ustar carandraugcarandraugpackage Bio::DB::Biblio::biofetch; BEGIN { $Bio::DB::Biblio::biofetch::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::DB::Biblio::biofetch::VERSION = '1.70'; } use utf8; use strict; use warnings; use Bio::Biblio::IO; use parent qw(Bio::DB::DBFetch Bio::Biblio); # ABSTRACT: a BioFetch-based access to a bibliographic citation retrieval # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # you can add your own here theoretically. our %HOSTS = ( 'dbfetch' => { baseurl => 'http://%s/Tools/dbfetch/dbfetch?db=medline&style=raw', hosts => { 'ebi' => 'www.ebi.ac.uk' } } ); our %FORMATMAP = ( 'default' => 'medlinexml' ); our $DEFAULT_SERVICE = 'http://www.ebi.ac.uk/Tools/dbfetch/dbfetch'; our $DEFAULTRETRIEVAL_TYPE = 'tempfile'; sub new { my ($class, @args ) = @_; my $self = $class->SUPER::new(@args); $self->{ '_hosts' } = {}; $self->{ '_formatmap' } = {}; $self->hosts(\%HOSTS); $self->formatmap(\%FORMATMAP); $self->retrieval_type($DEFAULTRETRIEVAL_TYPE); $self->{'_default_format'} = $FORMATMAP{'default'}; return $self; } sub get_by_id { my ($self,$id) = @_; my $io = $self->get_Stream_by_id([$id]); $self->throw("id does not exist") if( !defined $io ) ; return $io->next_bibref(); } sub get_all { my ($self, $ids) = @_; return $self->get_seq_stream('-uids' => $ids, '-mode' => 'single'); } sub get_seq_stream { my ($self, %qualifiers) = @_; my ($rformat, $ioformat) = $self->request_format(); my $seen = 0; foreach my $key ( keys %qualifiers ) { if( $key =~ /format/i ) { $rformat = $qualifiers{$key}; $seen = 1; } } $qualifiers{'-format'} = $rformat if( !$seen); ($rformat, $ioformat) = $self->request_format($rformat); my $request = $self->get_request(%qualifiers); my ($stream,$resp); if ( $self->retrieval_type =~ /temp/i ) { my $dir = $self->io()->tempdir( CLEANUP => 1); my ( $fh, $tmpfile) = $self->io()->tempfile( DIR => $dir ); close $fh; my ($resp) = $self->_request($request, $tmpfile); if( ! -e $tmpfile || -z $tmpfile || ! $resp->is_success() ) { $self->throw("WebDBSeqI Error - check query sequences!\n"); } $self->postprocess_data('type' => 'file', 'location' => $tmpfile); # this may get reset when requesting batch mode ($rformat,$ioformat) = $self->request_format(); if ( $self->verbose > 0 ) { open(my $ERR, "<", $tmpfile); while(<$ERR>) { $self->debug($_);} } $stream = Bio::Biblio::IO->new('-format' => $ioformat, '-file' => $tmpfile); } elsif ( $self->retrieval_type =~ /io_string/i ) { my ($resp) = $self->_request($request); my $content = $resp->content_ref; $self->debug( "content is $$content\n"); if( ! $resp->is_success() || length(${$resp->content_ref()}) == 0 ) { $self->throw("WebDBSeqI Error - check query sequences!\n"); } ($rformat,$ioformat) = $self->request_format(); $self->postprocess_data('type'=> 'string', 'location' => $content); $stream = Bio::Biblio::IO->new('-format' => $ioformat, # '-data' => "". $$content. ""); '-data' => $$content ); } else { $self->throw("retrieval type " . $self->retrieval_type . " unsupported\n"); } return $stream; } # the default method, works for genbank/genpept, other classes should # override it with their own method. sub postprocess_data { my ($self, %args) = @_; my ($data, $TMP); my $type = uc $args{'type'}; my $location = $args{'location'}; if( !defined $type || $type eq '' || !defined $location) { return; } elsif( $type eq 'STRING' ) { $data = $$location; } elsif ( $type eq 'FILE' ) { open($TMP, "<", $location) or $self->throw("could not open file $location"); my @in = <$TMP>; $data = join("", @in); } if( $type eq 'FILE' ) { open($TMP, ">", $location) or $self->throw("could overwrite file $location"); print $TMP $data; } elsif ( $type eq 'STRING' ) { ${$args{'location'}} = $data; } $self->debug("format is ". $self->request_format(). " data is $data\n"); } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::DB::Biblio::biofetch - a BioFetch-based access to a bibliographic citation retrieval =head1 VERSION version 1.70 =head1 SYNOPSIS Do not use this object directly, only access it through the I module: use Bio::Biblio; my $biblio = Bio::Biblio->new(-access => 'biofetch'); my $ref = $biblio->get_by_id('20063307')); my $ids = ['20063307', '98276153']; my $refio = $biblio->get_all($ids); while ($ref = $refio->next_bibref) { print $ref->identifier, "\n"; } =head1 DESCRIPTION This class uses BioFetch protocol based service to retrieve Medline references by their ID. The main documentation details are to be found in L. =head1 ATTRIBUTES =head2 Defaults Usage : print $Bio::DB::Biblio::biofetch::DEFAULT_SERVICE; =head1 METHODS =head2 get_by_id Title : get_by_id Usage : $entry = $db->get__by_id('20063307') Function: Gets a Bio::Biblio::RefI object by its name Returns : a Bio::Biblio::Medline object Args : the id (as a string) of the reference =head2 get_all Title : get_all Usage : $seq = $db->get_all($ref); Function: Retrieves reference objects from the server 'en masse', rather than one at a time. For large numbers of sequences, this is far superior than get_by_id(). Example : Returns : a stream of Bio::Biblio::Medline objects Args : $ref : either an array reference, a filename, or a filehandle from which to get the list of unique ids/accession numbers. =head2 get_seq_stream Title : get_seq_stream Usage : my $seqio = $self->get_seq_stream(%qualifiers) Function: builds a url and queries a web db Returns : a Bio::SeqIO stream capable of producing sequence Args : %qualifiers = a hash qualifiers that the implementing class will process to make a url suitable for web querying =head2 postprocess_data Title : postprocess_data Usage : $self->postprocess_data ( 'type' => 'string', 'location' => \$datastr); Function: process downloaded data before loading into a Bio::SeqIO Returns : void Args : hash with two keys - 'type' can be 'string' or 'file' - 'location' either file location or string reference containing data =head1 BUGS AND LIMITATIONS =over 4 * Only method get_by_id() is supported =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/DB/Biblio/soap.pm0000644000175000017500000004241512123443121020613 0ustar carandraugcarandraugpackage Bio::DB::Biblio::soap; BEGIN { $Bio::DB::Biblio::soap::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::DB::Biblio::soap::VERSION = '1.70'; } use utf8; use strict; use warnings; use SOAP::Lite on_fault => sub { my $soap = shift; my $res = shift; my $msg = ref $res ? "--- SOAP FAULT ---\n" . $res->faultcode . " " . $res->faultstring : "--- TRANSPORT ERROR ---\n" . $soap->transport->status . "\n$res\n"; Bio::DB::Biblio::soap->throw ( -text => $msg ); }; use parent qw(Bio::Biblio); # ABSTRACT: a SOAP-based access to a bibliographic query service # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 ## where to go... our $DEFAULT_SERVICE = 'http://www.ebi.ac.uk/openbqs/services/MedlineSRS'; ## TODO: This namespace is no longer valid (check for deprecation or update) our $DEFAULT_NAMESPACE = 'http://industry.ebi.ac.uk/openBQS'; sub _initialize { my ($self, @args) = @_; # make a hashtable from @args my %param = @args; @param { map { lc $_ } keys %param } = values %param; # lowercase keys # copy all @args into this object (overwriting what may already be # there) - changing '-key' into '_key' my $new_key; foreach my $key (keys %param) { ($new_key = $key) =~ s/^-/_/; $self->{ $new_key } = $param { $key }; } # finally add default values for those keys who have default value # and who are not yet in the object $self->{'_location'} = $DEFAULT_SERVICE unless $self->{'_location'}; $self->{'_namespace'} = $DEFAULT_NAMESPACE unless $self->{'_namespace'}; $self->{'_destroy_on_exit'} = 1 unless defined $self->{'_destroy_on_exit'}; unless ($self->{'_soap'}) { if (defined $self->{'_httpproxy'}) { $self->{'_soap'} = SOAP::Lite -> uri ($self->{'_namespace'}) -> proxy ($self->{'_location'}, proxy => ['http' => $self->{'_httpproxy'}]); } else { $self->{'_soap'} = SOAP::Lite -> uri ($self->{'_namespace'}) -> proxy ($self->{'_location'}); } # $self->{'_soap'}->soapversion (1.2); } } # ----------------------------------------------------------------------------- # # objects representing query collections are being destroyed if they # have attribute '_destroy_on_exit' set to true - which is a default # value # sub DESTROY { my $self = shift; my $soap = $self->{'_soap'}; my $destroy = $self->{'_destroy_on_exit'}; return unless $destroy; my $collection_id = $self->{'_collection_id'}; return unless $collection_id; # ignore all errors here eval { $soap->destroy (SOAP::Data->type (string => $collection_id)); } } # # some methods must be called with an argument containing a collection # ID; here we return a proper error message explaining it # sub _no_id_msg { my $self = shift; my $package = ref $self; my $method = (caller(1))[3]; my $strip_method = $method; $strip_method =~ s/^$package\:\://; return <<"END_OF_MSG"; Method '$method' works only if its object has a query collection ID. Perhaps you need to use: \tBio::Biblio->new(-collection_id => '1234567')->$strip_method; or to obtain a collection ID indirectly from a query method: \tBio::Biblio->new->find ('keyword')->$strip_method; END_OF_MSG } # # some methods do not work with older SOAP::Lite version; here we #return message explaining it # sub _old_version_msg { my $self = shift; my $method = (caller(1))[3]; return <<"END_OF_MSG"; Method '$method' works only with SOAP::Lite version 0.52 and newer (the problem is with returning a boolean value from the server). END_OF_MSG } # # some controlled vocabulary methods needs two parameters; here we # return message explaining it # sub _two_params_msg { my $self = shift; my $method = (caller(1))[3]; return <<"END_OF_MSG"; Method '$method' expects two parameters: vocabulary name and a value. END_OF_MSG } # # some controlled vocabulary methods needs a vocabulary name; here we # return message explaining it # sub _missing_name_msg { my $self = shift; my $method = (caller(1))[3]; return <<"END_OF_MSG"; Method '$method' expects vocabulary name as parameter. END_OF_MSG } # # return a copy of a given array, with all its elements replaced # with the SOAP-Data objects defining elements type as 'string' # sub _as_strings { my ($ref_input_array) = @_; my (@result) = map { SOAP::Data->new (type => 'string', value => $_) } @$ref_input_array; return \@result; } # --------------------------------------------------------------------- # # Here are the methods implementing Bio::DB::BiblioI interface # (documentation is in Bio::DB::BiblioI) # # --------------------------------------------------------------------- sub get_collection_id { my ($self) = @_; $self->{'_collection_id'}; } sub get_count { my ($self) = @_; my $soap = $self->{'_soap'}; my ($collection_id) = $self->{'_collection_id'}; if ($collection_id) { $soap->getBibRefCountOfCollection (SOAP::Data->type (string => $collection_id))->result; } else { $soap->getBibRefCount->result; } } # try: 12368254 (it's a Bioperl article) sub get_by_id { my ($self, $citation_id) = @_; $self->throw ("Citation ID is expected as a parameter of method 'get_by_id'.") unless $citation_id; my $soap = $self->{'_soap'}; $soap->getById (SOAP::Data->type (string => $citation_id))->result; } sub find { my ($self, $keywords, $attrs) = @_; my (@keywords, @attrs); # $keywords can be a comma-delimited scalar or a reference to an array if ($keywords) { my $ref = ref $keywords; @keywords = split (/,/, $keywords) unless $ref; @keywords = @$keywords if $ref =~ /ARRAY/; } $self->throw ("No keywords given in 'find' method.\n") unless (@keywords); # ...and the same with $attrs if ($attrs) { my $ref = ref $attrs; @attrs = split (/,/, $attrs) unless $ref; @attrs = @$attrs if $ref =~ /ARRAY/; } my $soap = $self->{'_soap'}; my $collection_id = $self->{'_collection_id'}; my $new_id; if ($collection_id) { if (@attrs) { $new_id = $soap->reFindInAttrs (SOAP::Data->name ('arg0')->type (string => $collection_id), SOAP::Data->name ('arg1')->value (&_as_strings (\@keywords)), SOAP::Data->name ('arg2')->value (&_as_strings (\@attrs))) ->result; } else { $new_id = $soap->reFind (SOAP::Data->name ('arg0')->type (string => $collection_id), SOAP::Data->name ('arg1')->value (&_as_strings (\@keywords))) ->result; } } else { if (@attrs) { $new_id = $soap->findInAttrs (SOAP::Data->name ('arg0')->value (&_as_strings (\@keywords)), SOAP::Data->name ('arg1')->value (&_as_strings (\@attrs))) ->result; } else { $new_id = $soap->find (SOAP::Data->name ('arg0')->value (&_as_strings (\@keywords))) ->result; } } # clone itself but change the collection ID to a new one return $self->new (-collection_id => $new_id, -parent_collection_id => $collection_id); } sub get_all_ids { my ($self) = @_; my $soap = $self->{'_soap'}; my ($collection_id) = $self->{'_collection_id'}; $self->throw ($self->_no_id_msg) unless $collection_id; $soap->getAllIDs (SOAP::Data->type (string => $collection_id))->result; } sub get_all { my ($self) = @_; my $soap = $self->{'_soap'}; my ($collection_id) = $self->{'_collection_id'}; $self->throw ($self->_no_id_msg) unless $collection_id; $soap->getAllBibRefs (SOAP::Data->type (string => $collection_id))->result; } sub has_next { my ($self) = @_; my $soap = $self->{'_soap'}; my ($collection_id) = $self->{'_collection_id'}; $self->throw ($self->_no_id_msg) unless $collection_id; $self->throw ($self->_old_version_msg) if $SOAP::Lite::VERSION lt '0.52'; $soap->hasNext (SOAP::Data->type (string => $collection_id))->result; } sub get_next { my ($self) = @_; my $soap = $self->{'_soap'}; my ($collection_id) = $self->{'_collection_id'}; $self->throw ($self->_no_id_msg) unless $collection_id; $soap->getNext (SOAP::Data->type (string => $collection_id))->result; } sub get_more { my ($self, $how_many) = @_; my $soap = $self->{'_soap'}; my $collection_id = $self->{'_collection_id'}; $self->throw ($self->_no_id_msg) unless $collection_id; unless (defined ($how_many) and $how_many =~ /^\d+$/) { $self->warn ("Method 'get_more' expects a numeric argument. Changing to 1.\n"); $how_many = 1; } unless ($how_many > 0) { $self->warn ("Method 'get_more' expects a positive argument. Changing to 1.\n"); $how_many = 1; } my $ra = $soap->getMore (SOAP::Data->type (string => $collection_id), SOAP::Data->type (int => $how_many))->result; $self->{'_collection_id'} = shift @{ $ra }; $ra; } sub reset_retrieval { my ($self) = @_; my $soap = $self->{'_soap'}; my ($collection_id) = $self->{'_collection_id'}; $self->throw ($self->_no_id_msg) unless $collection_id; $self->{'_collection_id'} = $soap->resetRetrieval (SOAP::Data->type (string => $collection_id))->result; } sub exists { my ($self) = @_; my $soap = $self->{'_soap'}; my ($collection_id) = $self->{'_collection_id'}; $self->throw ($self->_no_id_msg) unless $collection_id; $self->throw ($self->_old_version_msg) if $SOAP::Lite::VERSION lt '0.52'; $soap->exists (SOAP::Data->type (string => $collection_id))->result; } sub destroy { my ($self) = @_; my $soap = $self->{'_soap'}; my ($collection_id) = $self->{'_collection_id'}; $self->throw ($self->_no_id_msg) unless $collection_id; $soap->destroy (SOAP::Data->type (string => $collection_id)); } sub get_vocabulary_names { my ($self) = @_; my $soap = $self->{'_soap'}; $soap->getAllVocabularyNames->result; } sub contains { my ($self, $vocabulary_name, $value) = @_; my $soap = $self->{'_soap'}; $self->throw ($self->_old_version_msg) if $SOAP::Lite::VERSION lt '0.52'; $self->throw ($self->_two_params_msg) unless defined $vocabulary_name and defined $value; $soap->contains (SOAP::Data->type (string => $vocabulary_name), SOAP::Data->type (string => $value))->result; } sub get_entry_description { my ($self, $vocabulary_name, $value) = @_; my $soap = $self->{'_soap'}; $self->throw ($self->_two_params_msg) unless defined $vocabulary_name and defined $value; $soap->getEntryDescription (SOAP::Data->type (string => $vocabulary_name), SOAP::Data->type (string => $value))->result; } sub get_all_values { my ($self, $vocabulary_name) = @_; my $soap = $self->{'_soap'}; $self->throw ($self->_missing_name_msg) unless defined $vocabulary_name; $soap->getAllValues (SOAP::Data->type (string => $vocabulary_name))->result; } sub get_all_entries { my ($self, $vocabulary_name) = @_; my $soap = $self->{'_soap'}; $self->throw ($self->_missing_name_msg) unless defined $vocabulary_name; $soap->getAllEntries (SOAP::Data->type (string => $vocabulary_name))->result; } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::DB::Biblio::soap - a SOAP-based access to a bibliographic query service =head1 VERSION version 1.70 =head1 SYNOPSIS Do not use this object directly, it is recommended to access it and use it through the I module: use Bio::Biblio; my $biblio = Bio::Biblio->new (-access => 'soap'); =head1 DESCRIPTION This object contains the real implementation of a Bibliographic Query Service as defined in L - using a SOAP protocol to access a WebService (a remote server) that represents a bibliographic repository. The main documentation details are to be found in L. =head1 ATTRIBUTES =head2 Defaults Usage : print $Bio::DB::Biblio::soap::DEFAULT_SERVICE; print $Bio::DB::Biblio::soap::DEFAULT_NAMESPACE; =head1 INTERNAL METHODS =head2 _initialize Usage : my $obj = Bio::Biblio->new(-access => 'soap' ...); (_initialize is internally called from this constructor) Returns : nothing interesting Args : This module recognises and uses following arguments: -namespace => 'urn' The namespace used by the WebService that is being accessed. It is a string which guarantees its world-wide uniqueness - therefore it often has a style of a URL - but it does not mean that such pseudo-URL really exists. ## TODO: This namespace is no longer valid (check for deprecation ## or update) Default is 'http://industry.ebi.ac.uk/openBQS'. -destroy_on_exit => '0' Default value is '1' which means that all Bio::Biblio objects - when being finalised - will send a request to the remote WebService to forget the query collections they represent. If you change it to '0' make sure that you know the query collection identification - otherwise you will not be able to re-established connection with it. This can be done by calling method get_collection_id. -collection_id => '...' It defines what query collection will this object work with. Use this argument when you know a collection ID of an existing query collection and when you wish to re-established connection with it. By default, the collection IDs are set automatically by the query methods - they return Bio::Biblio objects already having a collection ID. A missing or undefined collection ID means that the object represents the whole bibliographic repository (which again means that some methods, like get_all, will be probably refused). -soap => a SOAP::Lite object Usually all Bio::Biblio objects share an instance of the underlying SOAP::Lite module. But you are free to have more - perhaps with different characteristics. See the code for attributes of the default SOAP::Lite object. -httpproxy => 'http://server:port' In addition to the 'location' parameter, you may need to specify also a location/URL of a HTTP proxy server (if your site requires one). Additionally, the main module Bio::Biblio recognises also: -access => '...' -location => '...' It populates calling object with the given arguments, and then - for some attributes and only if they are not yet populated - it assigns some default values. This is an actual new() method (except for the real object creation and its blessing which is done in the parent class Bio::Root::Root in method _create_object). Note that this method is called always as an I method (never as a I method) - and that the object who calls this method may already be partly initiated (from Bio::Biblio::new method); so if you need to do some tricks with the 'class invocation' you need to change Bio::Biblio::new method, not this one. =head1 BUGS AND LIMITATIONS =over 4 * Methods returning a boolean value (I, I and I) can be used only with SOAP::Lite version 0.52 and newer (probably due to a bug in the older SOAP::Lite). * It does not use WSDL. * More testing and debugging needed to ensure that returned citations are properly transferred even if they contain foreign characters. =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/DB/Biblio/eutils.pm0000644000175000017500000003171712123443121021161 0ustar carandraugcarandraugpackage Bio::DB::Biblio::eutils; BEGIN { $Bio::DB::Biblio::eutils::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::DB::Biblio::eutils::VERSION = '1.70'; } use utf8; use strict; use warnings; use LWP::Simple; use XML::Twig; use URI::Escape; use parent qw(Bio::Biblio Bio::DB::BiblioI); # ABSTRACT: access to PubMed's bibliographic query service # AUTHOR: Allen Day # OWNER: 2004 Allen Day, University of California, Los Angeles # LICENSE: Perl_5 our $DEFAULT_URN; our $EFETCH = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi'; our $ESEARCH = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi'; our $MAX_RECORDS = 100_000; sub _initialize { my ($self, @args) = @_; #eutils doesn't need this code, but it doesn't hurt to leave it here... -ad # make a hashtable from @args my %param = @args; @param { map { lc $_ } keys %param } = values %param; # lowercase keys # copy all @args into this object (overwriting what may already be # there) - changing '-key' into '_key' my $new_key; foreach my $key (keys %param) { ($new_key = $key) =~ s/^-/_/; $self->{ $new_key } = $param { $key }; } # set up internal data $self->twig(XML::Twig->new()); # finally add default values for those keys who have default value # and who are not yet in the object #AOK return 1; } sub db{ my($self,$arg) = @_; if($arg){ my %ok = map {$_=>1} qw(pubmed pmc journals); if($ok{lc($arg)}){ $self->{'db'} = lc($arg); } else { $self->warn("invalid db $arg, keeping value as ".$self->{'db'} || 'pubmed'); } } return $self->{'db'}; } sub get_collection_id { return shift->collection_id(); } sub get_count { return shift->count(); } sub get_by_id { my $self = shift; my $id = shift; my $db = $self->db || 'pubmed'; $self->throw("must provide valid ID, not undef") unless defined($id); my $xml = get($EFETCH.'?rettype=abstract&retmode=xml&db='.$db.'&id='.$id); return $xml; } sub reset_retrieval { shift->cursor(0); return 1; } sub get_next { my $self = shift; return unless $self->has_next; my $xml = $self->get_by_id( @{ $self->ids }[$self->cursor] ); $self->cursor( $self->cursor + 1 ); return $xml; } sub get_more { my ($self,$more) = @_; my @return = (); for(1..$more){ my $next = $self->get_next(); last unless $next; push @return, $next; } return \@return; } sub has_next { my $self = shift; return ($self->cursor < $self->count) ? 1 : undef; } sub find { my ($self,$query) = @_; $query = uri_escape($query); my $db = $self->db || 'pubmed'; my $url = $ESEARCH."?usehistory=y&db=$db&retmax=$MAX_RECORDS&term=$query"; my $xml = get($url) or $self->throw("couldn't retrieve results from $ESEARCH: $!"); $self->twig->parse($xml); my @ids = map {$_->text} $self->twig->get_xpath('//IdList//Id'); $self->ids(\@ids); ## #should we be using the ids, or the count tag? ## my($count_element) = $self->twig->get_xpath('//Count'); if (defined $count_element) { my $count = $count_element->text(); $self->count(scalar(@ids)); } my($retmax_element) = $self->twig->get_xpath('//RetMax'); if (defined $retmax_element) { my $retmax = $retmax_element->text(); } my($querykey_element) = $self->twig->get_xpath('//QueryKey'); if (defined $querykey_element) { $self->query_key($querykey_element->text()); } my($webenv_element) = $self->twig->get_xpath('//WebEnv'); if (defined $webenv_element) { $self->collection_id($webenv_element->text()); } #initialize/reset cursor $self->cursor(0); return $self; } sub get_all_ids { my $self = shift; return $self->ids() if $self->ids(); return (); } sub get_all { my ($self) = shift; my $db = $self->db || 'pubmed'; my $xml = get($EFETCH.'?rettype=abstract&retmode=xml&db=pubmed&query_key='. $self->query_key.'&WebEnv='.$self->collection_id. '&retstart=1&retmax='.$MAX_RECORDS ); return $xml; } sub exists { return; } sub destroy { return; } sub get_vocabulary_names { return []; } sub contains { return; } sub get_entry_description { return; } sub get_all_values { return; } sub get_all_entries { return; } sub cursor { my $self = shift; my $arg = shift; return $self->{'cursor'} = $arg if defined($arg); return $self->{'cursor'}; } sub twig { my $self = shift; return $self->{'twig'} = shift if @_; return $self->{'twig'}; } sub ids { my $self = shift; return $self->{'ids'} = shift if @_; return $self->{'ids'}; } sub collection_id { my $self = shift; return $self->{'collection_id'} = shift if @_; return $self->{'collection_id'}; } sub count { my $self = shift; return $self->{'count'} = shift if @_; return $self->{'count'}; } sub query_key { my $self = shift; return $self->{'query_key'} = shift if @_; return $self->{'query_key'}; } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::DB::Biblio::eutils - access to PubMed's bibliographic query service =head1 VERSION version 1.70 =head1 SYNOPSIS Do not use this object directly, it is recommended to access it and use it through the I module: use Bio::Biblio; use Bio::Biblio::IO; my $biblio = Bio::Biblio->new( -access => 'eutils' ); $biblio->find("10336996"); my $xml = $biblio->get_next; my $io = Bio::Biblio::IO->new( -data => $xml, -format => 'medlinexml' ); my $article = $io->next_bibref(); The main documentation details are to be found in L. =head1 ATTRIBUTES =head2 db Title : db Usage : $obj->db($newval) Function: specifies the database to search. valid values are: pubmed, pmc, journals it is also possible to add the following, and i will do so on request: genome, nucleotide, protein, popset, snp, sequence, taxonomy pubmed is default. Returns : value of db (a scalar) Args : on set, new value (a scalar or undef, optional) =head2 has_next Title : has_next Usage : $has_next = $biblio->has_next(); Function: check to see if there are more items to be retrieved Returns : 1 on true, undef on false Args : none =head1 METHODS =head2 get_collection_id Title : get_collection_id Usage : $id = $biblio->get_collection_id(); Function: returns WebEnv value from ESearch Returns : ESearch WebEnv value as a string Args : none =head2 reset_retrieval Title : reset_retrieval Usage : $biblio->reset_retrieval(); Function: reset cursor in id list, see cursor() Returns : 1 Args : none =head2 get_next Title : get_next Usage : $xml = $biblio->get_next(); Function: return next record as xml Returns : an xml string Args : none =head2 get_more Title : get_more Usage : $xml = $biblio->get_more($more); Function: returns next $more records concatenated Returns : a string containing multiple xml documents Args : an integer representing how many records to retrieve =head2 find Title : find Usage : $biblio = $biblio->find($pubmed_query_phrase); Function: perform a PubMed query using Entrez ESearch Returns : a reference to the object on which the method was called Args : a PubMed query phrase. See http://eutils.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html for help on how to construct a query. =head2 get_all_ids Title : get_all_ids Usage : @ids = $biblio->get_all_ids(); Function: return a list of PubMed ids resulting from call to find() Returns : a list of PubMed ids, or an empty list Args : none =head2 get_all Title : get_all Usage : $xml = $biblio->get_all(); Function: retrieve all records from query Returns : return a large concatenated string of PubMed xml documents Args : none =head2 get_vocabulary_names Title : get_vocabulary_names Usage : do not use Function: no-op. this is here only for interface compatibility Returns : empty arrayref Args : none =head2 get_entry_description Title : get_entry_description Usage : do not use Function: no-op. this is here only for interface compatibility Returns : undef Args : none =head2 get_all_values Title : get_all_values Usage : do not use Function: no-op. this is here only for interface compatibility Returns : undef Args : none =head2 get_all_entries Title : get_all_entries Usage : do not use Function: no-op. this is here only for interface compatibility Returns : undef Args : none =head1 INTERNAL METHODS =head2 _initialize Usage : my $obj = Bio::Biblio->new(-access => 'eutils' ...); (_initialize is internally called from this constructor) Returns : 1 on success Args : none This is an actual new() method (except for the real object creation and its blessing which is done in the parent class Bio::Root::Root in method _create_object). Note that this method is called always as an I method (never as a I method) - and that the object who calls this method may already be partly initiated (from Bio::Biblio::new method); so if you need to do some tricks with the 'class invocation' you need to change Bio::Biblio::new method, not this one. =head2 exists Title : exists Usage : do not use Function: no-op. this is here only for interface compatibility Returns : undef Args : none =head2 destroy Title : destroy Usage : do not use Function: no-op. this is here only for interface compatibility Returns : undef Args : none =head2 contains Title : contains Usage : do not use Function: no-op. this is here only for interface compatibility Returns : undef Args : none =head2 cursor Title : cursor Usage : $obj->cursor($newval) Function: holds position in reference collection Returns : value of cursor (a scalar) Args : on set, new value (a scalar or undef, optional) =head2 twig Title : twig Usage : $obj->twig($newval) Function: holds an XML::Twig instance. Returns : value of twig (a scalar) Args : on set, new value (a scalar or undef, optional) =head2 ids Title : ids Usage : $obj->ids($newval) Function: store pubmed ids resulting from find() query Returns : value of ids (a scalar) Args : on set, new value (a scalar or undef, optional) =head2 collection_id Title : collection_id Usage : $obj->collection_id($newval) Function: Returns : value of collection_id (a scalar) Args : on set, new value (a scalar or undef, optional) =head2 count Title : count Usage : $obj->count($newval) Function: Returns : value of count (a scalar) Args : on set, new value (a scalar or undef, optional) =head2 query_key Title : query_key Usage : $obj->query_key($newval) Function: holds query_key from ESearch document Returns : value of query_key (a scalar) Args : on set, new value (a scalar or undef, optional) =head1 BUGS AND LIMITATIONS =over 4 * More testing and debugging needed to ensure that returned citations are properly transferred even if they contain foreign characters. * Maximum record count (MAX_RECORDS) returned currently hard coded to 100K. * Biblio retrieval methods should be more tightly integrated with L and L. =back =head1 SEE ALSO =over 4 =item * Pub Med Help http://eutils.ncbi.nlm.nih.gov/entrez/query/static/help/pmhelp.html =item * Entrez Utilities http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html =item * Example code F =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Allen Day =head2 Copyright and License This software is Copyright (c) by 2004 Allen Day, University of California, Los Angeles and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/DB/BiblioI.pm0000644000175000017500000003405512123443121017763 0ustar carandraugcarandraugpackage Bio::DB::BiblioI; BEGIN { $Bio::DB::BiblioI::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::DB::BiblioI::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Root::RootI); # ABSTRACT: an interface to a Bibliographic Query Service # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 sub get_collection_id { my ($self,@args) = @_; $self->throw_not_implemented(); } # ----------------------------------------------------------------------------- sub get_count { shift->throw_not_implemented(); } # ----------------------------------------------------------------------------- sub find { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- # TBD: AFAIK this method is not implemented on the server side. # Let's comment it out for the time being... #sub query { shift->throw_not_implemented(); } # ----------------------------------------------------------------------------- sub reset_retrieval { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub get_next { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub get_more { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub has_next { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub get_all_ids { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub get_by_id { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub get_all { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub exists { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub destroy { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub get_vocabulary_names { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub contains { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub get_entry_description { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub get_all_values { shift->throw_not_implemented; } # ----------------------------------------------------------------------------- sub get_all_entries { shift->throw_not_implemented; } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::DB::BiblioI - an interface to a Bibliographic Query Service =head1 VERSION version 1.70 =head1 SYNOPSIS This is an interface module - you do not instantiate it. Use I module: use Bio::Biblio; my $biblio = Bio::Biblio->new(@args); =head1 DESCRIPTION This interface describes the methods for accessing a bibliographic repository, for querying it and for retrieving citations from it. The retrieved citations are in XML format and can be converted to perl objects using I. The interface complies (with some simplifications) with the specification described in the B project. Its home page is at http://www.ebi.ac.uk/~senger/openbqs/. =head1 ATTRIBUTES =head2 has_next Usage : my $is = $biblio->has_next; Returns : 1 or undef Args : none It returns 1 if there is a next citation available in the underlying query collection. Otherwise it returns undef. It throws an exception if this object does not represent any query result - see explanation in method I elsewhere in this document. =head2 exists Usage : my $exists = $biblio->exists; Returns : 1 or undef Args : none It returns 1 if the underlying query collection represented by the $biblio object still exists (on the server side). If you have a collection ID (e.g. stored or printed in a previous session) but you do not have anymore a C object representing it this is how you can check the collection existence: use Bio::Biblio; print Bio::Biblio->new(-collection_id => '1014324148861')->exists; It throws an exception if this object does not represent any query result - see explanation in method I elsewhere in this document. =head2 contains Usage : my $yes = $biblio->contains ($vocabulary_name, $value); Returns : 1 or undef Args : $vocabulary_name defines a vocabulary where to look, and a $value defines what to look for It returns 1 if the given controlled vocabulary contains the given value. For example, when you know, that a vocabulary C contains value C you can use it in the I method: $biblio->find ('United States', 'COUNTRY'); =head1 METHODS =head2 get_collection_id Usage : my $collection_id = $biblio->get_collection_id; Returns : string identifying a query collection represented by the $biblio object Args : none Every query collection is uniquely identify-able by its collection ID. The returned value can be used to populate another $biblio object and then to access that collection. =head2 get_count Usage : my $count = $biblio->get_count; Returns : integer Args : none, or a string identifying a query collection It returns a number of citations in the query collection represented by the calling $biblio object, or in the collection whose ID is given as an argument. =head2 find Usage : my $new_biblio = $biblio->find ($keywords, $attrs); my $new_biblio = $biblio->find ('perl', 'abstract'); my $new_biblio = $biblio->find ( [ 'perl', 'Java' ] ); Returns : new Bio::Biblio object representing a new query collection Args : $keywords - what to look for (mandatory) - a comma-delimited list of keywords, or - an array reference with keywords as elements $attrs - where to look in (optional) - a comma-delimited list of attribute names, or - an array reference with attribute names as elements This is the main query method. It looks for the $keywords in a default set of attributes, or - if $attrs given - only in the given attributes. Because it returns a new Bio::Biblio object which can be again queried it is possible to chain together several invocations: $biblio->find ('Brazma')->find ('Robinson')->get_collection_id; =head2 reset_retrieval Usage : $biblio->reset_retrieval; Returns : nothing Args : none It sets an iterator stored in the $biblio object back to its beginning. After this, the retrieval methods I, I and I start to iterate the underlying query collection again from its start. It throws an exception if this object does not represent any query result (e.i. it does not contain a collection ID). Note that a collection ID is created automatically when this object was returned by a I method, or it can be assigned in a constructor using argument I<-collection_id>. =head2 get_next Usage : my $citation = $biblio->get_next; Returns : a citation in an XML format Args : none It returns the next available citation from the underlying query collection. It throws an exception if there are no more citations. In order to avoid this, use it together with the I method: my $result = $biblio->find ('brazma', 'authors'); while ( $result->has_next ) { print $result->get_next; } It also throws an exception if this object does not represent any query result - see explanation in the I elsewhere in this document. =head2 get_more Usage : my $r_citations = $biblio->get_more (5); Returns : an array reference - each element has a citation in an XML format Args : an integer 'how_many' citations to return; default is 1 - but it is assigned with warning It returns the next I available citations from the underlying query collection. It does not throw any exception if 'how_many' is more than currently available - it simply returns less. However, it throws an exception if used again without calling first I. It also throws an exception if this object does not represent any query result - see explanation in method I elsewhere in this document. =head2 get_all_ids Usage : my $r_ids = $biblio->get_all_ids; Returns : an array reference - each element has a citation identifier Args : none The identifiers of all citations in the underlying query collection are returned. A usual pattern is to use them then in the I method: my $biblio = $repository->find ('brazma')->find ('robinson'); foreach my $id ( @{ $biblio->get_all_ids } ) { print $biblio->get_by_id ($id); } It throws an exception if this object does not represent any query result - see explanation in method I elsewhere in this document. =head2 get_by_id Usage : my $citation = $biblio->get_by_id ('12368254'); Returns : a citation in an XML format Args : a citation identifier (PMID for Medline) It returns a citation - disregarding if the citation is or is not in the underlying query collection (of course, it must be in the repository). =head2 get_all Usage : my $all = $biblio->get_all; Returns : a (big) string with all citations in an XML format Args : none It returns an XML valid string (which means that individual citations are also surrounded by a "set" XML tag) representing all citations from the underlying query collection. Note that some servers may limit the number of citations which can be returned by this method. In such case you need either to refine further your query collection (using I method) or to retrieve results by iteration (methods I, I, I). It throws an exception if this object does not represent any query result - see explanation in method I elsewhere in this document. =head2 destroy Usage : $biblio->destroy; Returns : nothing Args : none It sends a message to the remote server to forget (or free, or destroy - whatever server choose to do) the query collection represented by this object. It throws an exception if this object does not represent any query collection. =head2 get_vocabulary_names Usage : print join ("\n", @{ $biblio->get_vocabulary_names }); Returns : an array reference - each element has a name of a controlled vocabulary Args : none The controlled vocabularies allow to introspect bibliographic repositories and to find what citation resource types (such as journal and book articles, patents or technical reports) are provided by the repository, what attributes they have, eventually what attribute values are allowed. This method returns names of all available controlled vocabularies. The names can than be used in other methods dealing with vocabularies: I, I, I, and I. =head2 get_entry_description Usage : $biblio->get_entry_description ($voc_name, $value); Returns : a string with a desciption Args : $voc_name defines a vocabulary where to look, and a $value defines whose description to return Each vocabulary entry has its value (mandatory attribute), and can have a description (optional attribute). The description may be just a human readable explanation of an attribute, or it can have more exact meaning. For example, the server implementation of the bibliographic query service provided by the EBI puts into attribute descriptions words I and/or I to distinguish the role of the attributes. It throws an exception if either vocabulary or value do not exist. =head2 get_all_values Usage : $biblio->get_all_values ($vocabulary_name); Returns : an array reference - each element has a value (scalar) from the given controlled vocabulary Args : $vocabulary_name defines a vocabulary whose values are being returned It returns all values of the given vocabulary. It throws an exception if the vocabulary does not exist. =head2 get_all_entries Usage : $biblio->get_all_entries ($vocabulary_name); Returns : a hash reference - keys are vocabulary values and values are their descriptions Args : $vocabulary_name defines a vocabulary whose entries are being returned It returns pairs of values and their descriptions of the whole vocabulary. It throws an exception if the vocabulary does not exist. This is one way how to get it and print it: my $name = 'MEDLINE2005/JournalArticle/properties'; use Data::Dumper; print Data::Dumper->Dump ( [$biblio->get_all_entries ($name)], ['All entries']); =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/0000755000175000017500000000000012123443121017020 5ustar carandraugcarandraugBio-Biblio-1.70/lib/Bio/Biblio/Proceeding.pm0000644000175000017500000000656012123443121021444 0ustar carandraugcarandraugpackage Bio::Biblio::Proceeding; BEGIN { $Bio::Biblio::Proceeding::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Proceeding::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Ref); # ABSTRACT: representation of a conference proceeding # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Proceeding - representation of a conference proceeding =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Proceeding->new(-title => 'JavaONE'); #--- OR --- $obj = Bio::Biblio::Proceeding->new(); $obj->title ('JavaONE'); =head1 DESCRIPTION A storage object for a conference proceeding. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes There are no specific attributes in this class (however, you can set and get all attributes defined in the parent classes). =head1 BUGS AND LIMITATIONS This class should be probably somewhere else in the class hierarchy because a proceeding is actrually a collection of resources. Perhaps this will be changed in the future. =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/IO.pm0000644000175000017500000002541312123443121017672 0ustar carandraugcarandraugpackage Bio::Biblio::IO; BEGIN { $Bio::Biblio::IO::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::IO::VERSION = '1.70'; } use utf8; use strict; use warnings; use Symbol; use parent qw(Bio::Root::Root Bio::Root::IO); # ABSTRACT: Handling the bibliographic references # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 my $entry = 0; sub new { my ($caller, @args) = @_; my $class = ref ($caller) || $caller; # if $caller is an object, or if it is an underlying # 'real-work-doing' class (e.g. Bio::Biblio::IO::medlinexml) then # we want to call SUPER to create and bless an object if( $class =~ /Bio::Biblio::IO::(\S+)/ ) { my ($self) = $class->SUPER::new (@args); $self->_initialize (@args); return $self; # this is called only the first time when somebody calls: 'new # Bio::Biblio::IO (...)', and it actually loads a 'real-work-doing' # module and call this new() method again (unless the loaded # module has its own new() method) } else { my %param = @args; @param{ map { lc $_ } keys %param } = values %param; # lowercase keys my $format = $param{'-format'} || $class->_guess_format( $param{-file} || $ARGV[0] ) || 'medlinexml'; $format = "\L$format"; # normalize capitalization to lower case # load module with the real implementation - as defined in $format return unless (&_load_format_module ($format)); # this will call this same method new() - but rather its # upper (object) branche return "Bio::Biblio::IO::$format"->new(@args); } } sub newFh { my $class = shift; return unless my $self = $class->new(@_); return $self->fh; } sub fh { my $self = shift; my $class = ref($self) || $self; my $s = Symbol::gensym; tie $$s,$class,$self; return $s; } # _initialize is chained for all Bio::Biblio::IO classes sub _initialize { my ($self, @args) = @_; # initialize the IO part $self->_initialize_io (@args); } sub next_bibref { my ($self) = shift; $self->throw ("Sorry, you cannot read from a generic Bio::Biblio::IO object."); } # ----------------------------------------------------------------------------- sub _load_format_module { my ($format) = @_; my ($module, $load, $m); $module = "_throw (<close(); } sub TIEHANDLE { my ($class,$val) = @_; return bless {'biblio' => $val}, $class; } sub READLINE { my $self = shift; return $self->{'biblio'}->next_bibref() unless wantarray; my (@list, $obj); push @list, $obj while $obj = $self->{'biblio'}->next_bibref(); return @list; } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::IO - Handling the bibliographic references =head1 VERSION version 1.70 =head1 SYNOPSIS use Bio::Biblio::IO; # getting citations from a file $in = Bio::Biblio::IO->new ('-file' => 'myfile.xml' , '-format' => 'medlinexml'); # --- OR --- # getting citations from a string $in = Bio::Biblio::IO->new ('-data' => '...' , '-format' => 'medlinexml'); #--- OR --- # getting citations from a string if IO::String is installed use IO::String; $in = Bio::Biblio::IO->new ('-fh' => IO::String->new ($citation), '-format' => 'medlinexml'); $in = Bio::Biblio::IO->new(-fh => $io_handle , '-format' => 'medlinexml'); #--- OR --- # getting citations from any IO handler $in = Bio::Biblio::IO->new('-fh' => $io_handle , '-format' => 'medlinexml'); # now, having $in, we can read all citations while ( my $citation = $in->next_bibref() ) { &do_something_with_citation ($citation); } #--- OR --- # again reading all citation but now a callback defined in your # code is used (note that the reading starts already when new() # is called) $io = Bio::Biblio::IO->new('-format' => 'medlinexml', '-file' => $testfile, '-callback' => \&callback); sub callback { my $citation = shift; print $citation->{'_identifier'} . "\n"; } #Now, to actually get a citation in an XML format, #use I module which returns an XML string: use Bio::Biblio; use Bio::Biblio::IO; my $xml = Bio::Biblio->new->get_by_id ('12368254'); my $reader = Bio::Biblio::IO->new ('-data' => $xml, '-format' => 'medlinexml'); while (my $citation = $reader->next_bibref()) { #... do something here with $citation } #And, finally, the resulting citation can be received in different #output formats: $io = Bio::Biblio::IO->new('-format' => 'medlinexml', '-result' => 'raw'); #--- OR --- $io = Bio::Biblio::IO->new('-format' => 'medlinexml', '-result' => 'medline2ref'); #--- OR --- $io = Bio::Biblio::IO->new('-format' => 'pubmedxml', '-result' => 'pubmed2ref'); =head1 DESCRIPTION Bio::Biblio::IO is a handler module for accessing bibliographic citations. The citations can be in different formats - assuming that there is a corresponding module knowing that format in Bio::Biblio::IO directory (e.g. Bio::Biblio::IO::medlinexml). The format (and the module name) is given by the argument I<-format>. Once an instance of C class is available, the citations can be read by calling repeatedly method I: while (my $citation = $reader->next_bibref()) { ... do something here with $citation } However, this may imply that all citations were already read into the memory. If you expect a huge amount of citations to be read, you may choose a I option. Your subroutine is specified in the C method and is called everytime a new citation is available (see an example above in SYNOPSIS). The citations returned by I or given to your callback routine can be of different formats depending on the argument I<-result>. One result type is I and it is represented by a simple, not blessed hash table: $io = Bio::Biblio::IO->new('-result' => 'raw'); What other result formats are available depends on the module who reads the citations in the first place. At the moment, the following ones are available: $io = Bio::Biblio::IO->new('-result' => 'medline2ref'); This is a default result format for reading citations by the I module. The C module is again the default one. Which means that you can almost omit arguments (you still need to say where the citations come from): $io = Bio::Biblio::IO->new('-file' => 'data/medline_data.xml'); Another result format available is for PUBMED citations (which is a super-set of the MEDLINE citations having few more tags): $io = Bio::Biblio::IO->new('-format' => 'pubmedxml', '-result' => 'pubmed2ref', '-data' => $citation); Or, because C is a default one for PUBMED citations, you can say just: $io = Bio::Biblio::IO->new('-format' => 'pubmedxml', '-data' => $citation); Both C and C results are objects defined in the directory C. =head1 ATTRIBUTES =head2 fh =head1 METHODS =head2 new =head2 newFh =head2 next_bibref Usage : $citation = stream->next_bibref Function: Reads the next citation object from the stream and returns it. Returns : a Bio::Biblio::Ref citation object, or something else (depending on the '-result' argument given in the 'new()' method). Args : none =head2 DESTROY =head2 TIEHANDLE =head2 READLINE =head1 INTERNAL METHODS =head2 _initialize =head2 _load_format_module Usage : $class->_load_format_module ($format) Returns : 1 on success, undef on failure Args : 'format' should contain the last part of the name of a module who does the real implementation It does (in run-time) a similar thing as require Bio::Biblio::IO::$format It throws an exception if it fails to find and load the module (for example, because of the compilation errors in the module). =head2 _guess_format Usage : $class->_guess_format ($filename) Returns : string with a guessed format of the input data (e.g. 'medlinexml') Args : a file name whose extension can help to guess its format It makes an expert guess what kind of data are in the given file (but be prepare that $filename may be empty). =head1 SEE ALSO =over 4 =item * An example script F It has many options and its own help. The relevant options to this IO module are C<-f> (specifying what file to read) and C<-O> (specifying what result format to achieve). =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Service.pm0000644000175000017500000000624012123443121020760 0ustar carandraugcarandraugpackage Bio::Biblio::Service; BEGIN { $Bio::Biblio::Service::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Service::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Provider); # ABSTRACT: representation of a provider of type service # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _name => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Service - representation of a provider of type service =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Service->new(-name => 'Report generator'); #--- OR --- $obj = Bio::Biblio::Service->new(); $obj->name ('Report generator'); =head1 DESCRIPTION A storage object for a service (such a computer service) related to a bibliographic resource. =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): name =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/PubmedArticle.pm0000644000175000017500000001004012123443121022071 0ustar carandraugcarandraugpackage Bio::Biblio::PubmedArticle; BEGIN { $Bio::Biblio::PubmedArticle::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::PubmedArticle::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::MedlineArticle); # ABSTRACT: representation of a PUBMED article # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our @ISA; # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _pubmed_status => undef, _pubmed_provider_id => undef, _pubmed_history_list => 'ARRAY', _pubmed_article_id_list => 'ARRAY', _pubmed_url_list => 'ARRAY', ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; return 1 if exists $_allowed{$attr}; foreach my $parent (@ISA) { return 1 if $parent->_accessible ($attr); } } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { foreach my $parent (@ISA) { if ($parent->_accessible ($attr)) { return $parent->_attr_type ($attr); } } } return 'unknown'; } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::PubmedArticle - representation of a PUBMED article =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::PubmedArticle->new (-pubmed_history_list => [ { 'pub_status' => 'pubmed', 'date' => '2001-12-1T10:0:00Z' }, { 'pub_status' => 'medline', 'date' => '2002-1-5T10:1:00Z' } ], -pubmed_status => 'ppublish'); #--- OR --- $obj = Bio::Biblio::PubmedArticle->new(); $obj->pubmed_status ('ppublish'); =head1 DESCRIPTION A storage object for a general PUBMED article. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): pubmed_status pubmed_provider_id pubmed_history_list type: array ref of hashes pubmed_article_id_list type: array ref of hashes pubmed_url_list type: array ref of hashes =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Ref.pm0000644000175000017500000001560312123443121020077 0ustar carandraugcarandraugpackage Bio::Biblio::Ref; BEGIN { $Bio::Biblio::Ref::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Ref::VERSION = '1.70'; } use utf8; use strict; use warnings; use Bio::Annotation::DBLink; use parent qw(Bio::Biblio::BiblioBase); # ABSTRACT: representation of a bibliographic reference # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our $AUTOLOAD; # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _author_list_complete => undef, _authors => 'ARRAY', # of Bio::Biblio::Provider _cross_references => 'ARRAY', # of Bio::Annotation::DBLink _cross_references_list_complete => undef, _abstract => undef, _abstract_language => undef, _abstract_type => undef, _codes => 'HASH', _contributors => 'ARRAY', # of Bio::Biblio::Provider _date => undef, _date_completed => undef, _date_created => undef, _date_revised => undef, _format => undef, _identifier => undef, _keywords => 'HASH', _language => undef, _last_modified_date => undef, _publisher => 'Bio::Biblio::Provider', _repository_subset => undef, _rights => undef, _spatial_location => undef, _subject_headings => 'HASH', _subject_headings_source => undef, _temporal_period => undef, _title => undef, _toc => undef, _toc_type => undef, _type => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr}; } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; $_allowed{$attr}; } } sub add_cross_reference { my ($self, $value) = @_; $self->throw ($self->_wrong_type_msg (ref $value, 'Bio::Annotation::DBLink')) unless (UNIVERSAL::isa ($value, 'Bio::Annotation::DBLink')); (defined $self->cross_references) ? push (@{ $self->cross_references }, $value) : return $self->cross_references ( [$value] ); return $self->cross_references; } sub add_author { my ($self, $value) = @_; $self->throw ($self->_wrong_type_msg (ref $value, 'Bio::Biblio::Provider')) unless (UNIVERSAL::isa ($value, 'Bio::Biblio::Provider')); (defined $self->authors) ? push (@{ $self->authors }, $value) : return $self->authors ( [$value] ); return $self->authors; } sub add_contributor { my ($self, $value) = @_; $self->throw ($self->_wrong_type_msg (ref $value, 'Bio::Biblio::Provider')) unless (UNIVERSAL::isa ($value, 'Bio::Biblio::Provider')); (defined $self->contributors) ? push (@{ $self->contributors }, $value) : return $self->contributors ( [$value] ); return $self->contributors; } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Ref - representation of a bibliographic reference =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Ref->new(-type => 'Letter', -title => 'Onegin to Tatiana'); #--- OR --- $obj = Bio::Biblio::Ref->new(); $obj->type ('Letter'); =head1 DESCRIPTION A storage object for a general bibliographic reference (a citation). See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class, and they are inherited by all citation types. author_list_complete values: 'Y' (default) or 'N' authors type: array ref of Bio::Biblio::Provider's cross_references type: array ref of Bio::Annotation::DBLink's cross_references_list_complete values: 'Y' (default) or 'N' abstract abstract_language abstract_type codes type: hash ref contributors type: array ref of Bio::Biblio::Provider's date date_completed date_created date_revised format identifier keywords language last_modified_date publisher type: Bio::Biblio::Provider repository_subset rights spatial_location subject_headings type: hash ref subject_headings_source temporal_period title toc toc_type type =head1 METHODS =head2 add_cross_reference Usage : $self->add_cross_reference (Bio::Annotation::DBLink->new(-database => 'EMBL', -primary_id => 'V00808'); Function: adding a link to a database entry Returns : new value of 'cross_references' Args : an object of type Bio::Annotation::DBLink =head2 add_author Usage : $self->add_author (Bio::Biblio::Person->new(-lastname => 'Novak'); Function: adding an author to a list of authors Returns : new value of 'authors' (a full list) Args : an object of type Bio::Biblio::Provider =head2 add_contributor Usage : $self->add_contributor (Bio::Biblio::Person->new(-lastname => 'Novak'); Function: adding a contributor to a list of contributors Returns : new value of 'contributors' (a full list) Args : an object of type Bio::Biblio::Provider =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Organisation.pm0000644000175000017500000000622412123443121022017 0ustar carandraugcarandraugpackage Bio::Biblio::Organisation; BEGIN { $Bio::Biblio::Organisation::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Organisation::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Provider); # ABSTRACT: representation of an organisation # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _name => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Organisation - representation of an organisation =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Organisation->new(-name => 'O\'Reilly'); #--- OR --- $obj = Bio::Biblio::Organisation->new(); $obj->name ('O\'Reilly'); =head1 DESCRIPTION A storage object for an organisation related to a bibliographic resource. =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): name =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/WebResource.pm0000644000175000017500000000664312123443121021614 0ustar carandraugcarandraugpackage Bio::Biblio::WebResource; BEGIN { $Bio::Biblio::WebResource::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::WebResource::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Ref); # ABSTRACT: representation of a web resource # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _url => undef, _estimated_size => undef, _cost => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::WebResource - representation of a web resource =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::WebResource->new (-url => 'http://resources/best.html', -estimated_size => 45000); # --- OR --- $obj = Bio::Biblio::WebResource->new(); $obj->cost ('0.3 EURO'); =head1 DESCRIPTION A storage object for a citation quoting a web resource. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): url estimated_size cost =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/TechReport.pm0000644000175000017500000000656412123443121021450 0ustar carandraugcarandraugpackage Bio::Biblio::TechReport; BEGIN { $Bio::Biblio::TechReport::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::TechReport::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Ref); # ABSTRACT: representation of a technical report # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::TechReport - representation of a technical report =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::TechReport->new (-authors => [ Bio::Biblio::Person->new(-lastname => 'Hasek'), Bio::Biblio::Person->new(-lastname => 'Jagr'), Bio::Biblio::Organisation->new(-name => 'NHL'), ] -title => 'Pinned in the corner'); =head1 DESCRIPTION A storage object for a technical report. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes There are no specific attributes in this class (however, you can set and get all attributes defined in the parent classes). =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/PubmedBookArticle.pm0000644000175000017500000000706612123443121022722 0ustar carandraugcarandraugpackage Bio::Biblio::PubmedBookArticle; BEGIN { $Bio::Biblio::PubmedBookArticle::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::PubmedBookArticle::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::PubmedArticle Bio::Biblio::MedlineBookArticle); # ABSTRACT: representation of a PUBMED book article # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our @ISA; # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; return 1 if exists $_allowed{$attr}; foreach my $parent (@ISA) { return 1 if $parent->_accessible ($attr); } } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { foreach my $parent (@ISA) { if ($parent->_accessible ($attr)) { return $parent->_attr_type ($attr); } } } return 'unknown'; } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::PubmedBookArticle - representation of a PUBMED book article =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::PubmedBookArticle->new (-title => 'Still getting started'. -book => Bio::Biblio::MedlineBook->new()); # note that there is no specialised class PubmedBook #--- OR --- $obj = Bio::Biblio::PubmedBookArticle->new(); $obj->title ('Still getting started'); =head1 DESCRIPTION A storage object for a PUBMED book article. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes There are no specific attributes in this class (however, you can set and get all attributes defined in the parent classes). =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Article.pm0000644000175000017500000000663412123443121020752 0ustar carandraugcarandraugpackage Bio::Biblio::Article; BEGIN { $Bio::Biblio::Article::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Article::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Ref); # ABSTRACT: representation of a general article # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _first_page => undef, _last_page => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Article - representation of a general article =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Article->new(-identifier => '123abc', -first_page => 23, -last_page => 68); #--- OR --- $obj = Bio::Biblio::Article->new(); $obj->identifier ('123abc'); $obj->first_page (23); $obj->last_page (68); =head1 DESCRIPTION A storage object for a general article. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): first_page last_page =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Person.pm0000644000175000017500000000701212123443121020624 0ustar carandraugcarandraugpackage Bio::Biblio::Person; BEGIN { $Bio::Biblio::Person::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Person::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Provider); # ABSTRACT: representation of a person # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _affiliation => undef, _email => undef, _firstname => undef, _forename => undef, _initials => undef, _lastname => undef, _middlename => undef, _postal_address => undef, _suffix => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Person - representation of a person =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Person->new(-lastname => 'Capek', -firstname => 'Karel'); #--- OR --- $obj = Bio::Biblio::Person->new(); $obj->firstname ('Karel'); $obj->lastname ('Capek'); =head1 DESCRIPTION A storage object for a person related to a bibliographic resource. =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): affiliation email firstname forename initials lastname middlename postal_address suffix =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/MedlineJournal.pm0000644000175000017500000000672012123443121022273 0ustar carandraugcarandraugpackage Bio::Biblio::MedlineJournal; BEGIN { $Bio::Biblio::MedlineJournal::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::MedlineJournal::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Journal); # ABSTRACT: representation of a MEDLINE journal # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _coden => undef, _country => undef, _medline_code => undef, _medline_ta => undef, _nlm_unique_id => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::MedlineJournal - representation of a MEDLINE journal =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::MedlineJournal->new (-medline_ta => 'J Vasc Interv Radiol'); #--- OR --- $obj = Bio::Biblio::MedlineJournal->new(); $obj->medline_ta ('J Vasc Interv Radiol'); =head1 DESCRIPTION A storage object for a MEDLINE journal. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): coden country medline_code medline_ta nlm_unique_id =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Thesis.pm0000644000175000017500000000615312123443121020622 0ustar carandraugcarandraugpackage Bio::Biblio::Thesis; BEGIN { $Bio::Biblio::Thesis::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Thesis::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Ref); # ABSTRACT: representation of thesis # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Thesis - representation of thesis =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Thesis->new(-title => 'Perl on the edge'); #--- OR --- $obj = Bio::Biblio::Thesis->new(); $obj->title ('Perl on the edge'); =head1 DESCRIPTION A storage object for thesis. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes There are no specific attributes in this class (however, you can set and get all attributes defined in the parent classes). =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Book.pm0000644000175000017500000000707012123443121020254 0ustar carandraugcarandraugpackage Bio::Biblio::Book; BEGIN { $Bio::Biblio::Book::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Book::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Ref); # ABSTRACT: Representation of a book # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _edition => undef, _editor => 'Bio::Biblio::Provider', _isbn => undef, _series => undef, _title => undef, _volume => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Book - Representation of a book =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Book->new(-identifier => '123abc', -editor => Bio::Biblio::Person->new (-lastname => 'Loukides'), -isbn => '0-596-00068-5'); #--- OR --- $obj = Bio::Biblio::Book->new(); $obj->isbn ('0-596-00068-5'); =head1 DESCRIPTION A storage object for a book. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): edition editor type: Bio::Biblio::Provider isbn series title volume =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/IO/0000755000175000017500000000000012123443121017327 5ustar carandraugcarandraugBio-Biblio-1.70/lib/Bio/Biblio/IO/pubmedxml.pm0000644000175000017500000002176412123443121021674 0ustar carandraugcarandraugpackage Bio::Biblio::IO::pubmedxml; BEGIN { $Bio::Biblio::IO::pubmedxml::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::IO::pubmedxml::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::IO::medlinexml); # ABSTRACT: a converter of XML files with PUBMED citations # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our %PCDATA_NAMES; our %SIMPLE_TREATMENT; our %POP_DATA_AND_PEEK_OBJ; our %POP_AND_ADD_DATA_ELEMENT; sub _initialize { my ($self, @args) = @_; # make a hashtable from @args my %param = @args; @param { map { lc $_ } keys %param } = values %param; # lowercase keys # copy all @args into this object (overwriting what may already be # there) - changing '-key' into '_key', and making keys lowercase my $new_key; foreach my $key (keys %param) { ($new_key = $key) =~ s/^-/_/; $self->{ lc $new_key } = $param { $key }; } # find the format for output - and put it into a global $Convert # because it will be used by the event handler who knows nothing # about this object my $result = $self->{'_result'} || 'pubmed2ref'; $result = "\L$result"; # normalize capitalization to lower case # a special case is 'raw' when no converting module is loaded # and citations will be returned as a hashtable (the one which # is created during parsing XML file/stream) unless ($result eq 'raw') { # load module with output converter - as defined in $result if (defined &Bio::Biblio::IO::_load_format_module ($result)) { $Bio::Biblio::IO::medlinexml::Convert = "Bio::Biblio::IO::$result"->new (@args); } } # create an instance of the XML parser # (unless it is already there...) $self->{'_xml_parser'} = XML::Parser->new (Handlers => {Init => \&Bio::Biblio::IO::medlinexml::handle_doc_start, Start => \&handle_start, End => \&handle_end, Char => \&Bio::Biblio::IO::medlinexml::handle_char, Final => \&Bio::Biblio::IO::medlinexml::handle_doc_end}) unless $self->{'_xml_parser'}; # if there is an argument '-callback' then start parsing at once - # the registered event handlers will use 'callback' to report # back after each citation # # we need to remember this situation also in a global variable # because the event handler subroutines know nothing about this # object (unfortunately) if ($SUPER::Callback = $self->{'_callback'}) { $self->_parse; } } # --------------------------------------------------------------------- # # Here are the event handlers (they do the real job!) # # Note that these methods do not know anything about the object they # are part of - they are called as subroutines. not as methods. # It also means that they need to use global variables to store and # exchnage intermediate results. # # --------------------------------------------------------------------- # # This is a list of #PCDATA elements. # %PCDATA_NAMES = ( 'PublicationStatus' => 1, 'ProviderId' => 1, 'ArticleId' => 1, 'URL' => 1, ); %SIMPLE_TREATMENT = ( 'History' => 1, 'PubMedArticle' => 1, 'PubmedArticle' => 1, 'PubmedData' => 1, ); %POP_DATA_AND_PEEK_OBJ = ( 'Year' => 1, 'Month' => 1, 'Day' => 1, 'Hour' => 1, 'Minute' => 1, 'Second' => 1, 'ProviderId' => 1, 'PublicationStatus' => 1, ); %POP_AND_ADD_DATA_ELEMENT = ( 'PubMedPubDate' => 'pubDates', 'History' => 'histories', ); sub handle_start { my ($expat, $e, %attrs) = @_; # &Bio::Biblio::IO::medlinexml::_debug_object_stack ("START", $e); # # The #PCDATA elements which have an attribute list must # be first here - because for them I create entries both on # the @PCDataStack _and_ on @ObjectStack. # if ($e eq 'ArticleId') { my %p = (); $p{'idType'} = (defined $attrs{'IdType'} ? $attrs{'IdType'} : 'pubmed'); push (@Bio::Biblio::IO::medlinexml::ObjectStack, \%p); } if ($e eq 'URL') { my %p = (); $p{'type'} = $attrs{'type'} if $attrs{'type'}; $p{'lang'} = $attrs{'lang'} if $attrs{'lang'}; push (@Bio::Biblio::IO::medlinexml::ObjectStack, \%p); } # # Then we have #PCDATA elements without an attribute list. # For them I create an entry on @PCDataStack. # if (exists $PCDATA_NAMES{$e}) { push (@Bio::Biblio::IO::medlinexml::PCDataStack, ''); # # And finally, all non-PCDATA elements go to the objectStack # } elsif (exists $SIMPLE_TREATMENT{$e}) { push (@Bio::Biblio::IO::medlinexml::ObjectStack, {}); } elsif ($e eq 'ArticleIdList') { ; } elsif ($e eq 'PubMedPubDate') { my %p = (); $p{'pubStatus'} = $attrs{'PubStatus'} if $attrs{'PubStatus'}; push (@Bio::Biblio::IO::medlinexml::ObjectStack, \%p); } else { &Bio::Biblio::IO::medlinexml::handle_start ($expat, $e, %attrs); } } sub handle_end { my ($expat, $e) = @_; # # First I have to deal with those elements which are both PCDATA # (and therefore they are on the pcdataStack) and which have an # attribute list (therefore they are also known as a separate # p-object on the objectStack. # if ($e eq 'ArticleId') { &Bio::Biblio::IO::medlinexml::_data2obj ('id'); &Bio::Biblio::IO::medlinexml::_add_element ('pubmedArticleIds', pop @Bio::Biblio::IO::medlinexml::ObjectStack); # &Bio::Biblio::IO::medlinexml::_debug_object_stack ("END", $e); return; } if ($e eq 'URL') { &Bio::Biblio::IO::medlinexml::_data2obj ('URL'); &Bio::Biblio::IO::medlinexml::_add_element ('pubmedURLs', pop @Bio::Biblio::IO::medlinexml::ObjectStack); # &Bio::Biblio::IO::medlinexml::_debug_object_stack ("END", $e); return; } # # both object and pcdata stacks elements mixed here together # if (exists $POP_DATA_AND_PEEK_OBJ{$e}) { &Bio::Biblio::IO::medlinexml::_data2obj ("\l$e"); } elsif (exists $POP_AND_ADD_DATA_ELEMENT{$e}) { &Bio::Biblio::IO::medlinexml::_add_element ($POP_AND_ADD_DATA_ELEMENT{$e}, pop @Bio::Biblio::IO::medlinexml::ObjectStack); } elsif ($e eq 'MedlineCitation' || $e eq 'NCBIArticle') { &Bio::Biblio::IO::medlinexml::_obj2obj ('Citation'); } elsif ($e eq 'PubmedData') { &Bio::Biblio::IO::medlinexml::_obj2obj ('PubmedData'); } elsif ($e eq 'PubMedArticle' || $e eq 'PubmedArticle') { # # Here we finally have the whole citation ready. # &Bio::Biblio::IO::medlinexml::_process_citation (pop @Bio::Biblio::IO::medlinexml::ObjectStack); } else { &Bio::Biblio::IO::medlinexml::handle_end ($expat, $e); } # &Bio::Biblio::IO::medlinexml::_debug_object_stack ("END", $e); } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::IO::pubmedxml - a converter of XML files with PUBMED citations =head1 VERSION version 1.70 =head1 SYNOPSIS Do not use this object directly, it is recommended to access it and use it through the I module: use Bio::Biblio::IO; my $io = Bio::Biblio::IO->new(-format => 'pubmedxml'); =head1 DESCRIPTION This object reads bibliographic citations in XML/MEDLINE format and converts them into I objects. It is an implementation of methods defined in I. The main documentation details are to be found in L. =head1 FUNCTIONS =head2 handle_start =head2 handle_end =head1 INTERNAL METHODS =head2 _initialize =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/IO/pubmed2ref.pm0000644000175000017500000001040412123443121021717 0ustar carandraugcarandraugpackage Bio::Biblio::IO::pubmed2ref; BEGIN { $Bio::Biblio::IO::pubmed2ref::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::IO::pubmed2ref::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::IO::medline2ref); # ABSTRACT: a converter of a raw hash to PUBMED citations # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # --------------------------------------------------------------------- # # Here is the core... # # --------------------------------------------------------------------- sub _load_instance { my ($self, $source) = @_; my $result; my $article = $$source{'article'}; if (defined $article) { if (defined $$article{'journal'}) { $result = $self->_new_instance ('Bio::Biblio::PubmedJournalArticle'); $result->type ('JournalArticle'); } elsif (defined $$article{'book'}) { $result = $self->_new_instance ('Bio::Biblio::PubmedBookArticle'); $result->type ('BookArticle'); } else { $result->type ('PubmedArticle'); } } $result = $self->_new_instance ('Bio::Biblio::Ref') unless defined $result; return $result; } sub convert { my ($self, $source) = @_; my $result = $self->SUPER::convert ($source->{'Citation'}); # here we do PUBMED's specific stuff my $pubmed_data = $$source{'PubmedData'}; if (defined $pubmed_data) { # ... just take it (perhaps rename it) $result->pubmed_status ($$pubmed_data{'publicationStatus'}) if defined $$pubmed_data{'publicationStatus'}; $result->pubmed_provider_id ($$pubmed_data{'providerId'}) if defined $$pubmed_data{'providerId'}; $result->pubmed_article_id_list ($$pubmed_data{'pubmedArticleIds'}) if defined $$pubmed_data{'pubmedArticleIds'}; $result->pubmed_url_list ($$pubmed_data{'pubmedURLs'}) if defined $$pubmed_data{'pubmedURLs'}; # ... put all dates from all 'histories' into one array if (defined $$pubmed_data{'histories'}) { my @history_list; foreach my $history ( @{ $$pubmed_data{'histories'} } ) { my $ra_pub_dates = $$history{'pubDates'}; foreach my $pub_date ( @{ $ra_pub_dates } ) { my %history = (); my $converted_date = &Bio::Biblio::IO::medline2ref::_convert_date ($pub_date); $history{'date'} = $converted_date if defined $converted_date; $history{'pub_status'} = $$pub_date{'pubStatus'} if defined $$pub_date{'pubStatus'}; push (@history_list, \%history); } } $result->pubmed_history_list (\@history_list); } } # Done! return $result; } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::IO::pubmed2ref - a converter of a raw hash to PUBMED citations =head1 VERSION version 1.70 =head1 SYNOPSIS # to be written =head1 DESCRIPTION # to be written =head1 METHODS =head2 convert =head1 INTERNAL METHODS =head2 _load_instance =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/IO/medline2ref.pm0000644000175000017500000005013312123443121022063 0ustar carandraugcarandraugpackage Bio::Biblio::IO::medline2ref; BEGIN { $Bio::Biblio::IO::medline2ref::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::IO::medline2ref::VERSION = '1.70'; } use utf8; use strict; use warnings; use Bio::Annotation::DBLink; use Bio::Biblio::MedlineJournal; use Bio::Biblio::MedlineBook; use Bio::Biblio::Provider; use Bio::Biblio::Person; use Bio::Biblio::Organisation; use parent qw(Bio::Root::Root); # ABSTRACT: a converter of a raw hash to MEDLINE citations # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 sub new { my ($caller, @args) = @_; my $class = ref ($caller) || $caller; # object creation and blessing my ($self) = $class->SUPER::new (@args); # make a hashtable from @args my %param = @args; @param { map { lc $_ } keys %param } = values %param; # lowercase keys # copy all @args into this object (overwriting what may already be # there) - changing '-key' into '_key', and making keys lowercase my $new_key; foreach my $key (keys %param) { ($new_key = $key) =~ s/^-/_/; $self->{ lc $new_key } = $param { $key }; } # done return $self; } # --------------------------------------------------------------------- # # Here is the core... # # --------------------------------------------------------------------- sub _load_instance { my ($self, $source) = @_; # # MEDLINE has only JournalArticles and BookArticles # but we may create a general Ref if there is no attribute 'article' # my $result; my $article = $$source{'article'}; if (defined $article) { if (defined $$article{'journal'}) { $result = $self->_new_instance ('Bio::Biblio::MedlineJournalArticle'); $result->type ('JournalArticle'); } elsif (defined $$article{'book'}) { $result = $self->_new_instance ('Bio::Biblio::MedlineBookArticle'); $result->type ('BookArticle'); } else { $result->type ('MedlineArticle'); } } $result = $self->_new_instance ('Bio::Biblio::Ref') unless defined $result; return $result; } sub convert { my ($self, $source) = @_; my $result = $self->_load_instance ($source); if (defined $result->type) { if ($result->type eq 'JournalArticle') { &_convert_journal_article ($result, $source); } elsif ($result->type eq 'BookArticle') { &_convert_book_article ($result, $source); } elsif ($result->type eq 'Article') { &_convert_article ($result, $source); } } # # now do the attributes which are the same for all resource types # # ...identification is now by MedlineID but the trend is to replace # it by PMID (I have heard) theefore we keep both also separately # from the 'identifier' if (defined $$source{'medlineID'}) { $result->identifier ($$source{'medlineID'}); } else { $result->identifier ($$source{'PMID'}); } $result->pmid ($$source{'PMID'}) if defined $$source{'PMID'}; $result->medline_id ($$source{'medlineID'}) if defined $$source{'medlineID'}; # ...few others $result->citation_owner ($$source{'owner'}) if defined $$source{'owner'}; $result->status ($$source{'status'}) if defined $$source{'status'}; $result->number_of_references ($$source{'numberOfReferences'}) if defined $$source{'numberOfReferences'}; # ...entry status of the citation in the repository my $date; if (defined $$source{'dateRevised'}) { $result->last_modified_date (&_convert_date ($$source{'dateRevised'})); $date = &_convert_date ($$source{'dateCreated'}); $result->date_created ($date) if defined $date; $date = &_convert_date ($$source{'dateCompleted'}); $result->date_completed ($date) if defined $date; } elsif (defined $$source{'dateCompleted'}) { $result->last_modified_date (&_convert_date ($$source{'dateCompleted'})); $date = &_convert_date ($$source{'dateCreated'}); $result->date_created ($date) if defined $date; } elsif (defined $$source{'dateCreated'}) { $result->last_modified_date (&_convert_date ($$source{'dateCreated'})); } # ...put citation subsets in a comma-separated string if (defined $$source{'citationSubsets'}) { $result->repository_subset (join (',', @{ $$source{'citationSubsets'} })); } # ...MEDLINE's Comments & Corrections will be arrays of hashes if (defined $$source{'commentsCorrections'}) { my $corr = $$source{'commentsCorrections'}; $result->comment_ons ($$corr{'commentOns'}) if defined $$corr{'commentOns'}; $result->comment_ins ($$corr{'commentIns'}) if defined $$corr{'commentIns'}; $result->erratum_ins ($$corr{'erratumIns'}) if defined $$corr{'erratumIns'}; $result->erratum_fors ($$corr{'erratumFors'}) if defined $$corr{'erratumFors'}; $result->original_report_ins ($$corr{'originalReportIns'}) if defined $$corr{'originalReportIns'}; $result->republished_froms ($$corr{'republishedFroms'}) if defined $$corr{'republishedFroms'}; $result->republished_ins ($$corr{'republishedIns'}) if defined $$corr{'republishedIns'}; $result->retraction_ofs ($$corr{'retractionOfs'}) if defined $$corr{'retractionOfs'}; $result->retraction_ins ($$corr{'retractionIns'}) if defined $$corr{'retractionIns'}; $result->summary_for_patients_ins ($$corr{'summaryForPatientsIns'}) if defined $$corr{'summaryForPatientsIns'}; $result->update_ins ($$corr{'updateIns'}) if defined $$corr{'updateIns'}; $result->update_ofs ($$corr{'updateOfs'}) if defined $$corr{'updateOfs'}; } # ...MEDLINE's GeneSymbols are put in a comma-separated string if (defined $$source{'geneSymbols'}) { $result->gene_symbols (join (',', @{ $$source{'geneSymbols'} })); } # ...MEDLINE's GeneralNotes into an array of hashtables, each one # having keys for the 'owner' and the 'note' $result->general_notes ($$source{'generalNotes'}) if defined $$source{'generalNotes'}; # ...MEDLINE's PersonalNameSubjects into contributors (TBD: is that correct?) if (defined $$source{'personalNameSubjects'}) { my @contributors; foreach my $person ( @{ $$source{'personalNameSubjects'} } ) { push (@contributors, &_convert_personal_name ($person)); } $result->contributors (\@contributors); } # ...MEDLINE's OtherAbstract into an array of hashtables, each one # having keys for the 'type', 'AbstractText' and the 'copyright' $result->other_abstracts ($$source{'otherAbstracts'}) if defined $$source{'otherAbstracts'}; # if (defined $$source{'otherAbstracts'}) { # my @other_abstracts = (); # foreach my $oa ( @{ $$source{'otherAbstracts'} } ) { # if (defined $$oa{'abstractText'}) { # my $abstract = $$oa{'abstractText'}; # delete $$oa{'abstractText'}; # $$oa{'abstract'} = $$abstract{'abstractText'}; # $$oa{'rights'} = $$abstract{'copyrightInformation'} if defined $$abstract{'copyrightInformation'}; # push (@other_abstracts, $oa); # } # } # $result->other_abstracts (\@other_abstracts); # } # ...MEDLINE's OtherIDs into an array of hashtables, each one # having keys for the 'id', and 'source' $result->other_ids ($$source{'otherIDs'}) if defined $$source{'otherIDs'}; # ...MEDLINE's Chemicals - store them as an array of hashtables # (each one for each Chemical) $result->chemicals ($$source{'chemicals'}) if defined $$source{'chemicals'}; # MeshHeadings are put on two places: # - a complete information in a property called "MeshHeadings", and # - only descriptors in the hashtable "subject_headings", together # with the word "MeSH" in "subject_headings_source" if (defined $$source{'meshHeadings'}) { $result->mesh_headings ($$source{'meshHeadings'}); my %subject_headings; foreach my $mesh ( @{ $$source{'meshHeadings'} } ) { $subject_headings{ $$mesh{'descriptorName'} } = 1 if defined $$mesh{'descriptorName'}; } if (%subject_headings) { $result->subject_headings (\%subject_headings); $result->subject_headings_source ('Mesh'); } } # ...MEDLINE's keyword lists are merger all together (this may not # be good idea - but again the keywords are better accessible # -TBD?) if (defined $$source{'keywordLists'}) { my %keywords; foreach my $keywords ( @{ $$source{'keywordLists'} } ) { if ($$keywords{'keywords'}) { foreach my $keyword ( @{ $$keywords{'keywords'} } ) { $keywords{$keyword} = 1; } } } $result->keywords (\%keywords) if %keywords; } # Done! return $result; } sub _new_instance { my ($self, $module) = @_; my ($filename); ($filename = $module . '.pm') =~ s|\:\:|/|g; eval { require $filename; }; $self->throw ("Loading error when trying '$filename'. $@\n") if $@; return $module->new; } sub _convert_date { my ($date) = @_; return unless exists $$date{'year'} or exists $$date{'month'} or exists $$date{'day'} or exists $$date{'hour'} or exists $$date{'minute'} or exists $$date{'second'}; my $converted = (exists $$date{'year'} ? $$date{'year'} : '0000'); if (exists $$date{'month'}) { $converted .= '-' . $$date{'month'}; } elsif (exists $$date{'day'}) { $converted .= '-00'; } if (exists $$date{'day'}) { $converted .= '-' . $$date{'day'}; } elsif (exists $$date{'hour'}) { $converted .= '-00'; } if (exists $$date{'hour'}) { $converted .= 'T' . $$date{'hour'} . ':' . (exists $$date{'minute'} ? $$date{'minute'} : '00') . ':' . (exists $$date{'second'} ? $$date{'second'} : '00') . 'Z'; } return $converted; } sub _convert_personal_name { my ($person) = @_; foreach my $key (keys %$person) { $$person{"_$key"} = $$person{$key}; delete $$person{$key}; } Bio::Biblio::Person->new(%$person); } sub _convert_journal_article { my ($result, $source) = @_; my $article = $$source{'article'}; # create and populate both a Journal and a resulting Article objects my $from_journal = $$article{'journal'}; my $journal = Bio::Biblio::MedlineJournal->new(); $journal->name ($$from_journal{'title'}) if defined $$from_journal{'title'}; $journal->issn ($$from_journal{'iSSN'}) if defined $$from_journal{'iSSN'}; $journal->abbreviation ($$from_journal{'iSOAbbreviation'}) if defined $$from_journal{'iSOAbbreviation'}; $journal->coden ($$from_journal{'coden'}) if defined $$from_journal{'coden'}; if (defined $$from_journal{'journalIssue'}) { my $issue = $$from_journal{'journalIssue'}; $result->volume ($$issue{'volume'}) if defined $$issue{'volume'}; $result->issue ($$issue{'issue'}) if defined $$issue{'issue'}; if (defined $$issue{'pubDate'}) { my $pub_date = $$issue{'pubDate'}; my $converted = &_convert_date ($pub_date); $result->date ($converted) if defined $converted; # Some parts of a MEDLINE date are stored just as properties # because they have almost non-parseable format :-). $result->medline_date ($$pub_date{'medlineDate'}) if defined $$pub_date{'medlineDate'}; $result->season ($$pub_date{'season'}) if defined $$pub_date{'season'}; } } # ...some attributes are in journalInfo (which is outside of the article) my $journal_info = $$source{'journalInfo'}; if (defined $journal_info) { $journal->country ($$journal_info{'country'}) if defined $$journal_info{'country'}; $journal->medline_ta ($$journal_info{'medlineTA'}) if defined $$journal_info{'medlineTA'}; $journal->medline_code ($$journal_info{'medlineCode'}) if defined $$journal_info{'medlineCode'}; $journal->nlm_unique_id ($$journal_info{'nlmUniqueID'}) if defined $$journal_info{'nlmUniqueID'}; } $result->journal ($journal); &_convert_article ($result, $source); } sub _convert_book_article { my ($result, $source) = @_; my $article = $$source{'article'}; # create and populate both book and resulting article objects my $from_book = $$article{'book'}; my $book = Bio::Biblio::MedlineBook->new(); $book->title ($$from_book{'title'}) if defined $$from_book{'title'}; $book->volume ($$from_book{'volume'}) if defined $$from_book{'volume'}; $book->series ($$from_book{'collectionTitle'}) if defined $$from_book{'collectionTitle'}; if (defined $$from_book{'pubDate'}) { my $pub_date = $$from_book{'pubDate'}; my $converted = &_convert_date ($pub_date); $result->pub_date ($converted) if defined $converted; # Some parts of a MEDLINE date are stored just as properties # because they have almost non-parseable format :-). $result->medline_date ($$pub_date{'medlineDate'}) if defined $$pub_date{'medlineDate'}; $result->season ($$pub_date{'season'}) if defined $$pub_date{'season'}; } if (defined $$from_book{'publisher'}) { my $publisher = Bio::Biblio::Organisation->new(); $publisher->name ($$from_book{'publisher'}); $book->publisher ($publisher); } my @authors = &_convert_providers ($$from_book{'authors'}); $book->authors (\@authors) if @authors; $result->book ($book); &_convert_article ($result, $source); } sub _convert_article { my ($article, $source) = @_; my $from_article = $$source{'article'}; $article->title ($$from_article{'articleTitle'}) if defined $$from_article{'articleTitle'}; $article->affiliation ($$from_article{'affiliation'}) if defined $$from_article{'affiliation'}; $article->vernacular_title ($$from_article{'vernacularTitle'}) if defined $$from_article{'vernacularTitle'}; $article->date_of_electronic_publication ($$from_article{'dateOfElectronicPublication'}) if defined $$from_article{'dateOfElectronicPublication'}; if (defined $$from_article{'pagination'}) { my $pagination = $$from_article{'pagination'}; $article->first_page ($$pagination{'startPage'}) if defined $$pagination{'startPage'}; $article->last_page ($$pagination{'endPage'}) if defined $$pagination{'endPage'}; $article->medline_page ($$pagination{'medlinePgn'}) if defined $$pagination{'medlinePgn'}; } if (defined $$from_article{'abstract'}) { my $abstract = $$from_article{'abstract'}; $article->abstract ($$abstract{'abstractText'}) if defined $$abstract{'abstractText'}; $article->abstract_type ('text/plain'); $article->rights ($$abstract{'copyrightInformation'}) if defined $$abstract{'copyrightInformation'}; } if (defined $$from_article{'languages'}) { my $languages = $$from_article{'languages'}; # ref-array if ( @{ $languages } > 0) { $article->language ( $$languages[0] ); } if ( @{ $languages } > 1) { $article->other_languages (join (',', @{ $languages })); } } my @authors = &_convert_providers ($$from_article{'authors'}); if (@authors) { $article->authors (\@authors); $article->author_list_complete ($$from_article{'authorListComplete'}) if defined $$from_article{'authorListComplete'}; } # references to database entries are prefixed with database name # (separated by a slash) if (defined $$from_article{'dataBanks'}) { my $databanks = $$from_article{'dataBanks'}; # a ref-array my @references; foreach my $bank ( @{ $databanks } ) { my $db_name = $$bank{'dataBankName'}; if (defined $$bank{'accessionNumbers'}) { foreach my $accn ( @{ $$bank{'accessionNumbers'} } ) { my $dblink = Bio::Annotation::DBLink->new(-primary_id => $accn); $dblink->database ($db_name); # it does not matter if it is undef push (@references, $dblink); } } } if (@references) { $article->cross_references (\@references); $article->cross_references_list_complete ($$from_article{'dataBankListComplete'}) if defined $$from_article{'dataBankListComplete'}; } } # grants are stored in an array of hashtables (each of the # hashtables has keys agency, grantID and acronym) $article->grants ($$from_article{'grants'}) if defined $$from_article{'grants'}; $article->grant_list_complete ($$from_article{'grantListComplete'}) if defined $$from_article{'grandListComplete'}; } sub _convert_providers { my ($providers) = @_; return () unless defined $providers; my @results; foreach my $provider ( @{ $providers } ) { if (defined $$provider{'personalName'}) { my $converted = &_convert_personal_name ($$provider{'personalName'}); push (@results, $converted) if defined $converted; } elsif (defined $$provider{'collectiveName'}) { push (@results, Bio::Biblio::Organisation->new(-name => $$provider{'collectiveName'})); } else { Bio::Biblio::Provider->new(); } } return () unless @results; return @results; } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::IO::medline2ref - a converter of a raw hash to MEDLINE citations =head1 VERSION version 1.70 =head1 SYNOPSIS # to be written =head1 DESCRIPTION # to be written =head1 METHODS =head2 new =head2 convert =head1 INTERNAL METHODS =head2 _load_instance =head2 _new_instance Load a module (given as a real module name, e.g. 'Bio::Biblio::MedlineJournalArticle'), call new() method on it, and return the instance returned by the new() method =head2 _convert_date See OpenBQS specification (http://www.ebi.ac.uk/~senger/openbqs/) how a date should be coded; TBD: this can be improved - checking is missing, timezones, converting to UTC... Also note that this routine does not convert 'medline_date' - it is stored in a separate attribute without ant conversion. =head2 _convert_personal_name $person is a hash with persons attributes - we need to create and return a Bio::Biblio::Person object =head2 _convert_journal_article Takes journal article related attributes from $article and convert them into $result and at the end call _convert_article (which is shared with book article) =head2 _convert_book_article Takes book article related attributes from $article and convert them into $result and at the end call _convert_article (which is shared with journal article) =head2 _convert_article Takes from $source article related attributes and convert them into $article (these attributes are the same both for journal and book articles =head2 _convert_providers Takes a ref-array of providers - they can be persons or organisations, and returns an array of converted providers =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/IO/medlinexml.pm0000644000175000017500000006070212123443121022030 0ustar carandraugcarandraugpackage Bio::Biblio::IO::medlinexml; BEGIN { $Bio::Biblio::IO::medlinexml::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::IO::medlinexml::VERSION = '1.70'; } use utf8; use strict; use warnings; use XML::Parser; use parent qw(Bio::Biblio::IO); # ABSTRACT:a converter of XML files with MEDLINE citations # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our @Citations; our $Callback; our $Convert; our @ObjectStack; our @PCDataStack; our %PCDATA_NAMES; our %SIMPLE_TREATMENT; our %POP_DATA_AND_PEEK_OBJ; our %POP_OBJ_AND_PEEK_OBJ; our %POP_AND_ADD_ELEMENT; our %POP_AND_ADD_DATA_ELEMENT; sub _initialize { my ($self, @args) = @_; # make a hashtable from @args my %param = @args; @param { map { lc $_ } keys %param } = values %param; # lowercase keys # copy all @args into this object (overwriting what may already be # there) - changing '-key' into '_key', and making keys lowercase my $new_key; foreach my $key (keys %param) { ($new_key = $key) =~ s/^-/_/; $self->{ lc $new_key } = $param { $key }; } # find the format for output - and put it into a global $Convert # because it will be used by the event handler who knows nothing # about this object my $result = $self->{'_result'} || 'medline2ref'; $result = "\L$result"; # normalize capitalization to lower case # a special case is 'raw' when no converting module is loaded # and citations will be returned as a hashtable (the one which # is created during parsing XML file/stream) unless ($result eq 'raw') { # load module with output converter - as defined in $result if (defined &Bio::Biblio::IO::_load_format_module ($result)) { $Convert = "Bio::Biblio::IO::$result"->new (@args); } } # create an instance of the XML parser # (unless it is already there...) $self->{'_xml_parser'} = XML::Parser->new (Handlers => {Init => \&handle_doc_start, Start => \&handle_start, End => \&handle_end, Char => \&handle_char, Final => \&handle_doc_end}) unless $self->{'_xml_parser'}; # if there is an argument '-callback' then start parsing at once - # the registered event handlers will use 'callback' to report # back after each citation # # we need to remember this situation also in a global variable # because the event handler subroutines know nothing about this # object (unfortunately) if ($Callback = $self->{'_callback'}) { $self->_parse; } } sub _parse { my ($self) = shift; if (defined $self->{'_file'}) { $self->{'_xml_parser'}->parsefile ($self->{'_file'}); } elsif (defined $self->{'_fh'}) { my $fh = $self->{'_fh'}; if (ref ($fh) and UNIVERSAL::isa ($fh, 'IO::Handler')) { $self->{'_xml_parser'}->parse ($fh); } else { my $data; $data .= $_ while <$fh>; $self->{'_xml_parser'}->parse ($data); } } elsif ($self->{'_data'}) { $self->{'_xml_parser'}->parse ($self->{'_data'}); } else { $self->throw ("XML source to be parsed is unknown. Should be given in the new()."); } # when parsing is done all citations have already been delivered # to the caller using her callbacks - and nothing to be stored # here, or parser put all citations into global @Cittaions where # we want to copy there into this instance - so any caller can # start parsing other XML input without overwriting already read # citations from the first parser if (@Citations) { $self->{'_citations'} = []; foreach my $cit (@Citations) { push (@{ $self->{'_citations'} }, $cit); undef $cit; } undef @Citations; } } # --------------------------------------------------------------------- # # Here is an implementation of Bio::Biblio::IO methods # # --------------------------------------------------------------------- # global variables used by the XML event handlers # TBD: make them accessible at least ONLY from this module... @Citations = (); $Callback = undef; $Convert = undef; @ObjectStack = (); # it has Hash-Ref elements @PCDataStack = (); # it has String elements sub next_bibref { my ($self) = @_; $self->throw ("Method 'next_bibref' should not be called when a '-callback' argument given.") if $self->{'_callback'}; # parse the whole input into memory (global @Citations) # and then copy it into this object $self->_parse unless $self->{'_citations'}; # return the next citation (and forget it here) shift (@{ $self->{'_citations'} }); } # --------------------------------------------------------------------- # # Here are the event handlers (they do the real job!) # # Note that these methods do not know anything about the object they # are part of - they are called as subroutines. not as methods. # It also means that they need to use global variables to store and # exchnage intermediate results. # # --------------------------------------------------------------------- # # This is a list of #PCDATA elements. # %PCDATA_NAMES = ( 'AbstractText' => 1, 'AccessionNumber' => 1, 'Acronym' => 1, 'Affiliation' => 1, 'Agency' => 1, 'ArticleTitle' => 1, 'CASRegistryNumber' => 1, 'CitationSubset' => 1, 'Coden' => 1, 'CollectionTitle' => 1, 'CollectiveName' => 1, 'CopyrightInformation' => 1, 'Country' => 1, 'DataBankName' => 1, 'DateOfElectronicPublication' => 1, 'Day' => 1, 'Descriptor' => 1, 'DescriptorName' => 1, 'EndPage' => 1, 'FirstName' => 1, 'ForeName' => 1, 'GeneralNote' => 1, 'GeneSymbol' => 1, 'GrantID' => 1, 'Hour' => 1, 'ISOAbbreviation' => 1, 'ISSN' => 1, 'Initials' => 1, 'Issue' => 1, 'Keyword' => 1, 'Language' => 1, 'LastName' => 1, 'MedlineCode' => 1, 'MedlineDate' => 1, 'MedlineID' => 1, 'MedlinePgn' => 1, 'MedlineTA' => 1, 'MiddleName' => 1, 'Minute' => 1, 'Month' => 1, 'NameOfSubstance' => 1, 'NlmUniqueID' => 1, 'Note' => 1, 'NumberOfReferences' => 1, 'OtherID' => 1, 'PMID' => 1, 'PublicationType' => 1, 'Publisher' => 1, 'QualifierName' => 1, 'RefSource' => 1, 'RegistryNumber' => 1, 'Season' => 1, 'Second' => 1, 'SpaceFlightMission' => 1, 'StartPage' => 1, 'SubHeading' => 1, 'Suffix' => 1, 'Title' => 1, 'VernacularTitle' => 1, 'Volume' => 1, 'Year' => 1, ); %SIMPLE_TREATMENT = ( 'MeshHeading' => 1, 'Author' => 1, 'Article' => 1, 'Book' => 1, 'Investigator' => 1, 'Chemical' => 1, 'Pagination' => 1, 'MedlineJournalInfo' => 1, 'JournalIssue' => 1, 'Journal' => 1, 'DateCreated' => 1, 'DateCompleted' => 1, 'DateRevised' => 1, 'PubDate' => 1, 'Abstract' => 1, 'Grant' => 1, 'CommentsCorrections' => 1, 'CommentOn' => 1, 'CommentIn' => 1, 'ErratumFor' => 1, 'ErratumIn' => 1, 'OriginalReportIn' => 1, 'RepublishedFrom' => 1, 'RepublishedIn' => 1, 'RetractionOf' => 1, 'RetractionIn' => 1, 'SummaryForPatientsIn' => 1, 'UpdateIn' => 1, 'UpdateOf' => 1, 'DataBank' => 1, 'KeywordList' => 1, 'DeleteCitation' => 1, ); %POP_DATA_AND_PEEK_OBJ = ( 'Descriptor' => 1, 'DescriptorName' => 1, 'Year' => 1, 'Month' => 1, 'Day' => 1, 'LastName' => 1, 'Initials' => 1, 'FirstName' => 1, 'ForeName' => 1, 'NameOfSubstance' => 1, 'RegistryNumber' => 1, 'CASRegistryNumber' => 1, 'MiddleName' => 1, 'NlmUniqueID' => 1, 'MedlineTA' => 1, 'MedlinePgn' => 1, 'MedlineCode' => 1, 'Country' => 1, 'ISSN' => 1, 'ArticleTitle' => 1, 'Issue' => 1, 'AbstractText' => 1, 'VernacularTitle' => 1, 'GrantID' => 1, 'Agency' => 1, 'Acronym' => 1, 'MedlineDate' => 1, 'NumberOfReferences' => 1, 'RefSource' => 1, 'DataBankName' => 1, 'CopyrightInformation' => 1, 'Suffix' => 1, 'Note' => 1, 'CollectiveName' => 1, 'Hour' => 1, 'Minute' => 1, 'Second' => 1, 'Season' => 1, 'Coden' => 1, 'ISOAbbreviation' => 1, 'Publisher' => 1, 'CollectionTitle' => 1, 'DateOfElectronicPublication' => 1, 'StartPage' => 1, 'EndPage' => 1, 'Volume' => 1, 'Title' => 1, ); %POP_OBJ_AND_PEEK_OBJ = ( 'Pagination' => 1, 'JournalIssue' => 1, 'Journal' => 1, 'DateCreated' => 1, 'Article' => 1, 'DateCompleted' => 1, 'DateRevised' => 1, 'CommentsCorrections' => 1, 'Book' => 1, 'PubDate' => 1, 'Abstract' => 1, ); %POP_AND_ADD_DATA_ELEMENT = ( 'Keyword' => 'keywords', 'PublicationType' => 'publicationTypes', 'CitationSubset' => 'citationSubsets', 'Language' => 'languages', 'AccessionNumber' => 'accessionNumbers', 'GeneSymbol' => 'geneSymbols', 'SpaceFlightMission' => 'spaceFlightMissions', ); %POP_AND_ADD_ELEMENT = ( 'OtherAbstract' => 'otherAbstracts', 'Chemical' => 'chemicals', 'KeywordList' => 'keywordLists', 'Grant' => 'grants', 'UpdateIn' => 'updateIns', 'CommentOn' => 'commentOns', 'CommentIn' => 'commentIns', 'DataBank' => 'dataBanks', 'PersonalNameSubject' => 'personalNameSubjects', 'ErratumFor' => 'erratumFors', 'ErratumIn' => 'erratumIns', 'RepublishedFrom' => 'republishedFroms', 'RepublishedIn' => 'republishedIns', 'RetractionOf' => 'retractionOfs', 'RetractionIn' => 'retractionIns', 'UpdateOf' => 'updateOfs', 'OriginalReportIn' => 'originalReportIns', 'SummaryForPatientsIn' => 'summaryForPatientsIns', 'MeshHeading' => 'meshHeadings', ); sub handle_doc_start { @Citations = (); @ObjectStack = (); @PCDataStack = (); } sub handle_doc_end { undef @ObjectStack; undef @PCDataStack; } sub handle_char { my ($expat, $str) = @_; # this may happen with whitespaces between tags; # but because I have not created an entry for data on the stack # I can also ignore such data, can't I return if $#PCDataStack < 0; $PCDataStack [$#PCDataStack] .= $str; } sub handle_start { my ($expat, $e, %attrs) = @_; # &_debug_object_stack ("START", $e); # # The #PCDATA elements which have an attribute list must # be first here - because for them I create entries both on # the @PCDataStack _and_ on @ObjectStack. # if ($e eq 'QualifierName' or $e eq 'SubHeading') { my %p = (); $p{'majorTopic'} = $attrs{'MajorTopicYN'} if $attrs{'MajorTopicYN'}; push (@ObjectStack, \%p); } if ($e eq 'GeneralNote') { my %p = (); $p{'owner'} = $attrs{'Owner'} if $attrs{'Owner'}; push (@ObjectStack, \%p); } if ($e eq 'OtherID') { my %p = (); $p{'source'} = $attrs{'Source'}; push (@ObjectStack, \%p); } # # A special treatment is for attributes for personal name. # Because there is no XML element 'PersonalName' I need to # to put yet another object on @ObjectStack unless there is # already one. # if ($e eq 'LastName' or $e eq 'FirstName' or $e eq 'MidleName' or $e eq 'Initials' or $e eq 'ForeName' or $e eq 'Suffix') { my $peek = $ObjectStack[$#ObjectStack]; push (@ObjectStack, {'type' => 'PersonalName'}) unless (ref $peek and &_eq_hash_elem ($peek, 'type', 'PersonalName')); } # # Then we have #PCDATA elements without an attribute list. # For them I create an entry on @PCDataStack. # if (exists $PCDATA_NAMES{$e}) { push (@PCDataStack, ''); # # And finally, all non-PCDATA elements go to the objectStack # } elsif (exists $SIMPLE_TREATMENT{$e}) { push (@ObjectStack, {}); } elsif ($e eq 'PersonalNameSubject') { push (@ObjectStack, {'type' => 'PersonalName'}); } elsif ($e eq 'DescriptorName' or $e eq 'Descriptor') { if (&_eq_hash_elem (\%attrs, 'MajorTopicYN', "Y")) { my $peek = $ObjectStack[$#ObjectStack]; $$peek{'descriptorMajorTopic'} = "Y"; } } elsif ($e eq 'MedlineCitation' || $e eq 'NCBIArticle') { my %p = ( 'type' => 'MedlineCitation' ); $p{'owner'} = $attrs{'Owner'} if $attrs{'Owner'}; $p{'status'} = $attrs{'Status'} if $attrs{'Status'}; push (@ObjectStack, \%p); } elsif ($e eq 'GrantList') { if (&_eq_hash_elem (\%attrs, 'CompleteYN', "N")) { my $peek = $ObjectStack[$#ObjectStack]; $$peek{'grantListComplete'} = "N"; } } elsif ($e eq 'DataBankList') { if (&_eq_hash_elem (\%attrs, 'CompleteYN', "N")) { my $peek = $ObjectStack[$#ObjectStack]; $$peek{'dataBankListComplete'} = "N"; } } elsif ($e eq 'AuthorList') { if (&_eq_hash_elem (\%attrs, 'CompleteYN', "N")) { my $peek = $ObjectStack[$#ObjectStack]; $$peek{'authorListComplete'} = "N"; } } elsif ($e eq 'OtherAbstract') { my %p = (); $p{'type'} = $attrs{'Type'} if $attrs{'Type'}; push (@ObjectStack, \%p); # push (@ObjectStack, { 'type' => 'Abstract' }); } } sub handle_end { my ($expat, $e) = @_; # # First I have to deal with those elements which are both PCDATA # (and therefore they are on the pcdataStack) and which have an # attribute list (therefore they are also known as a separate # p-object on the objectStack. # if ($e eq 'QualifierName' or $e eq 'SubHeading') { my $p = pop @ObjectStack; # pSubHeading $$p{'subHeading'} = pop @PCDataStack; &_add_element ('subHeadings', $p); # adding to pMeshHeadings # &_debug_object_stack ("END", $e); return; } elsif ($e eq 'GeneralNote') { my $p = pop @ObjectStack; # pGeneralNote $$p{'generalNote'} = pop @PCDataStack; &_add_element ('generalNotes', $p); # adding to pMedlineCitation # &_debug_object_stack ("END", $e); return; } elsif ($e eq 'OtherID') { my $p = pop @ObjectStack; # pOtherID $$p{'otherID'} = pop @PCDataStack; &_add_element ('otherIDs', $p); # adding to pMedlineCitation # &_debug_object_stack ("END", $e); return; } # # both object and pcdata stacks elements mixed here together # (the element names appear in the order of frequency in the # medline data set) # if (exists $POP_DATA_AND_PEEK_OBJ{$e}) { &_data2obj ("\l$e"); } elsif (exists $POP_OBJ_AND_PEEK_OBJ{$e}) { &_obj2obj ("\l$e"); } elsif (exists $POP_AND_ADD_ELEMENT{$e}) { &_add_element ($POP_AND_ADD_ELEMENT{$e}, pop @ObjectStack); } elsif (exists $POP_AND_ADD_DATA_ELEMENT{$e}) { &_add_element ($POP_AND_ADD_DATA_ELEMENT{$e}); } elsif ($e eq 'Author' or $e eq 'Investigator') { my $pAuthor; my $p = pop @ObjectStack; # pPersonalName or pAuthor if (&_eq_hash_elem ($p, 'type', 'PersonalName')) { $pAuthor = pop @ObjectStack; $$pAuthor{'personalName'} = $p; } else { $pAuthor = $p; } my $peek = $ObjectStack[$#ObjectStack]; # pMedlineCitation, pArticle or pBook if (&_eq_hash_elem ($peek, 'type', 'MedlineCitation')) { &_add_element ('investigators', $pAuthor); } else { &_add_element ('authors', $pAuthor); } } elsif ($e eq 'MedlineJournalInfo') { &_obj2obj ('journalInfo'); } elsif ($e eq 'PMID') { my $peek = $ObjectStack[$#ObjectStack]; # pMedlineCitation, pReference or pDeleteCitation if (&_eq_hash_elem ($peek, 'type', 'DeleteCitation')) { &_add_element ('PMIDs'); } else { $$peek{'PMID'} = pop @PCDataStack; } } elsif ($e eq 'MedlineID') { my $peek = $ObjectStack[$#ObjectStack]; # pMedlineCitation, pReference or pDeleteCitation if (&_eq_hash_elem ($peek, 'type', 'DeleteCitation')) { &_add_element ('MedlineIDs'); } else { $$peek{'medlineID'} = pop @PCDataStack; } # } elsif ($e eq 'OtherAbstract') { # my $pAbstract = pop @ObjectStack; # my $pOtherAbstract = pop @ObjectStack; # $$pOtherAbstract{'abstract'} = $pAbstract # &_add_element ('otherAbstracts', $pOtherAbstract); } elsif ($e eq 'Affiliation') { my $peek = $ObjectStack[$#ObjectStack]; if (&_eq_hash_elem ($peek, 'type', 'PersonalName')) { my $peek2 = $ObjectStack[$#ObjectStack - 1]; $$peek2{'affiliation'} = pop @PCDataStack; } else { $$peek{'affiliation'} = pop @PCDataStack; } } elsif ($e eq 'DeleteCitation') { pop @ObjectStack; ### warn ("'DeleteCitation' tag found. Not known what to do with it."); # silently ignored } elsif ($e eq 'MedlineCitation') { # # Here we finally have the whole citation ready. # &_process_citation (pop @ObjectStack); # # ERROR: if we are here, there was an unexpected element # } elsif (exists $PCDATA_NAMES{$e}) { pop @PCDataStack; warn ("An unexpected element found: $e"); } # &_debug_object_stack ("END", $e); } sub _process_citation { my ($citation) = @_; $citation = $Convert->convert ($citation) if defined $Convert; if ($Callback) { &$Callback ($citation); } else { push (@Citations, $citation); } } sub _add_element { my ($key, $element) = @_; my $peek = $ObjectStack[$#ObjectStack]; $$peek{$key} = [] unless $$peek{$key}; push (@{ $$peek{$key} }, (defined $element ? $element : pop @PCDataStack)); } sub _data2obj { my ($key) = @_; my $peek = $ObjectStack[$#ObjectStack]; $$peek{$key} = pop @PCDataStack; } sub _obj2obj { my ($key) = @_; my $p = pop @ObjectStack; my $peek = $ObjectStack[$#ObjectStack]; $$peek{$key} = $p; } sub _eq_hash_elem { my ($rh, $key, $value) = @_; return (defined $$rh{$key} and $$rh{$key} eq $value); } our %DEBUGSTACK = (); sub _debug_object_stack { my ($action, $element) = @_; if ($action =~ /^START/o) { $DEBUGSTACK{$element} = (@ObjectStack+0); } else { return if $element eq 'LastName'; print "Element $element starts on " . $DEBUGSTACK{$element} . 'and ends on ' . (@ObjectStack+0) . "\n" if $DEBUGSTACK{$element} != (@ObjectStack+0); } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::IO::medlinexml - a converter of XML files with MEDLINE citations =head1 VERSION version 1.70 =head1 SYNOPSIS Do not use this object directly, it is recommended to access it and use it through the I module: use Bio::Biblio::IO; my $io = Bio::Biblio::IO->new(-format => 'medlinexml'); =head1 DESCRIPTION This object reads bibliographic citations in XML/MEDLINE format and converts them into I objects. It is an implementation of methods defined in I. The main documentation details are to be found in L. =head1 METHODS =head2 next_bibref =head1 FUNCTIONS =head2 handle_doc_start =head2 handle_doc_end =head2 handle_char =head2 handle_start =head2 handle_end =head1 INTERNAL METHODS =head2 _initialize =head2 _parse =head2 _process_citation What to do when we have the whole $citation ready =head2 _add_element Add $element into an array named $key to the top object at @ObjectStack; if $element is empty, take it from @PCDataStack =head2 _data2obj Remove top of @PCDataStack and put it into top object at @ObjectStack under name $key =head2 _obj2obj Remove top of @ObjectStack and put it into now-top at @ObjectStack under name $key =head2 _eq_hash_elem Check if a $key exists in a ref-hash $rh and if it is equal to $value =head2 _debug_object_stack --- only for debugging =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Journal.pm0000644000175000017500000000636712123443121021004 0ustar carandraugcarandraugpackage Bio::Biblio::Journal; BEGIN { $Bio::Biblio::Journal::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Journal::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::BiblioBase); # ABSTRACT: representation of a journal # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _abbreviation => undef, _issn => undef, _name => undef, _provider => 'Bio::Biblio::Provider', ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr}; } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; $_allowed{$attr}; } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Journal - representation of a journal =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Journal->new(-name => 'The Perl Journal', -issn => '1087-903X'); #--- OR --- $obj = Bio::Biblio::Journal->new(); $obj->issn ('1087-903X'); =head1 DESCRIPTION A storage object for a journal. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): abbreviation issn name provider type: Bio::Biblio::Provider =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Patent.pm0000644000175000017500000000660312123443121020616 0ustar carandraugcarandraugpackage Bio::Biblio::Patent; BEGIN { $Bio::Biblio::Patent::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Patent::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Ref); # ABSTRACT: representation of a patent # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _doc_number => undef, _doc_office => undef, _doc_type => undef, _applicants => 'ARRAY', ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Patent - representation of a patent =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::Patent->new(-doc_number => '1-2-3-4-5'); #--- OR --- $obj = Bio::Biblio::Patent->new(); $obj->doc_number ('1-2-3-4-5'); =head1 DESCRIPTION A storage object for a patent. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): doc_number doc_office doc_type applicants type: array ref of Bio::Biblio::Providers =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/MedlineJournalArticle.pm0000644000175000017500000000775512123443121023610 0ustar carandraugcarandraugpackage Bio::Biblio::MedlineJournalArticle; BEGIN { $Bio::Biblio::MedlineJournalArticle::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::MedlineJournalArticle::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::MedlineArticle Bio::Biblio::JournalArticle); # ABSTRACT: representation of a MEDLINE journal article # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our @ISA; # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _journal => 'Bio::Biblio::MedlineJournal', ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; return 1 if exists $_allowed{$attr}; foreach my $parent (@ISA) { return 1 if $parent->_accessible ($attr); } } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { foreach my $parent (@ISA) { if ($parent->_accessible ($attr)) { return $parent->_attr_type ($attr); } } } return 'unknown'; } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::MedlineJournalArticle - representation of a MEDLINE journal article =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::MedlineJournalArticle->new( -title => 'Thermal adaptation analyzed by comparison of protein sequences from mesophilic and extremely thermophilic Methanococcus species.', -journal => Bio::Biblio::MedlineJournal->new(-issn => '0027-8424'), -volume => 96, -issue => 7); #--- OR --- $obj = Bio::Biblio::MedlineJournalArticle->new(); $obj->title ('...'); $obj->journal (Bio::Biblio::MedlineJournal->new(-issn => '0027-8424')); =head1 DESCRIPTION A storage object for a MEDLINE journal article. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): journal type: Bio::Biblio::MedlineJournal =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/PubmedJournalArticle.pm0000644000175000017500000001036012123443121023431 0ustar carandraugcarandraugpackage Bio::Biblio::PubmedJournalArticle; BEGIN { $Bio::Biblio::PubmedJournalArticle::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::PubmedJournalArticle::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::PubmedArticle Bio::Biblio::MedlineJournalArticle); # ABSTRACT: representation of a PUBMED journal article # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our @ISA; # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; return 1 if exists $_allowed{$attr}; foreach my $parent (@ISA) { return 1 if $parent->_accessible ($attr); } } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { foreach my $parent (@ISA) { if ($parent->_accessible ($attr)) { return $parent->_attr_type ($attr); } } } return 'unknown'; } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::PubmedJournalArticle - representation of a PUBMED journal article =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::PubmedJournalArticle->new( # some attributes from MedlineJournalArticle -title => 'Thermal adaptation analyzed by comparison of protein sequences from mesophilic and extremely thermophilic Methanococcus species.', -journal => Bio::Biblio::MedlineJournal->new(-issn => '0027-8424'), -volume => 96, -issue => 7, # and some from PubmedArticle -pubmed_history_list => [ { 'pub_status' => 'pubmed', 'date' => '2001-12-1T10:0:00Z' }, { 'pub_status' => 'medline', 'date' => '2002-1-5T10:1:00Z' } ], -pubmed_status => 'ppublish'); #--- OR --- $obj = Bio::Biblio::PubmedJournalArticle->new(); $obj->title ('...'); $obj->journal (Bio::Biblio::MedlineJournal->new(-issn => '0027-8424')); $obj->pubmed_status ('ppublish'); =head1 DESCRIPTION A storage object for a PUBMED journal article. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes There are no specific attributes in this class (however, you can set and get all attributes defined in the parent classes). =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/MedlineBook.pm0000644000175000017500000000660512123443121021555 0ustar carandraugcarandraugpackage Bio::Biblio::MedlineBook; BEGIN { $Bio::Biblio::MedlineBook::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::MedlineBook::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Book); # ABSTRACT: representation of a MEDLINE book # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::MedlineBook - representation of a MEDLINE book =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::MedlineBook->new (-editor => Bio::Biblio::Person->new (-lastname => 'Loukides'), -isbn => '0-596-00068-5'); #--- OR --- $obj = Bio::Biblio::MedlineBook->new(); $obj->isbn ('0-596-00068-5'); =head1 DESCRIPTION A storage object for a MEDLINE book. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes There are no specific attributes in this class (however, you can set and get all attributes defined in the parent classes). The main raison d'etre of this class is to be associated with MEDLINE book articles. =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/MedlineBookArticle.pm0000644000175000017500000000744412123443121023063 0ustar carandraugcarandraugpackage Bio::Biblio::MedlineBookArticle; BEGIN { $Bio::Biblio::MedlineBookArticle::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::MedlineBookArticle::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::BookArticle Bio::Biblio::MedlineArticle); # ABSTRACT: representation of a MEDLINE book article # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our @ISA; # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _book => 'Bio::Biblio::MedlineBook', ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); return 1 if exists $_allowed{$attr}; foreach my $parent (@ISA) { return 1 if $parent->_accessible ($attr); } } # return an expected type of given $attr # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { foreach my $parent (@ISA) { if ($parent->_accessible ($attr)) { return $parent->_attr_type ($attr); } } } return 'unknown'; } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::MedlineBookArticle - representation of a MEDLINE book article =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::MedlineBookArticle->new (-title => 'Getting started'. -book => Bio::Biblio::MedlineBook->new()); #--- OR --- $obj = Bio::Biblio::MedlineBookArticle->new(); $obj->title ('Getting started'); =head1 DESCRIPTION A storage object for a MEDLINE book. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): book type: Bio::Biblio::MedlineBook =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/MedlineArticle.pm0000644000175000017500000001442212123443121022242 0ustar carandraugcarandraugpackage Bio::Biblio::MedlineArticle; BEGIN { $Bio::Biblio::MedlineArticle::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::MedlineArticle::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Article); # ABSTRACT: representation of a MEDLINE article # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _affiliation => undef, _chemicals => 'ARRAY', _citation_owner => undef, _comment_ins => 'ARRAY', _comment_ons => 'ARRAY', _date_of_electronic_publication => undef, _erratum_fors => 'ARRAY', _erratum_ins => 'ARRAY', _gene_symbols => undef, _general_notes => 'ARRAY', _grant_list_complete => undef, _grants => 'ARRAY', _medline_date => undef, _medline_id => undef, _medline_page => undef, _mesh_headings => 'ARRAY', _number_of_references => undef, _original_report_ins => 'ARRAY', _other_abstracts => 'ARRAY', _other_ids => 'ARRAY', _other_languages => undef, _pmid => undef, _republished_froms => 'ARRAY', _republished_ins => 'ARRAY', _retraction_ins => 'ARRAY', _retraction_ofs => 'ARRAY', _season => undef, _status => undef, _summary_for_patients_ins => 'ARRAY', _update_ins => 'ARRAY', _update_ofs => 'ARRAY', _vernacular_title => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::MedlineArticle - representation of a MEDLINE article =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::MedlineArticle->new(-mesh_headings => #array ref of hashes ); # how are Mesh terms stored: use Data::Dumper; print Data::Dumper->Dump ( [$obj->mesh_headings], ['MeshHeadings']); #It produces (something like) this: #'MeshHeadings' => [ # { 'descriptorName' => 'Adult' }, # { 'descriptorName' => 'Cardiovascular Diseases', # 'subHeadings' => [ { 'subHeading' => 'etiology' }, # { 'majorTopic' => 'Y', # 'subHeading' => 'mortality' } ] }, # { 'descriptorName' => 'Child Development', # 'subHeadings' => [ { 'majorTopic' => 'Y', # 'subHeading' => 'physiology' } ] }, # { 'descriptorName' => 'Human' }, # ] =head1 DESCRIPTION A storage object for a MEDLINE article. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): affiliation chemicals type: array ref of hashes citation_owner comment_ins type: array ref of hashes comment_ons type: array ref of hashes date_of_electronic_publication erratum_fors type: array ref of hashes erratum_in type: array ref of hashes gene_symbols general_notes type: array ref of hashes grant_list_complete grants type: array ref of hashes medline_date medline_id medline_page mesh_headings type: array ref of hashes number_of_references original_report_ins type: array ref of hashes other_abstracts type: array ref of hashes other_ids type: array ref of hashes other_languages pmid republished_froms type: array ref of hashes republished_ins type: array ref of hashes retraction_ins type: array ref of hashes retraction_ofs type: array ref of hashes season status summary_for_patients_ins type: array ref of hashes update_ins type: array ref of hashes update_ofs type: array ref of hashes vernacular_title =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/BiblioBase.pm0000644000175000017500000001331412123443121021353 0ustar carandraugcarandraugpackage Bio::Biblio::BiblioBase; BEGIN { $Bio::Biblio::BiblioBase::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::BiblioBase::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Root::Root); # ABSTRACT: an abstract base for other biblio classes # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our $AUTOLOAD; sub _accessible { shift->throw_not_implemented(); } sub _attr_type { shift->throw_not_implemented(); } sub AUTOLOAD { my ($self, $newval) = @_; if ($AUTOLOAD =~ /.*::(\w+)/ && $self->_accessible ("_$1")) { my $attr_name = "_$1"; my $attr_type = $self->_attr_type ($attr_name); my $ref_sub = sub { my ($this, $new_value) = @_; return $this->{$attr_name} unless defined $new_value; # here we continue with 'set' method my ($newval_type) = ref ($new_value) || 'string'; my ($expected_type) = $attr_type || 'string'; # $this->throw ("In method $AUTOLOAD, trying to set a value of type '$newval_type' but '$expected_type' is expected.") $this->throw ($this->_wrong_type_msg ($newval_type, $expected_type, $AUTOLOAD)) unless ($newval_type eq $expected_type) or UNIVERSAL::isa ($new_value, $expected_type); $this->{$attr_name} = $new_value; return $new_value; }; no strict 'refs'; *{$AUTOLOAD} = $ref_sub; use strict 'refs'; return $ref_sub->($self, $newval); } $self->throw ("No such method: $AUTOLOAD"); } sub new { my ($caller, @args) = @_; my $class = ref ($caller) || $caller; # create and bless a new instance my ($self) = $class->SUPER::new (@args); # make a hashtable from @args my %param = @args; @param { map { lc $_ } keys %param } = values %param; # lowercase keys # set all @args into this object with 'set' values; # change '-key' into '_key', and making keys lowercase my $new_key; foreach my $key (keys %param) { ($new_key = $key) =~ s/-/_/og; # change it everywhere, why not my $method = lc (substr ($new_key, 1)); # omitting the first '_' no strict 'refs'; $method->($self, $param { $key }); } # done return $self; } sub _wrong_type_msg { my ($self, $given_type, $expected_type, $method) = @_; my $msg = 'In method '; if (defined $method) { $msg .= $method; } else { $msg .= (caller(1))[3]; } return ("$msg: Trying to set a value of type '$given_type' but '$expected_type' is expected."); } sub print_me { my ($self) = @_; require Data::Dumper; return Data::Dumper->Dump ( [$self], ['Citation']); } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::BiblioBase - an abstract base for other biblio classes =head1 VERSION version 1.70 =head1 SYNOPSIS # do not instantiate this class directly =head1 DESCRIPTION It is a base class where all other biblio data storage classes inherit from. It does not reflect any real-world object, it exists only for convenience, in order to have a place for shared code. =head2 Accessors All attribute names can be used as method names. When used without any parameter the method returns current value of the attribute (or undef), when used with a value the method sets the attribute to this value and also returns it back. The set method also checks if the type of the new value is correct. =head2 Custom classes If there is a need for new attributes, create your own class which usually inherits from I. For new types of providers and journals, let your class inherit directly from this I class. =head1 METHODS =head2 new The I class method constructs a new biblio storage object. It accepts list of named arguments - the same names as attribute names prefixed with a minus sign. Available attribute names are listed in the documentation of the individual biblio storage objects. =head1 INTERNAL METHODS =head2 _accessible This method should not be called here; it should be implemented by a subclass =head2 _attr_type This method should not be called here; it should be implemented by a subclass =head2 AUTOLOAD Deal with 'set_' and 'get_' methods =head2 _wrong_type_msg Set methods test whether incoming value is of a correct type; here we return message explaining it =head2 print_me Probably just for debugging TBD: to decide... =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/JournalArticle.pm0000644000175000017500000000711612123443121022301 0ustar carandraugcarandraugpackage Bio::Biblio::JournalArticle; BEGIN { $Bio::Biblio::JournalArticle::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::JournalArticle::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Article); # ABSTRACT: representation of a journal article # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _issue => undef, _issue_supplement => undef, _journal => 'Bio::Biblio::Journal', _volume => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::JournalArticle - representation of a journal article =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::JournalArticle->new(-title => 'Come to grief', -journal => Bio::Biblio::Journal->new()); #--- OR --- $obj = Bio::Biblio::JournalArticle->new(); $obj->title ('Come to grief'); $obj->journal (Bio::Biblio::Journal->new(-name => 'English Mysteries')); =head1 DESCRIPTION A storage object for a journal article. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): issue issue_supplement journal type: Bio::Biblio::Journal volume =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/Provider.pm0000644000175000017500000000607512123443121021160 0ustar carandraugcarandraugpackage Bio::Biblio::Provider; BEGIN { $Bio::Biblio::Provider::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::Provider::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::BiblioBase); # ABSTRACT: representation of a general provider # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 our $AUTOLOAD; # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _type => undef, ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr}; } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; $_allowed{$attr}; } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::Provider - representation of a general provider =head1 VERSION version 1.70 =head1 SYNOPSIS # usually this class is not instantiated but can be... $obj = Bio::Biblio::Provider->new(-type => 'Department'); #--- OR --- $obj = Bio::Biblio::Provider->new(); $obj->type ('Department'); =head1 DESCRIPTION A storage object for a general bibliographic resource provider (a rpovider can be a person, a organisation, or even a program). =head2 Attributes The following attributes are specific to this class, and they are inherited by all provider types. type =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio/BookArticle.pm0000644000175000017500000000652412123443121021563 0ustar carandraugcarandraugpackage Bio::Biblio::BookArticle; BEGIN { $Bio::Biblio::BookArticle::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::BookArticle::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Biblio::Article); # ABSTRACT: representation of a book article # AUTHOR: Martin Senger # AUTHOR: Heikki Lehvaslaiho # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 # # a closure with a list of allowed attribute names (these names # correspond with the allowed 'get' and 'set' methods); each name also # keep what type the attribute should be (use 'undef' if it is a # simple scalar) # { my %_allowed = ( _book => 'Bio::Biblio::Book', ); # return 1 if $attr is allowed to be set/get in this class sub _accessible { my ($self, $attr) = @_; exists $_allowed{$attr} or $self->SUPER::_accessible ($attr); } # return an expected type of given $attr sub _attr_type { my ($self, $attr) = @_; if (exists $_allowed{$attr}) { return $_allowed{$attr}; } else { return $self->SUPER::_attr_type ($attr); } } } 1; __END__ =pod =encoding utf-8 =head1 NAME Bio::Biblio::BookArticle - representation of a book article =head1 VERSION version 1.70 =head1 SYNOPSIS $obj = Bio::Biblio::BookArticle->new(-identifier => '123abc', -book => Bio::Biblio::Book->new()); #--- OR --- $obj = Bio::Biblio::BookArticle->new(); $obj->book (Bio::Biblio::Book->new()); =head1 DESCRIPTION A storage object for a book article. See its place in the class hierarchy in http://www.ebi.ac.uk/~senger/openbqs/images/bibobjects_perl.gif =head2 Attributes The following attributes are specific to this class (however, you can also set and get all attributes defined in the parent classes): book type: Bio::Biblio::Book =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger Heikki Lehvaslaiho =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/lib/Bio/Biblio.pm0000644000175000017500000002505312123443121017363 0ustar carandraugcarandraugpackage Bio::Biblio; BEGIN { $Bio::Biblio::AUTHORITY = 'cpan:BIOPERLML'; } { $Bio::Biblio::VERSION = '1.70'; } use utf8; use strict; use warnings; use parent qw(Bio::Root::Root Bio::DB::BiblioI); # ABSTRACT: a bibliographic query service module # AUTHOR: Martin Senger # OWNER: 2002 European Bioinformatics Institute # LICENSE: Perl_5 sub new { my ($caller,@args) = @_; my $class = ref($caller) || $caller; # if $caller is an object, or if it is an underlying # 'real-work-doing' class (e.g. Bio::DB::Biblio::soap) then # we want to call SUPER to create and bless an object if ($class =~ /Bio::DB::Biblio::(\S+)/) { my ($self) = $class->SUPER::new (@args); # now the $self is an empty object - we will populate it from # the $caller - if $caller is an object if (ref ($caller)) { %{ $self } = %{ $caller }; } # and finally add values from '@args' into the newly created # object (the values will overwrite the values copied above) $self->_initialize (@args); return $self; # this is called only the first time when somebody calls: 'new # Bio::Biblio (...)', and it actually loads a 'real-work-doing' # module and call this new() method again (unless the loaded # module has its own new() method) } else { my %param = @args; @param { map { lc $_ } keys %param } = values %param; # lowercase keys my $access = $param {'-access'} || $class->_guess_access ( $param {'-location'} ) || 'soap'; $access = "\L$access"; # normalize capitalization to lower case # load module with the real implementation - as defined in $access return unless (&_load_access_module ($access)); # this will call this same method new() - but rather its the # upper (object) branche return "Bio::DB::Biblio::$access"->new (@args); } } # ----------------------------------------------------------------------------- sub _load_access_module { my ($access) = @_; my ($module, $load, $m); $module = "_throw (<new(); print $biblio->find ('perl')->get_count . "\n"; my $collection = $biblio->find ('brazma', 'authors'); while ( $collection->has_next ) { print $collection->get_next; } # The new() method can accept parameters, for example: $biblio = Bio::Biblio->new (-access => 'soap', -location => 'http://www.ebi.ac.uk/openbqs/services/MedlineSRS', -destroy_on_exit => '0'); # See below for some one-liners =head1 DESCRIPTION This is a class whose instances can access bibliographic repositories. It allows one to query a bibliographic database (such as MEDLINE) and then to retrieve resulting citations from it. The citations are returned in an XML format which is native to the repository but there are also supporting modules for converting them into Perl objects. The detailed descriptions of all query and retrieval methods are in L (an interface). All those methods should be called on instances of this (Bio::Biblio) module. The module complies (with some simplifications) with the specification described in the B project. Its home page is at L. The module also gives an access to a set of controlled vocabularies and their values. It allows one to introspect bibliographic repositories and to find what citation resource types (such as journal and book articles, patents or technical reports) are provided, and what attributes they have, eventually what attribute values are allowed. Here are some one-liners: perl -MBio::Biblio -e 'print new Bio::Biblio->get_by_id ("12368254")' perl -MBio::Biblio \ -e 'print join ("\n", @{ Bio::Biblio->new->find ("brazma")->get_all_ids })' perl -MBio::Biblio \ -e 'print Bio::Biblio->new->find ("Java")->find ("perl")->get_count' The main documentation details are to be found in L. =head1 METHODS =head2 new Usage : my $obj = Bio::Biblio->new(@args); Returns : Bio::Biblio object on success, or undef on failure Args : This module recognizes and uses: -access => 'soap' It indicates what lower-level module to load. Default is 'soap'. -location => 'http://...' It says where to find a bibliographic query service. The format and contents of this argument is dependent on the '-access' argument. For 'soap' access it is a URL of a WebService. Default is http://www.ebi.ac.uk/openbqs/services/MedlineSRS Other arguments can be given here but they are recognized by the lower-level module (e.g. see Bio::DB::Biblio::soap). It builds, populates and returns a new I object. This is how it is seen from the outside. But in fact, it builds, populates and returns a more specific lower-level object, for example I object - which one it is depends on the parameter I<-access>. The real initialization is done in the method I<_initialize> of the lower-level object. This method can also be used for I an existing object and changing or adding new attributes to it in the same time. This is, however, not particulary useful for the casual users of this module, because the query methods (see L) themselves already return cloned objects with more refined query collections. Anyway this is how the cloning can be done: use Bio::Biblio; my $biblio = Bio::Biblio->new(); # this will create a new object which will NOT send a 'destroy' # message to the remote server when its life ends my $clone = $biblio->new (-destroy-on-exit => '0'); =head1 INTERNAL METHODS =head2 _load_access_module Usage : $class->_load_access_module ($access) Returns : 1 on success, undef on failure Args : 'access' should contain the last part of the name of a module who does the real implementation It does (in run-time) a similar thing as require Bio::DB::Biblio::$access It prints an error on STDERR if it fails to find and load the module (for example, because of the compilation errors in the module). =head2 _guess_access Usage : $class->_guess_access ($location) Returns : string with a guessed access protocol (e.g. 'soap') Args : 'location' defines where to find a bibliographic service in a protocol-dependent manner (e.g. for SOAP it is a URL of a bibliographic WebService) It makes an expert guess what kind of access/transport protocol should be used based on the I of the service (e.g. if the I looks like an IOR then the access protocol is probably CORBA). =head1 OVERVIEW OF CLASSES AND PACKAGES =over =item L This is the main class to be used by the end users. It loads a real implementation for a particular access protocol according to the argument I<-access>. At the time of writing this documentation there is only one available access module implementing all query and retrieval methods: -access => soap This module implements all methods defined in the interface I (see L) by delegating calls to a loaded low-level module (e.g. see L). Note that there are other modules which do not use the SOAP protocol and do not implement all query methods - nevertheless they have retrieval methods and can be used in the same way: -access => biofetch Lacking documentation: -access => eutils =item Bio::DB::BiblioI This is an interface defining all methods that can be called on I instances. =item Bio::DB::Biblio::soap This is a real implementation of all methods defined in Bio::DB::BiblioI using SOAP protocol (calling a WebService based on SOAP). This class should not be instantiated directly (use I instead). See L for details. =item Bio::Biblio::IO This module instantiates and uses a converter of the citations read by any of the access methods mentioned above. See L for details. =item Bio::Biblio::IO::medlinexml and Bio::Biblio::IO::medline2ref A converter of MEDLINE citations in XML into Perl objects. =item Bio::Biblio::IO::pubmedxml and Bio::Biblio::IO::pubmed2ref A converter of PUBMED citations in XML into Perl objects. =back =head1 SEE ALSO =over 4 =item * OpenBQS home page http://www.ebi.ac.uk/~senger/openbqs/ =item * Comments to the Perl client http://www.ebi.ac.uk/~senger/openbqs/Client_perl.html =back =head1 FEEDBACK =head2 Mailing lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 LEGAL =head2 Authors Martin Senger =head2 Copyright and License This software is Copyright (c) by 2002 European Bioinformatics Institute and released under the license of the same terms as the perl 5 programming language system itself =cut Bio-Biblio-1.70/Makefile.PL0000644000175000017500000000301212123443121016307 0ustar carandraugcarandraug use strict; use warnings; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "Modules to access bibliographics repositories and handle citation files.", "AUTHOR" => "BioPerl Team ", "BUILD_REQUIRES" => { "File::Find" => 0, "File::Spec" => 0, "File::Temp" => 0, "Test::More" => 0 }, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "Bio-Biblio", "EXE_FILES" => [ "bin/bp_biblio" ], "LICENSE" => "perl", "NAME" => "Bio::Biblio", "PREREQ_PM" => { "Bio::Annotation::DBLink" => 0, "Bio::DB::DBFetch" => 0, "Bio::Root::IO" => 0, "Bio::Root::Root" => 0, "Bio::Root::RootI" => 0, "Data::Dumper" => 0, "Getopt::Std" => 0, "LWP::Simple" => 0, "SOAP::Lite" => 0, "Symbol" => 0, "URI::Escape" => 0, "XML::Parser" => 0, "XML::Twig" => 0, "parent" => 0, "strict" => 0, "utf8" => 0, "vars" => 0, "warnings" => 0 }, "VERSION" => "1.70", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs);