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

NAME

BLASTaid - A simple interface for byte indexing a WU-BLAST multi-part report for faster access.

VERSION

This document describes BLASTaid version 0.0.3

SYNOPSIS

    use BLASTaid;
    my $blast  = BLASTaid->new( 
                           report => 'REPORT.blast', 
                           index  => '/tmp/REPORT.index' 
                               );
    my $string = $blast->return_report( 
                         query => 'gi|29294646|ref|NM_024852.2|' 
                                      );
    print $string;
  

DESCRIPTION

This module was written to aid accessing specific reports from longer, multi part WU-BLAST (http://blast.wustl.edu/) alignments reports. Depending on parameters and starting input, BLAST reports may be several gigabytes in size. Extremely large files can prove to be problematic and rate-limiting in post-process analysis. BLASTaid takes a multi-part BLAST report and creates a byte index. Specific reports may be pulled directly from the larger set by jumping directly to the entry via the byte-index. The index file need only be created one time per BLAST report... the module automatically uses a supplied index file if it already exists. A developer may also loop through every report in the report in a systematic way. Retrieval is always based around QUERY name, as this should be a unique value in the BLAST report. When BLASTaid makes QUERY names, it takes the first section of the BLAST report's "Query=" line before any white space. Version 0.0.2 saw a revision in index format. The new format was needed to suppport BLAST report parsing via the BLASTaid::Parse module. Version 0.0.1 index files will not work with this version: re-compile the index using this version.

A simple interface script--BLASTaid--has been included in this distribution for command line usage. Run "perldoc BLASTaid" for more information.

INTERFACE

The following methods are supported:

new

new: Class constructor; builds the byte index file for the BLAST report if the supplied --index file does not already exist. Loads the index if the --index file does exist. The --report option is for the path/name of the BALST report.

    my $blast  = BLASTaid->new( 
                           report => 'REPORT.blast', 
                           index  => '/tmp/REPORT.index' 
                               );

return_report

return_report: Given a supplied QUERY name, return a string representing the query's report. The string retains formatting found in the original report.

    my $string = $blast->return_report( 
                         query => 'gi|29294646|ref|NM_024852.2|' 
                                      );

each_report

each_report: Iterator method to walk through all of the queries (reports) in the BLAST report. Each iteration returns a query name for the current report; reports are in the order found in the original BLAST report.

    foreach my $query ( $blast->each_report() ) {
        my $string = $blast->return_report( query => $query );
        print $string;
    }

type

type: Accessor method to return the BLAST report type as indicated in the BLASTaid index.

    foreach my $query ( $blast->each_report() ) {
        my $type = $blast->type( report => $query );
        print $type;
    }

undef

undef: Explicitly delete a BLASTaid index object.

    $blast->undef();

DIAGNOSTICS

A user may encounter messages associated with this module if required method arguments are malformed or missing. Of interest are:

no queries found in object

[Method each_report found no queries in the object. Did you prime the object with the "new" method first?]

return_report cannot locate ... in object

[You've requested a query name that is not in the index. Compare the query name you supplied agianst those in the byte index file. They should be identical for BLASTaid to work properly.]

... is a partial report

[One of the returned reports is truncated--i.e., there is no terminating "EXIT CODE" line in the BLAST report. Investigate the original BLAST report.]

check incoming INDEX format

[You've tried to load a byte index file that is corrupt or incorrect. Remove the index file and run BLASTaid again and it will make a new index file.]

CONFIGURATION AND ENVIRONMENT

BLASTaid requires no configuration files or environment variables. This distribution supplies the perl script "BLASTaid", which is a command line interface for BLASTaid.pm's main functions. The default installation is /usr/bin/. If you are installing on a Windows based system, please manually place the BLASTaid script somewhere in your perl path.

DEPENDENCIES

This module uses IO::File & IO::Seekable.

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

No bugs have been reported. This module is limited to parsing WU-BLAST style reports--it does not currently support NCBI or other formats.

Please report any bugs or feature requests to bug-blastaid@rt.cpan.org, or through the web interface at http://rt.cpan.org.

UPDATES

0.0.2

 -- Version 0.0.1 index files will not work with this version: re-compile the index using this version.
 -- Index order now corresponds to order of queries in the multi-report BLAST file.
 -- ID parse is a little lazier now; previous regex was being to restrictive.
 -- Index output now includes if alignements are in the report (TRUE) or no alignments (FALSE).
 -- Index output now includes type of BLAST per report.
 -- Partial report is no longer restricted to "EXIT CODE 0"; simply requires an EXIT CODE to continue.
 -- The "each_report" method now supports an "ignore" attribute... for ignoring entries without alignments.
 -- Added the following external methods: type; undef.

0.0.1

 --Inital release to CPAN. Only indexes--no parsing of BLAST reports.

ACKNOWLEDGMENTS

This module was written by T. Wylie at Washington University School of Medicine's Genome Sequencing Center. It is a small component of a larger code base for the Computational Biology group. Future releases will interact with this module readily. The author wishes to thank fellow CompBio members Jarret Glasscock & David Messina for feedback and support.

AUTHOR

Todd Wylie

<perldev@monkeybytes.org>

http://www.monkeybytes.org

LICENSE AND COPYRIGHT

Copyright (c) 2006, Todd Wylie <perldev@monkeybytes.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "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 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

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 SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (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 SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

NOTE

This software was written using the latest version of GNU Emacs, the extensible, real-time text editor. Please see http://www.gnu.org/software/emacs for more information and download sources.