[Bioperl-l] Generic Blast parsing issue

Jason Stajich jason@cgt.mc.duke.edu
Fri, 10 May 2002 12:43:38 -0400 (EDT)


This exact functionality has not been ported over from the old system
because I personally don't use it so it wasn't on my list.  If you would
like it added feel free to implement and post a patch or port it from the
old system.

Someone else asked about this function previously and I had a reasonable
way to do it, but can't remember what it was off the top of my head.
Is there any reason the following won't work - you probably would need to
do a little more work to collapse overalapping regions?

# get a hit
...
my (@q_offsets, @s_offsets);
while( my $hsp = $hit->next_hsp ) {

 # throw some logic in to handle reverse strand if
 # we're dealing with DNA
 push @q_offsets, $hsp->query->start ."-". $hsp->query->end;
 push @s_offsets, $hsp->hit->start ."-". $hsp->hit->end;
}

print "HSP query locations are ", join(",", @q_offsets), "\n";
print "HSP subject locations are ", join(",", @s_offsets), "\n";


-jason

On Fri, 10 May 2002 CALLEY_JOHN_N@Lilly.com wrote:

> I'm not sure if this is a bug or a missing feature. I'm a long time user
> of the old Blast.pm module. I recently showed a colleague how to set
> things up and suggested that he use the new generic SearchIO feature
> instead of doing things the old way. Unfortunately he needs the offset of
> the HSP in the query and hit sequences. In the Blast.pm module this is
> accessible via the $hsp->range or $hsp->start methods. In the GenericHSP
> object there are no direct equivalents, but there is the get_aln call.
> Since SimpleAlign uses LocatableSeqs internally I hoped that the start and
> end maintained there, might have what I needed. Unfortunately, they are
> always set to 1 and the length of the sequence. Is this a bug? Or a
> misunderstanding on my part? Do I need to give up on using the generic
> modules?
>
> Thanks,
>   John Calley
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>

-- 
Jason Stajich
Duke University
jason at cgt.mc.duke.edu