~ubuntu-branches/ubuntu/lucid/bioperl/lucid

« back to all changes in this revision

Viewing changes to Bio/Tools/BPbl2seq.pm

  • Committer: Bazaar Package Importer
  • Author(s): Matt Hope
  • Date: 2004-04-18 14:24:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040418142411-gr92uexquw4w8liq
Tags: 1.4-1
* New upstream release
* Examples and working code are installed by default to usr/bin,
  this has been moved to usr/share/doc/bioperl/bin

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# $Id: BPbl2seq.pm,v 1.18 2001/12/14 16:40:18 heikki Exp $
 
1
# $Id: BPbl2seq.pm,v 1.23 2003/06/03 14:37:50 jason Exp $
2
2
#
3
3
# Bioperl module Bio::Tools::BPbl2seq
4
4
#       based closely on the Bio::Tools::BPlite modules
42
42
         $hsp->query->end;
43
43
         $hsp->sbjct->start;
44
44
         $hsp->sbjct->end;
45
 
         $hsp->sbjct->seqname;
 
45
         $hsp->sbjct->seq_id;
46
46
         $hsp->sbjct->overlaps($exon);
47
47
 }
48
48
 
51
51
BPbl2seq is a package for parsing BLAST bl2seq reports. BLAST bl2seq is a
52
52
program for comparing and aligning two sequences using BLAST.  Although
53
53
the report format is similar to that of a conventional BLAST, there are a
54
 
few differences so that the standard bioperl BLAST parsers Blast.pm and
55
 
BPlite are unable to read bl2seq reports directly.
 
54
few differences so that BPlite is unable to read bl2seq reports directly.
56
55
 
57
56
From the user's perspective, one difference between bl2seq and
58
57
other blast reports is that the bl2seq report does not print out the
100
99
 email or the web:
101
100
 
102
101
  bioperl-bugs@bio.perl.org
103
 
  http://bio.perl.org/bioperl-bugs/
 
102
  http://bugzilla.bioperl.org/
104
103
 
105
104
=head1 AUTHOR - Peter Schattner
106
105
 
142
141
 Args    : -file     input file (alternative to -fh)
143
142
           -fh       input stream (alternative to -file)
144
143
           -queryname    name of query sequence
 
144
           -report_type What type of BLAST was run (blastn,blastp,tblastn...)
145
145
 
146
146
=cut
147
147
 
151
151
    # initialize IO
152
152
    $self->_initialize_io(@args);
153
153
 
 
154
    my ($queryname,$rt) = $self->_rearrange([qw(QUERYNAME 
 
155
                                                REPORT_TYPE)], @args);
 
156
    $queryname = 'unknown' if( ! defined $queryname );
 
157
    if( $rt && $rt =~ /BLAST/i ) {
 
158
        $self->{'BLAST_TYPE'} = uc($rt);
 
159
    } else { 
 
160
        $self->warn("Must provide which type of BLAST was run (blastp,blastn, tblastn, tblastx, blastx) if you want strand information to get set properly for DNA query or subjects");
 
161
    }
 
162
 
154
163
    my $sbjct = $self->getSbjct();
155
164
    $self->{'_current_sbjct'} = $sbjct;
156
165
 
157
 
    my ($queryname) = $self->_rearrange([qw(QUERYNAME)], @args);
158
 
    $queryname = 'unknown' if( ! defined $queryname );
159
166
    $self->{'_query'}->{'NAME'} = $queryname;
160
167
    return $self;
161
168
}
230
237
   my ($sbjct, $hsp);
231
238
   $sbjct = $self->{'_current_sbjct'};
232
239
   unless( defined $sbjct ) {
233
 
#       $sbjct = $self->{'_current_sbjct'} = $self->nextSbjct;
234
 
#       return undef unless defined $sbjct;
235
 
        $self->throw(" No hit object found for bl2seq report \n ") ;
 
240
       $self->debug(" No hit object found for bl2seq report \n ");
 
241
       return undef;
236
242
   }
237
243
   $hsp = $sbjct->nextHSP;
238
244
   return $hsp || undef;