NAME
Bio::FastParsers::Blast::Xml - Front-end class for XML BLAST parser
VERSION
version 0.221230
SYNOPSIS
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)
}
DESCRIPTION
This module implements a parser for the XML output format of the BLAST program (e.g., -outfmt 5
). It provides methods for iterating over and querying all elements of the XML tree. The hierarchy is as follows:
- Bio::FastParsers::Blast::Xml
- Bio::FastParsers::Blast::Xml::BlastOutput
- Bio::FastParsers::Blast::Xml::Statistics
- Bio::FastParsers::Blast::Xml::Parameters
- Bio::FastParsers::Blast::Xml::Iteration's
- Bio::FastParsers::Blast::Xml::Hit's
- Bio::FastParsers::Blast::Xml::Hsp's
Documentation is autogenerated.
ATTRIBUTES
file
Path to BLAST report file in XML format to be parsed
blast_output
Bio::FastParsers::Blast::Xml::BlastOutput composed object
AUTHOR
Denis BAURAIN <denis.baurain@uliege.be>
CONTRIBUTOR
Aymeric NAOME <aymeric.naome@gmail.com>
COPYRIGHT AND LICENSE
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.