Author: Laszlo Kajan <lkajan@rostlab.org>
Description: added new tags to handle iterated blast
Forwarded: no

--- a/Zerg/Zerg.pm
+++ b/Zerg/Zerg.pm
@@ -1,5 +1,5 @@
-# Copyright (C) 2002  ApuPaquola - Instituto de Qumica -
-#                     Universidade de So Paulo - Brasil
+# Copyright (C) 2002  Apuã Paquola - Instituto de Química -
+#                     Universidade de São Paulo - Brasil
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,73 +37,95 @@ our @ISA = qw(Exporter DynaLoader);
 # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
 # will save memory.
 our %EXPORT_TAGS = ( 'all' => [ qw(
-	ALIGNMENT_LENGTH
-	BLAST_VERSION
-	DESCRIPTION_ANNOTATION
-	DESCRIPTION_EVALUE
-	DESCRIPTION_HITNAME
-	DESCRIPTION_SCORE
-	END_OF_REPORT
-	EVALUE
-	GAPS
-	IDENTITIES
-	NOHITS
-	PERCENT_IDENTITIES
-	PERCENT_POSITIVES
-	POSITIVES
-	QUERY_ANNOTATION
-	QUERY_END
-	QUERY_FRAME
-	QUERY_LENGTH
-	QUERY_NAME
-	QUERY_ORIENTATION
-	QUERY_START
-	SCORE
-	SCORE_BITS
-	SUBJECT_ANNOTATION
-	SUBJECT_END
-	SUBJECT_FRAME
-	SUBJECT_LENGTH
-	SUBJECT_NAME
-	SUBJECT_ORIENTATION
-	SUBJECT_START
-	UNMATCHED
+	ALIGNMENT_LENGTH 	
+	BLAST_VERSION 		
+	CONVERGED 		
+	DATABASE 		
+	DESCRIPTION_ANNOTATION 	
+	DESCRIPTION_EVALUE 	
+	DESCRIPTION_HITNAME 	
+	DESCRIPTION_SCORE 	
+	END_OF_REPORT 		
+	EVALUE 			
+	GAPS 			
+	HSP_METHOD 		
+	IDENTITIES 		
+	NOHITS 			
+	PERCENT_IDENTITIES 	
+	PERCENT_POSITIVES 	
+	POSITIVES 		
+	QUERY_ALI 		
+	QUERY_ANNOTATION 	
+	QUERY_END 		
+	QUERY_FRAME 		
+	QUERY_LENGTH 		
+	QUERY_NAME 		
+	QUERY_ORIENTATION 	
+	QUERY_START 		
+	REFERENCE 		
+	ROUND_NUMBER 		
+	ROUND_SEQ_FOUND 	
+	ROUND_SEQ_NEW 		
+	SCORE 			
+	SCORE_BITS 		
+	SEARCHING 		
+	SUBJECT_ALI 		
+	SUBJECT_ANNOTATION 	
+	SUBJECT_END 		
+	SUBJECT_FRAME 		
+	SUBJECT_LENGTH 		
+	SUBJECT_NAME 		
+	SUBJECT_ORIENTATION 	
+	SUBJECT_START 		
+	TAIL_OF_REPORT 		
+	UNMATCHED 		
 ) ] );
 
 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
 
 our @EXPORT = qw(
-	ALIGNMENT_LENGTH
-	BLAST_VERSION
-	DESCRIPTION_ANNOTATION
-	DESCRIPTION_EVALUE
-	DESCRIPTION_HITNAME
-	DESCRIPTION_SCORE
-	END_OF_REPORT
-	EVALUE
-	GAPS
-	IDENTITIES
-	NOHITS
-	PERCENT_IDENTITIES
-	PERCENT_POSITIVES
-	POSITIVES
-	QUERY_ANNOTATION
-	QUERY_END
-	QUERY_FRAME
-	QUERY_LENGTH
-	QUERY_NAME
-	QUERY_ORIENTATION
-	QUERY_START
-	SCORE
-	SCORE_BITS
-	SUBJECT_ANNOTATION
-	SUBJECT_END
-	SUBJECT_FRAME
-	SUBJECT_LENGTH
-	SUBJECT_NAME
-	SUBJECT_ORIENTATION
-	SUBJECT_START
-	UNMATCHED
+	ALIGNMENT_LENGTH 	
+	BLAST_VERSION 		
+	CONVERGED 		
+	DATABASE 		
+	DESCRIPTION_ANNOTATION 	
+	DESCRIPTION_EVALUE 	
+	DESCRIPTION_HITNAME 	
+	DESCRIPTION_SCORE 	
+	END_OF_REPORT 		
+	EVALUE 			
+	GAPS 			
+	HSP_METHOD 		
+	IDENTITIES 		
+	NOHITS 			
+	PERCENT_IDENTITIES 	
+	PERCENT_POSITIVES 	
+	POSITIVES 		
+	QUERY_ALI 		
+	QUERY_ANNOTATION 	
+	QUERY_END 		
+	QUERY_FRAME 		
+	QUERY_LENGTH 		
+	QUERY_NAME 		
+	QUERY_ORIENTATION 	
+	QUERY_START 		
+	REFERENCE 		
+	ROUND_NUMBER 		
+	ROUND_SEQ_FOUND 	
+	ROUND_SEQ_NEW 		
+	SCORE 			
+	SCORE_BITS 		
+	SEARCHING 		
+	SUBJECT_ALI 		
+	SUBJECT_ANNOTATION 	
+	SUBJECT_END 		
+	SUBJECT_FRAME 		
+	SUBJECT_LENGTH 		
+	SUBJECT_NAME 		
+	SUBJECT_ORIENTATION 	
+	SUBJECT_START 		
+	TAIL_OF_REPORT 		
+	UNMATCHED 		
 );
 our $VERSION = '1.0.4';
 
@@ -209,37 +231,48 @@ zerg_unignore_all() does zerg_unignore o
 
 =head2 EXPORTED CONSTANTS (TOKEN CODES)
 
-    ALIGNMENT_LENGTH
-    BLAST_VERSION
-    DESCRIPTION_ANNOTATION
-    DESCRIPTION_EVALUE
-    DESCRIPTION_HITNAME
-    DESCRIPTION_SCORE
-    END_OF_REPORT
-    EVALUE
-    GAPS
-    IDENTITIES
-    NOHITS
-    PERCENT_IDENTITIES
-    PERCENT_POSITIVES
-    POSITIVES
-    QUERY_ANNOTATION
-    QUERY_END
-    QUERY_FRAME
-    QUERY_LENGTH
-    QUERY_NAME
-    QUERY_ORIENTATION
-    QUERY_START
-    SCORE
-    SCORE_BITS
-    SUBJECT_ANNOTATION
-    SUBJECT_END
-    SUBJECT_FRAME
-    SUBJECT_LENGTH
-    SUBJECT_NAME
-    SUBJECT_ORIENTATION
-    SUBJECT_START
-    UNMATCHED
+    ALIGNMENT_LENGTH 	
+    BLAST_VERSION 		
+    CONVERGED 		
+    DATABASE 		
+    DESCRIPTION_ANNOTATION 	
+    DESCRIPTION_EVALUE 	
+    DESCRIPTION_HITNAME 	
+    DESCRIPTION_SCORE 	
+    END_OF_REPORT 		
+    EVALUE 			
+    GAPS 			
+    HSP_METHOD 		
+    IDENTITIES 		
+    NOHITS 			
+    PERCENT_IDENTITIES 	
+    PERCENT_POSITIVES 	
+    POSITIVES 		
+    QUERY_ALI 		
+    QUERY_ANNOTATION 	
+    QUERY_END 		
+    QUERY_FRAME 		
+    QUERY_LENGTH 		
+    QUERY_NAME 		
+    QUERY_ORIENTATION 	
+    QUERY_START 		
+    REFERENCE 		
+    ROUND_NUMBER 		
+    ROUND_SEQ_FOUND 	
+    ROUND_SEQ_NEW 		
+    SCORE 			
+    SCORE_BITS 		
+    SEARCHING 		
+    SUBJECT_ALI 		
+    SUBJECT_ANNOTATION 	
+    SUBJECT_END 		
+    SUBJECT_FRAME 		
+    SUBJECT_LENGTH 		
+    SUBJECT_NAME 		
+    SUBJECT_ORIENTATION 	
+    SUBJECT_START 		
+    TAIL_OF_REPORT 		
+    UNMATCHED 		
     
 =head2 NOTES ON THE SCANNER
 
