This file is indexed.

/usr/lib/perl5/Zerg/Report.pm is in libzerg-perl 1.0.4-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# Copyright (C) 2002  Apuã Paquola, Abimael Machado - 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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
package Zerg::Report;
use strict;
use Carp;
use Zerg;

our $VERSION = '1.0.4';
 
sub new
{

    my $self =  { };

    my $class = shift;

    my $file = shift;

    if( defined($file) ){ Zerg::zerg_open_file($file); }
       
    Zerg::zerg_unignore_all();  

    bless $self,$class;
 
    return $self;
}


sub getReport
{

    my $self=shift;

    my $blast_report = undef;

    my ($c,$v,$hit_counter,$hsp_counter);

    $hit_counter=-1;

    $hsp_counter=-1;

    while((($c, $v)= Zerg::zerg_get_token()) && $c)
    {
    	if( !defined($blast_report) ){ $blast_report = {}; }

	if($c==BLAST_VERSION)
	{
	    $blast_report->{blast_version}=$v;
	    $blast_report->{byte_offset}=Zerg::zerg_get_token_offset();
            $hit_counter=-1;
        }
        elsif($c==QUERY_NAME)
        {
            $blast_report->{query_name}=$v;
        }
        elsif($c==QUERY_ANNOTATION)
        {
	    $blast_report->{query_annotation}=$v;
        }
        elsif($c==QUERY_LENGTH)
        {
            $blast_report->{query_length}=$v;
        }
        elsif($c==SUBJECT_NAME)
        {
            $hit_counter++;

            $hsp_counter=-1;
              
            $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)
        {
            $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==QUERY_START)
        {
            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;
        }
        elsif($c==SUBJECT_START)
        {
            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]{"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==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 $blast_report;
}

sub closeFile
{
  Zerg::zerg_close_file();
}


1;

# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.

# This allows declaration	use Zerg::Report ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.


# Preloaded methods go here.

# Autoload methods go after =cut, and are processed by the autosplit program.


__END__
# Below is stub documentation for your module. You better edit it!

=head1 NAME

Zerg::Report - get attributes from a BLAST file in a data structure

=head1 SYNOPSIS

  use Zerg::Report;
  
  my $zerg_report = new Zerg::Report("output.blastn");
  
  while($r=$zerg_report->getReport())
  { 
    foreach my $hit (@{$r->{hits}})
    {
      foreach my $hsp (@{$hit->{hsps}})
      {
        print "$r->{query_name} $hit->{subject_name} $hsp->{score_bits}\n";
      }
    }
  }

  $zerg_report->closeFile();

=head1 DESCRIPTION

  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 undef. It dies from
  syntax errors in BLAST reports with a stack backtrace.

  Example of a data structure returned by getReport():
  
  $r = {
          'query_name' => 'ME1-0081T-R227-B12-U.G',
          'blast_version' => 'BLASTX 1.3.6 [2002-03-05]',
          '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' => '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',
                        'subject_name' => 'gi|16802882|ref|NP_464367.1|'
                      },
                    ],
        };
   
=head1 AUTHORS

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

=head1 SEE ALSO

Zerg

=cut
# vim:et:ts=2:ai: