[Bioperl-l] how to "tile" the HSPs of a hit-object ?

Steve_Chervitz Steve_Chervitz at affymetrix.com
Tue Mar 21 00:06:12 UTC 2006


Harald,

The SearchUtils::tile_hsps function does not do what you want it to  
do. It does not modify the contained HSP objects and tile them  
together (as perhaps its name suggests it might).

It's goal is to collect summary statistics over all of the HSPs  
within a hit object, so that when you call a method like $hit->length 
(),  you get the sum of all HSPs lengths, factoring out regions of  
overlap between HSPs. As such, it's intended for internal use by the  
GenericHit object.

I just checked in a new version of SearchUtils.pm in which tile_hsps 
() now returns the tiled HSP data it constructs (i.e., the merge-able  
contiguous stretches along query and subject). It still does not  
modify the contained HSPs (I wouldn't feel comfortable doing that, as  
it would invalidate the scoring data), but it might be sufficient for  
your needs. You can now do something like this:

   my ($qcontigs, $scontigs) = Bio::Search::SearchUtils::tile_hsps 
($hit);
   if (ref $qcontigs) {
      print STDERR "Query contigs:\n";
      foreach (@{$qcontigs}) {
           print "contig start is $_->{'start'}\n";
           print "contig stop is $_->{'stop'}\n";
           print "contig identical residues count is $_->{'iden'}\n";
           print "contig conserved residues count is $_->{'cons'}\n";
      }
   }

You can get my new version of SearchUtils.pm via the bioperl CVS  
(also attached it to this message for convenience).

Cheers,
Steve

-------------- next part --------------
A non-text attachment was scrubbed...
Name: SearchUtils.pm
Type: text/x-perl-script
Size: 24089 bytes
Desc: not available
URL: <http://lists.open-bio.org/pipermail/bioperl-l/attachments/20060320/dfc1353e/attachment-0004.bin>
-------------- next part --------------

On Mar 20, 2006, at 12:14 PM, Harald wrote:

> Hi all.
>
> I want to use Bioperl for doing some psi-blast postprocessing (under
> linux with bioperl 1.5 and perl 5.8.7).
>
> For doing so I would like to get for every hit-sequence its alignment
> with the query. So I dont want all those overlapping HSPs, but the one
> and only alignment with best score.
>
> I am reading in the documentation for that for some time and think,  
> that
> "tiling" is what I want to do to each hit-object.
>
> As far as I have understood the documentation, calling
> Bio::Search::SearchUtils::tile_hsps($hit); (or calling
> $hit->ambiguous_aln(), which will call the aforementioned)
> should be suficient so that $hit will become tiled. Right?
>
> But if I run the following program, the ranges of the hsp-objects will
> still overlap :-( - no matter if I use tile_hsp($hit) or
> $hit->ambiguous_aln().
>
> ================================
> use strict;
> use Bio::Tools::Run::StandAloneBlast;
>
> my $report = new Bio::SearchIO('-file'=>'out.txt',
>                    '-fomat'=>'psiblast');
> my $result = $report->next_result;
> my $iterat = $result->next_iteration;
>
> while( my $hit = $iterat->next_hit )
> {
>     $hit->overlap(0);
> #    Bio::Search::SearchUtils::tile_hsps($hit);
>     $hit->ambiguous_aln(); #
>
>     while( my $hsp = $hit->next_hsp )
>     {
>     my @q_range = $hit->range('query');
>     my @h_range = $hit->range('hit');
>
>     $, = " ";
>     print @q_range,"\n";
>     print @h_range,"\n\n";
>     }
>     print "-" x 5, "\n";
> }
> ================================
>
> Can anyone tell me where my problem lies?
>
> Regards and thanks in advance,
> Harald
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l



More information about the Bioperl-l mailing list