[Bioperl-l] how to parse results from Bio::Biblio

Chris Fields cjfields at illinois.edu
Sat Dec 11 16:31:51 EST 2010


On Dec 11, 2010, at 12:16 PM, Maxim wrote:

> Hi,
> 
> I have problems to parse XML-like results from Bio::Biblio/Bio::Biblio::IO.
> I thought to use XML::Simple, but I get an error when I attempt to do it
> like in below example script:
> 
> #!/usr/bin/perl -w
> 
> use Bio::Biblio;
> use Bio::Biblio::IO;
> use XML::Simple;
> use Data::Dumper;
> use strict;
> 
> my $biblio = new Bio::Biblio;
> my $citation = $biblio->get_by_id ('18287711');
> 
> #print $citation;
> 
> my $xml = new XML::Simple;
> 
> my $data = $xml->XMLin($citation);
> 
> # this part works, output to me looks like it should be
> print Dumper($data);
> #this part does not!
> print "Abstract: $data->{Abstract}";
> 
> 
> The error:
> could not find ParserDetails.ini in
> /opt/local/lib/perl5/site_perl/5.8.9/XML/SAX ### I think this is not
> relevant to the error as "normal" parsing of XML files works on my machine
> Use of uninitialized value in concatenation (.) or string at test.pl line
> 21.

According to the script above, you have not installed XML::SAX, or ParserDetails.ini wasn't installed correctly.

> The line that print the dump of var1 appears to contain something that looks
> like an XML file, but obviously it's not properly parsed. I guess there will
> be a solution for this problem within BioPerl without the requirement to use
> other modules (like XML::Simple), but I cannot figure out how to do this!
> 
> Maxim

AFAIK Bio::Biblio was never completely implemented; the framework is there (Bio::Biblio::*), parsers exists (Bio::Biblio::IO::*), and the DB connections are made (Bio::DB::Biblio), but no progress has been made on these in quite a while.  You are more than welcome to work on these if you are interested.

chris




More information about the Bioperl-l mailing list