Bio::FastParsers::Blast::Xml - front-end class for XML BLAST parser
version 0.173450
use aliased 'Bio::FastParsers::Blast::Xml'; # open and parse BLAST report in XML format my $infile = 'test/blastp.xml'; my $report = Xml->new( file => $infile ); # get main container my $bo = $report->blast_output; # examine report content say $bo->program; # blastp say $bo->version; # BLASTP 2.2.25+ say $bo->db; # mcl-db-22species # get evalue threshold... say $bo->parameters->expect; # 10 # ...or equivalently my $param = $bo->parameters; say $param->expect; # 10 say $param->matrix; # BLOSUM62 # get the number of iterations (= queries) say $bo->count_iterations; # 3 # loop through iterations (or queries), hits and hsps # this is extremely fast because no data is moved around for my $iter ($bo->all_iterations) { say $iter->count_hits; # always available! for my $hit ($iter->all_hits) { for my $hsp ($hit->all_hsps) { # ... } } } # ...or nearly equivalently (still ultra-fast) # here the container is altered by each iterator call while (my $iter = $bo->next_iteration) { say $iter->count_hits; # here too! while (my $hit = $iter->next_hit) { while (my $hsp = $hit->next_hsp) { # ... } } say $iter->count_hits; # 0 (exhausted) }
# TODO
Path to BLAST report file in XML format to be parsed
Bio::FastParsers::Blast::Xml::BlastOutput composed object
Denis BAURAIN <denis.baurain@uliege.be>
This software is copyright (c) 2013 by University of Liege / Unit of Eukaryotic Phylogenomics / Denis BAURAIN.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Bio::FastParsers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::FastParsers
CPAN shell
perl -MCPAN -e shell install Bio::FastParsers
For more information on module installation, please visit the detailed CPAN module installation guide.