@@ -312,13 +345,15 @@ zerg_get_token_offset() may return incor
 and those that are modified by the parser, namely: QUERY_LENGTH,
 SUBJECT_LENGTH, EVALUE, GAPS.
     
-=head1 TO DO
+=head1 TODO
 
 Add more tokens to the scanner as the need for that appears.
 
 =head1 AUTHOR
 
-Apu Paquola, IQ-USP Bioinformatics Lab, apua@iq.usp.br
+Apuã Paquola, IQ-USP Bioinformatics Lab, apua@iq.usp.br
+
+Laszlo Kajan <lkajan@rostlab.org>, Technical University of Munich, Germany
 
 =head1 SEE ALSO
 
--- a/Zerg/Zerg.xs
+++ b/Zerg/Zerg.xs
@@ -1,6 +1,6 @@
 /*
-  Copyright (C) 2002  ApuPaquola - Instituto de Qumica -
-                    Universidade de So Paulo - Brasil
+  Copyright (C) 2002  Apuã Paquola - Instituto de Química -
+                    Universidade de São Paulo - Brasil
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -94,7 +94,14 @@ constant_Q(char *name, int len, int arg)
     }
     switch (name[1 + 5]) {
     case 'A':
-	if (strEQ(name + 1, "UERY_ANNOTATION")) {	/* Q removed */
+	if (strEQ(name + 1, "UERY_ALI")) {	/* Q removed */
+#ifdef QUERY_ALI
+	    return QUERY_ALI;
+#else
+	    goto not_there;
+#endif
+	}
+	else if (strEQ(name + 1, "UERY_ANNOTATION")) {	/* Q removed */
 #ifdef QUERY_ANNOTATION
 	    return QUERY_ANNOTATION;
 #else
@@ -159,6 +166,45 @@ not_there:
 }
 
 static double
+constant_R(char *name, int len, int arg)
+{
+    if (strEQ(name + 1, "EFERENCE")) {	/* R removed */
+#ifdef REFERENCE
+	    return REFERENCE;
+#else
+	    goto not_there;
+#endif
+    }
+    else if (strEQ(name + 1, "OUND_NUMBER")) {	/* R removed */
+#ifdef ROUND_NUMBER
+	    return ROUND_NUMBER;
+#else
+	    goto not_there;
+#endif
+    }
+    else if (strEQ(name + 1, "OUND_SEQ_FOUND")) {	/* R removed */
+#ifdef ROUND_SEQ_FOUND
+	    return ROUND_SEQ_FOUND;
+#else
+	    goto not_there;
+#endif
+    }
+    else if (strEQ(name + 1, "OUND_SEQ_NEW")) {	/* R removed */
+#ifdef ROUND_SEQ_NEW
+	    return ROUND_SEQ_NEW;
+#else
+	    goto not_there;
+#endif
+    }
+    errno = EINVAL;
+    return 0;
+
+not_there:
+    errno = ENOENT;
+    return 0;
+}
+
+static double
 constant_SC(char *name, int len, int arg)
 {
     if (2 + 3 > len ) {
@@ -200,7 +246,14 @@ constant_SU(char *name, int len, int arg
     }
     switch (name[2 + 6]) {
     case 'A':
-	if (strEQ(name + 2, "BJECT_ANNOTATION")) {	/* SU removed */
+	if (strEQ(name + 2, "BJECT_ALI")) {	/* SU removed */
+#ifdef SUBJECT_ALI
+	    return SUBJECT_ALI;
+#else
+	    goto not_there;
+#endif
+	}
+	else if (strEQ(name + 2, "BJECT_ANNOTATION")) {	/* SU removed */
 #ifdef SUBJECT_ANNOTATION
 	    return SUBJECT_ANNOTATION;
 #else
@@ -270,6 +323,14 @@ constant_S(char *name, int len, int arg)
     switch (name[1 + 0]) {
     case 'C':
 	return constant_SC(name, len, arg);
+    case 'E':
+    	if (strEQ(name + 2, "ARCHING")) {	/* SE removed */
+#ifdef SEARCHING
+	    return SEARCHING;
+#else
+	    goto not_there;
+#endif
+	}
     case 'U':
 	return constant_SU(name, len, arg);
     }
@@ -284,6 +345,13 @@ not_there:
 static double
 constant_D(char *name, int len, int arg)
 {
+    if (strEQ(name + 1, "ATABASE")) {	/* D removed */
+#ifdef DATABASE
+	    return DATABASE;
+#else
+	    goto not_there;
+#endif
+    }
     if (1 + 11 >= len ) {
 	errno = EINVAL;
 	return 0;
@@ -380,6 +448,14 @@ constant(char *name, int len, int arg)
 	    goto not_there;
 #endif
 	}
+    case 'C':
+	if (strEQ(name + 1, "ONVERGED")) {	/* C removed */
+#ifdef CONVERGED
+	    return CONVERGED;
+#else
+	    goto not_there;
+#endif
+	}
     case 'D':
 	return constant_D(name, len, arg);
     case 'E':
@@ -392,6 +468,14 @@ constant(char *name, int len, int arg)
 	    goto not_there;
 #endif
 	}
+    case 'H':
+	if (strEQ(name + 1, "SP_METHOD")) {	/* H removed */
+#ifdef HSP_METHOD
+	    return HSP_METHOD;
+#else
+	    goto not_there;
+#endif
+	}
     case 'I':
 	if (strEQ(name + 0, "IDENTITIES")) {	/*  removed */
 #ifdef IDENTITIES
@@ -412,8 +496,18 @@ constant(char *name, int len, int arg)
 	return constant_P(name, len, arg);
     case 'Q':
 	return constant_Q(name, len, arg);
+    case 'R':
+	return constant_R(name, len, arg);
     case 'S':
 	return constant_S(name, len, arg);
+    case 'T':
+	if (strEQ(name + 0, "TAIL_OF_REPORT")) {	/*  removed */
+#ifdef TAIL_OF_REPORT
+	    return TAIL_OF_REPORT;
+#else
+	    goto not_there;
+#endif
+	}
     case 'U':
 	if (strEQ(name + 0, "UNMATCHED")) {	/*  removed */
 #ifdef UNMATCHED
--- a/Zerg/Report/Report.pm
+++ b/Zerg/Report/Report.pm
@@ -17,6 +17,7 @@
 #
 package Zerg::Report;
 use strict;
+use Carp;
 use Zerg;
 
 our $VERSION = '1.0.4';
@@ -30,14 +31,10 @@ sub new
 
     my $file = shift;
 
-    my $blast_report = ();  
-   
-    Zerg::zerg_open_file($file);
+    if( defined($file) ){ Zerg::zerg_open_file($file); }
        
     Zerg::zerg_unignore_all();  
 
-    $self->{report} = $blast_report;
- 
     bless $self,$class;
  
     return $self;
@@ -49,7 +46,7 @@ sub getReport
 
     my $self=shift;
 
-    my $blast_report = $self->{report};
+    my $blast_report = undef;
 
     my ($c,$v,$hit_counter,$hsp_counter);
 
@@ -59,6 +56,8 @@ sub getReport
 
     while((($c, $v)= Zerg::zerg_get_token()) && $c)
     {
+    	if( !defined($blast_report) ){ $blast_report = {}; }
+
 	if($c==BLAST_VERSION)
 	{
 	    $blast_report->{blast_version}=$v;
@@ -86,96 +85,104 @@ sub getReport
             $blast_report->{hits}[$hit_counter]{"subject_name"}=$v;
         }
         elsif($c==SUBJECT_ANNOTATION)
-	{
-	    $blast_report->{hits}[$hit_counter]{"subject_annotation"}=$v;
-	}
-	elsif($c==SUBJECT_LENGTH)
-	{
-	    $blast_report->{hits}[$hit_counter]{"subject_length"}=$v;
-	}
-	elsif($c==SCORE_BITS)
-	{
+        {
+            $blast_report->{hits}[$hit_counter]{"subject_annotation"}=$v;
+        }
+        elsif($c==SUBJECT_LENGTH)
+        {
+            $blast_report->{hits}[$hit_counter]{"subject_length"}=$v;
+        }
+        elsif($c==SCORE_BITS)
+        {
             $hsp_counter++; 
             $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"score_bits"}=$v;
-	}
-	elsif($c==SCORE)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"score"}=$v;
-	}
-	elsif($c==EVALUE)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"evalue"}=$v;
-	}
-	elsif($c==IDENTITIES)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"identities"}=$v;
-	}
-	elsif($c==ALIGNMENT_LENGTH)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"alignment_length"}=$v;
-	}
-	elsif($c==PERCENT_IDENTITIES)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"percent_identities"}=$v;
-	}
-	elsif($c==GAPS)
-	{
-	    
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"gaps"}=$v;
-	}
-	elsif($c==QUERY_ORIENTATION)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_orientation"}=$v;
-	}
-	elsif($c==SUBJECT_ORIENTATION)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_orientation"}=$v;
-	}
+        }
+        elsif($c==SCORE)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"score"}=$v;
+        }
+        elsif($c==EVALUE)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"evalue"}=$v;
+        }
+        elsif($c==IDENTITIES)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"identities"}=$v;
+        }
+        elsif($c==ALIGNMENT_LENGTH)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"alignment_length"}=$v;
+        }
+        elsif($c==PERCENT_IDENTITIES)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"percent_identities"}=$v;
+        }
+        elsif($c==GAPS)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"gaps"}=$v;
+        }
+        elsif($c==QUERY_ORIENTATION)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_orientation"}=$v;
+        }
+        elsif($c==SUBJECT_ORIENTATION)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_orientation"}=$v;
+        }
         elsif($c==QUERY_START)
         {
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_start"}=$v;
-	    
+            if( $v && !$blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_start"} ){ $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_start"}=$v; }
+        }
+        elsif($c==QUERY_ALI)
+        {
+            if( $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_start"} ){ $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_ali"} .= $v; }
         }
         elsif($c==QUERY_END)
         {
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_end"}=$v;
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_end"}=$v;
         }
         elsif($c==SUBJECT_START)
         {
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_start"}=$v;
+            if( $v && !$blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_start"} ){ $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_start"}=$v; }
+        }
+        elsif($c==SUBJECT_ALI)
+        {
+            if( $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_start"} ){ $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_ali"} .= $v; }
         }
         elsif($c==SUBJECT_END)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_end"}=$v;
