~ubuntu-branches/ubuntu/oneiric/bioperl/oneiric

« back to all changes in this revision

Viewing changes to Bio/Search/HSP/HSPI.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090310071911-ever3si2bbzx1iks
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#-----------------------------------------------------------------
2
 
# $Id: HSPI.pm,v 1.36.4.2 2006/10/02 23:10:24 sendu Exp $
 
2
# $Id: HSPI.pm 15084 2008-12-03 22:31:23Z cjfields $
3
3
#
4
4
# BioPerl module for Bio::Search::HSP::HSPI
5
5
#
235
235
 
236
236
 Title    : gaps
237
237
 Usage    : my $gaps = $hsp->gaps( ['query'|'hit'|'total'] );
238
 
 Function : Get the number of gaps in the query, hit, or total alignment.
239
 
 Returns  : Integer, number of gaps or 0 if none
 
238
 Function : Get the number of gap charcters in the query, hit, or total alignment.
 
239
 Returns  : Integer, number of gap characters or 0 if none
240
240
 Args     : 'query' = num conserved / length of query seq (without gaps)
241
241
            'hit'   = num conserved / length of hit seq (without gaps)
242
242
            'total' = num conserved / length of alignment (with gaps)
553
553
 
554
554
=cut
555
555
 
556
 
#-------
557
556
sub seq {
558
 
#-------
559
557
    my($self,$seqType) = @_; 
560
558
    $seqType ||= 'query';
561
559
    $seqType = 'sbjct' if $seqType eq 'hit';
565
563
    }
566
564
    require Bio::LocatableSeq;
567
565
    my $id = $seqType =~ /^q/i ? $self->query->seq_id : $self->hit->seq_id;
568
 
    new Bio::LocatableSeq (-ID    => $id,
569
 
                           -SEQ   => $str,
570
 
                           -START => $self->start($seqType),
571
 
                           -END   => $self->end($seqType),
572
 
                           -STRAND=> $self->strand($seqType),
573
 
                           -DESC  => "$seqType sequence ",
574
 
                           );
 
566
    return Bio::LocatableSeq->new(  -ID        => $id,
 
567
                                    -SEQ       => $str,
 
568
                                    -START     => $self->start($seqType),
 
569
                                    -END       => $self->end($seqType),
 
570
                                    -STRAND    => $self->strand($seqType),
 
571
                                    -FORCE_NSE => $id ? 0 : 1,
 
572
                                    -DESC      => "$seqType sequence " );
575
573
}
576
574
 
577
575
=head2 seq_str