.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RG::Blast::Parser 3pm" .TH RG::Blast::Parser 3pm "2020-11-27" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RG::Blast::Parser \- fast NCBI BLAST parser .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use Data::Dumper; \& use RG::Blast::Parser; \& \& my $parser = RG::Blast::Parser\->new(); # read from STDIN \& \& open( EXAMPLE, \*(Aq<\*(Aq, \*(Aq/usr/share/doc/librg\-blast\-parser\-perl/examples/converged.ali\*(Aq ) || confess($!); \& my $parser = RG::Blast::Parser\->new( \e*EXAMPLE, "converged.ali" ); # read from EXAMPLE, use name "converged.ali" in error messages \& \& while( my $res = $parser\->parse() ) \& { \& print Dumper( $res ); \& } \& \& eval { \& my $res = $parser\->parse(); \& # ... \& }; \& if( $@ && $@ =~ /^parser error/ ) { warn("failed to parse blast result \- exception caught"); } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This package contains perl binding for a very fast C/\*(C+ library for \s-1NCBI BLAST\s0 \-m 0 (default) output parsing. \s-1BLAST\s0 results are returned in a convenient hash structure. .PP Multiple results may be concatenated for input. One result is parsed and returned at a time. .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .IP "new( [\s-1FILEHANDLE,\s0 [\s-1NAME\s0]] )" 4 .IX Item "new( [FILEHANDLE, [NAME]] )" Creates an \*(L"RG::Blast::Parser\*(R". Blast results are read from \s-1FILEHANDLE, STDIN\s0 by default. The input stream may be named \s-1NAME\s0 in error messages (default: \&\*(L"\s-1STDIN\*(R"\s0). .SH "METHODS" .IX Header "METHODS" .IP "parse( [\s-1TRACE_PARSING,\s0 [\s-1TRACE_SCANNING\s0]] )" 4 .IX Item "parse( [TRACE_PARSING, [TRACE_SCANNING]] )" Parse one complete \s-1BLAST\s0 result and return it. If no results on input stream, returns \*(L"undef\*(R". In case of parser error it \fBdie()\fRs with an (at present not very useful) error message. .Sp The following structure is returned in a hash reference: .Sp .Vb 10 \& { \& blast_version => STRING, \& references => [ STRING, ... ], \& rounds => [ \& { \& oneline_idx => NUM, # index of first one\-line description of \& # this round in "onelines" array \& oneline_cnt => NUM, # number of one\-line descriptions of \& # this round \& hit_idx => NUM, # index of first hit of this round in \& # "hits" array \& hit_cnt => NUM, # number of hits of this round \& oneline_new_idx => NUM|undef# index of first new (not\-seen\-before) \& # one\-line description of this round \& # in "onelines" array \& oneline_new_cnt => NUM # number of new one\-line descriptions of \& # this round \& }, ... \& ], \& q_name => STRING, \& q_desc => STRING|undef, \& q_length => NUM, \& db_name => STRING, \& db_nseq => NUM, \& db_nletter => NUM, \& onelines => [ # one\-line descriptions from all rounds \& { \& name => STRING, \& desc => STRING|undef, \& bit_score => NUM, \& e_value => NUM \& }, ... \& ], \& converged => BOOLEAN, \& hits => [ # hits from all rounds \& { \& name => STRING, \& desc => STRING|undef, \& length => NUM, \& hsps => [ \& { \& bit_score => NUM, \& raw_score => NUM, \& e_value => NUM, \& method => STRING, \& identities => NUM, \& positives => NUM, \& gaps => NUM, \& q_strand => STRING|undef, \& s_strand => STRING|undef, \& q_frame => NUM|undef, \& s_frame => NUM|undef, \& q_start => NUM, \& q_ali => STRING, \& q_end => NUM, \& match_line => STRING, \& s_start => NUM, \& s_ali => STRING, \& s_end => NUM \& }, ... \& ] \& }, ... \& ], \& tail => STRING # bulk text after the last hit / one\-line \& # description \& } .Ve .Sp If you want tracing for parsing and scanning, you can enable them using the parameters of this call. .IP "\fBresult()\fR" 4 .IX Item "result()" Returns the last \s-1BLAST\s0 result parsed or \*(L"undef\*(R" if no last result. .IP "\fBget_trace_scanning()\fR" 4 .IX Item "get_trace_scanning()" Returns scan trace state as a Boolean value. .IP "set_trace_scanning( \s-1BOOLEAN\s0 )" 4 .IX Item "set_trace_scanning( BOOLEAN )" Set scan trace \- debugging aid. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBZerg\fR\|(3pm), \fBZerg::Report\fR\|(3pm) .SH "AUTHOR" .IX Header "AUTHOR" Laszlo Kajan, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2012 by Laszlo Kajan .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.