-	}
-	elsif($c==POSITIVES)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"positives"}=$v;
-	}
-	elsif($c==PERCENT_POSITIVES)
-	{
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_end"}=$v;
+        }
+        elsif($c==POSITIVES)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"positives"}=$v;
+        }
+        elsif($c==PERCENT_POSITIVES)
+        {
             $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"percent_positives"}=$v;
-	}
-	elsif($c==QUERY_FRAME)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_frame"}=$v;
-	}
-	elsif($c==SUBJECT_FRAME)
-	{
-	    $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_frame"}=$v;
-	}
-	elsif($c==UNMATCHED)
-	{
-	    die "Syntax error in blast report\n";
-	}
-	elsif($c==END_OF_REPORT)
-	{
-	    my $r=$blast_report;
-	    $blast_report=();
-	    return $r;
-	}
+        }
+        elsif($c==QUERY_FRAME)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"query_frame"}=$v;
+        }
+        elsif($c==SUBJECT_FRAME)
+        {
+            $blast_report->{hits}[$hit_counter]{"hsps"}[$hsp_counter]{"subject_frame"}=$v;
+        }
+        elsif($c==ROUND_NUMBER)
+        {
+            $blast_report->{round_begins}[$v-1] = $hit_counter + 1;
+        }
+        elsif($c==UNMATCHED)
+        {
+            confess("Syntax error in blast report: '$v'");
+        }
+        elsif($c==END_OF_REPORT)
+        {
+            return $blast_report;
+        }
     }
