2 # BioPerl module for Bio::Search::HSP::PSLHSP
4 # Please direct questions and support issues to <bioperl-l@bioperl.org>
6 # Cared for by Jason Stajich <jason-at-bioperl-dot-org>
8 # Copyright Jason Stajich
10 # You may distribute this module under the same terms as perl itself
12 # POD documentation - main docs before the code
16 Bio::Search::HSP::PSLHSP - A HSP for PSL output
20 # get a PSLHSP somehow (SearchIO::psl)
24 This is a HSP for PSL output so we can handle seq_inds differently.
30 User feedback is an integral part of the evolution of this and other
31 Bioperl modules. Send your comments and suggestions preferably to
32 the Bioperl mailing list. Your participation is much appreciated.
34 bioperl-l@bioperl.org - General discussion
35 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
39 Please direct usage questions or support issues to the mailing list:
41 I<bioperl-l@bioperl.org>
43 rather than to the module maintainer directly. Many experienced and
44 reponsive experts will be able look at the problem and quickly
45 address it. Please include a thorough description of the problem
46 with code and data examples if at all possible.
50 Report bugs to the Bioperl bug tracking system to help us keep track
51 of the bugs and their resolution. Bug reports can be submitted via
54 https://github.com/bioperl/bioperl-live/issues
56 =head1 AUTHOR - Jason Stajich
58 Email jason-at-bioperl-dot-org
62 The rest of the documentation details each of the object methods.
63 Internal methods are usually preceded with a _
68 # Let the code begin...
71 package Bio
::Search
::HSP
::PSLHSP
;
74 # Object preamble - inherits from Bio::Root::Root
77 use base
qw(Bio::Search::HSP::GenericHSP);
82 Usage : my $obj = Bio::Search::HSP::PSLHSP->new();
83 Function: Builds a new Bio::Search::HSP::PSLHSP object
84 Returns : an instance of Bio::Search::HSP::PSLHSP
85 Args : -gapblocks => arrayref of gap locations which are [start,length]
92 my ($class,@args) = @_;
93 my $self = $class->SUPER::new
(@args);
96 $mismatches) = $self->_rearrange([qw(QUERY_GAPBLOCKS
100 $self->gap_blocks('query',$qgaplocs) if defined $qgaplocs;
101 $self->gap_blocks('hit', $hgaplocs) if defined $hgaplocs;
102 $self->mismatches($mismatches) if defined $mismatches;
109 Usage : $obj->gap_blocks($seqtype,$blocks)
110 Function: Get/Set the gap blocks
111 Returns : value of gap_blocks (a scalar)
112 Args : sequence type - 'query' or 'hit'
113 blocks - arrayref of block start,length
119 my ($self,$seqtype,$blocks) = @_;
120 if( ! defined $seqtype ) { $seqtype = 'query' }
121 $seqtype = lc($seqtype);
122 $seqtype = 'hit' if $seqtype eq 'sbjct';
123 if( $seqtype !~ /query|hit/i ) {
124 $self->warn("Expect either 'query' or 'hit' as argument 1 for gap_blocks");
127 unless( defined $blocks ) {
128 return $self->{'_gap_blocks'}->{$seqtype};
130 return $self->{'_gap_blocks'}->{$seqtype} = $blocks;
137 Usage : $obj->mismatches($newval)
138 Function: Get/Set the number of mismatches
139 Returns : value of mismatches (a scalar)
140 Args : on set, new value (a scalar or undef, optional)
147 return $self->{'mismatches'} = shift if @_;
148 return $self->{'mismatches'};