The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bio::FastParsers::Blast::Table - Front-end class for tabular BLAST parser

VERSION

version 0.221230

SYNOPSIS

    use aliased 'Bio::FastParsers::Blast::Table';

    # open and parse BLAST report in tabular format
    my $infile = 'test/blastp.m9';
    my $report = Table->new( file => $infile );

    # loop through hsps
    while (my $hsp = $report->next_hsp) {
        my ($hit_id, $evalue) = ($hsp->hit_id, $hsp->evalue);
        # ...
    }

    # ...

    my $infile = 'test/multiquery-blastp.m9';
    my $report = Table->new( file => $infile );

    # loop through first hits for each query
    while (my $first_hit = $report->next_query) {
        my ($hit_id, $evalue) = ($hsp->hit_id, $hsp->evalue);
        # ...
    }

DESCRIPTION

This module implements a parser for the standard tabular output format of the BLAST program (e.g., -outfmt 7). It provides methods for iterating over queries, hits and HSPs (e.g., next_hsp). Individual HSPs can then be queried using methods described in Bio::FastParsers::Blast::Table::Hsp.

ATTRIBUTES

file

Path to BLAST report file in tabular format (m8/m9 or now 6/7) to be parsed

METHODS

next_hsp

Shifts the first HSP of the report off and returns it, shortening the report by 1 and moving everything down. If there are no more HSPs in the report, returns undef.

    # $report is a Bio::FastParsers::Blast::Table
    while (my $hsp = $report->next_hsp) {
        # process $hsp
        # ...
    }

This method does not accept any arguments.

next_hit

Directly returns the first HSP of the next hit, skipping any remaining HSPs for the current hit in the process. If there are no more hits in the report, returns undef. Useful for processing only the first HSP of each hit.

    # $report is a Bio::FastParsers::Blast::Table
    while (my $first_hsp = $report->next_hit) {
        # process $first_hsp
        # ...
    }

This method does not accept any arguments.

next_query

Directly returns the first HSP of the next query, skipping any remaining HSPs for the current query in the process. If there are no more queries in the report, returns undef. Useful for processing only the first hit of each query.

    # $report is a Bio::FastParsers::Blast::Table
    while (my $first_hit = $report->next_query) {
        # process $first_hit
        # ...
    }

This method does not accept any arguments.

AUTHOR

Denis BAURAIN <denis.baurain@uliege.be>

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.