-    return ();
+    return $blast_report;
 }
 
 sub closeFile
@@ -218,8 +225,9 @@ Zerg::Report - get attributes from a BLA
     foreach my $hit (@{$r->{hits}})
     {
       foreach my $hsp (@{$hit->{hsps}})
-	{
-	    print "$r->{query_name} $hit->{subject_name} $hsp->{score_bits}\n";        }
+      {
+        print "$r->{query_name} $hit->{subject_name} $hsp->{score_bits}\n";
+      }
     }
   }
 
@@ -227,15 +235,15 @@ Zerg::Report - get attributes from a BLA
 
 =head1 DESCRIPTION
 
-  Zerg::Report uses Zerg to parse a file containing multiple BLAST
-  reports and, for each report, stores the obtained fields in a data
-  structure made of arrays and hashes. Please consult the Zerg man
-  page to see which fields are extracted.
+  Zerg::Report uses Zerg to parse a file - or STDIN if file is not given -
+  containing one or multiple BLAST reports and, for each report, stores
+  the obtained fields in a data structure made of arrays and hashes.
+  Please consult the Zerg man page to see which fields are extracted.
 
   The method getReport() reads a BLAST report from the input file and
   returns a reference to a data structure like the one in the example
-  below. When no report is found, it returns false. It dies from
-  syntax errors in BLAST reports.
+  below. When no report is found, it returns undef. It dies from
+  syntax errors in BLAST reports with a stack backtrace.
 
   Example of a data structure returned by getReport():
   
@@ -245,26 +253,27 @@ Zerg::Report - get attributes from a BLA
           'byte_offset' => 4981,
           'query_length' => '444',
           'query_annotation' => ''
-    
+          'round_begins' => [ 0, 129, 201 ], # indicates the first hit in each round of iterated blast
           'hits' => [
                       {
                         'subject_annotation' => '(NC_003210) similar to cation (calcium) transporting ATPase [Listeria monocytogenes EGD-e]',
                         'hsps' => [
                                     {
-                                      'query_end' => '428',
-                                      'subject_end' => '151',
-                                      'identities' => '59',
-                                      'score' => '252',
-                                      'percent_positives' => '57',
-                                      'gaps' => '0',
-                                      'score_bits' => '101',
-                                      'alignment_length' => '142',
-                                      'evalue' => '2e-21',
-                                      'percent_identities' => '41',
-                                      'positives' => '83',
-                                      'query_start' => '3',
-                                      'subject_start' => '22',
-                                      'query_frame' => '+3'
+                                      'query_end' => '82',
+                                      'subject_ali' => 'ASELEIFAALIECEA-GSTDYDGMLAVASVVMNRVNHRYYPDTITGVIYQSGQFSPVASGKLDKVLKRGIKSSCLEVAKDA',
+                                      'query_ali' => 'DAQTRKLAAIAYGEASGANDANEIGGIAWAVANRARAWGGK-TVDGLLAADPNYTYAVKDG-NQRYAKLMKATEAAIAADP',
+                                      'subject_end' => '328',
+                                      'identities' => '15',
+                                      'score' => '87',
+                                      'percent_positives' => '41',
+                                      'gaps' => '3',
+                                      'score_bits' => '37.9',
+                                      'alignment_length' => '81',
+                                      'evalue' => '0.40',
+                                      'percent_identities' => '18',
+                                      'positives' => '34',
+                                      'query_start' => '4',
+                                      'subject_start' => '249'
                                     }
                                   ],
                         'subject_length' => '880',
@@ -275,11 +284,13 @@ Zerg::Report - get attributes from a BLA
    
 =head1 AUTHORS
 
-Apu Paquola <apua@iq.usp.br>, Abimael Machado <abimael@iq.usp.br>
-IQ-USP Bioinformatics Lab
+Apu Paquola <apua@iq.usp.br>, Abimael Machado <abimael@iq.usp.br> IQ-USP Bioinformatics Lab
+
+Laszlo Kajan <lkajan@rostlab.org>, Technical University of Munich, Germany
 
 =head1 SEE ALSO
 
 Zerg
 
 =cut
+# vim:et:ts=2:ai:
