[Bioperl-l] Fwd: blast results: how to get forward/reverse strand info?

Dave Messina David.Messina at sbc.su.se
Mon Apr 11 12:51:22 UTC 2011


---------- Forwarded message ----------
From: <fpf at biochem.mpg.de>
Date: Mon, Apr 11, 2011 at 14:15
Subject: Re: [Bioperl-l] blast results: how to get forward/reverse strand
info?
To: Dave Messina <David.Messina at sbc.su.se>


Dear Dave,

Thanks for your help. This solved the problem. There is one additional
info: $hsp->strand() will return the value for query (which, with
blastN, is always +1). This is what I had tried without success.
But as you point out: $hsp->strand('hit') provides the required
strand information.

Thanks again.

Friedhelm


Quoting Dave Messina <David.Messina at sbc.su.se>:

 Hi Friedhelm,
>
> Ah, yes, I've been bitten by that, too. You need to specify whether you
> want
> the strand for query or hit, a la:
>
>      $hsp->strand('hit');
>
> Here are the docs for that method, from Bio::Search::HSP::HSPI
>
>  Title   : strand
>  Usage   : $hsp->strand('query')
>  Function: Retrieves the strand for the HSP component requested
>  Returns : +1 or -1 (0 if unknown)
>  Args    : 'hit' or 'subject' or 'sbjct' to retrieve the strand of the
> subject
>           'query' to retrieve the query strand (default)
>           'list' or 'array' to retreive both query and hit together
>
>
> Dave
>
>
>
>
> On Thu, Apr 7, 2011 at 17:35, <fpf at biochem.mpg.de> wrote:
>
>  Dear BioPerl specialists,
>>
>> At the end is part of a blast result which I want to parse:
>>
>> Blast version: BLASTN 2.2.24 [Aug-08-2010]
>>
>> BioPerl call:
>> use Bio::SearchIO ;
>> ...
>>  my $stringfh = new IO::String ($blaststring);
>>  my $in = new Bio::SearchIO (-format => 'blast', -fh => $stringfh)
>>       or die "parsing blast output string failed";
>>
>> I need to know if my hit is forward (Strand = Plus / Plus)
>> or reverse ( Strand = Plus / Minus)
>>
>> As I did not see how this information is returned, I checked if
>> hit_end is > or < hit_start. However, the hit_start and hit_end
>> coordinates
>> are given "(in original hit sequence coords)" as stated in e.g.
>>
>> http://search.cpan.org/~cjfields/BioPerl-1.6.1/Bio/Search/HSP/GenericHSP.pm
>>
>> In the example below,
>> hit_start is 24885
>> hit_end is 25902
>>
>> How to find out if the hit is to the forward or reverse strand?
>> I tried "->strand" but without success (always returns 1)
>>
>> Thanks for your help
>>
>> Friedhelm Pfeiffer
>> fpf at biochem.mpg.de
>>
>>
>> here is blaststring (central alignment section removed)
>>
>>  Hfvol_pHV3 haloVolc1_dna pHV3
>>
>>>
>>>          Length = 437906
>>
>>  Score = 1905 bits (961), Expect = 0.0
>>  Identities = 1009/1021 (98%), Gaps = 3/1021 (0%)
>>  Strand = Plus / Minus
>>
>> Query: 27    cggcgatgccgaggatttcggaccgccggacgcgcagggaaacgccgtcgacggcgcgga
>> 86
>>            ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
>> Sbjct: 25902 cggcgatgccgaggatttcggaccgccggacgcgcagggaaacgccgtcgacggcgcgga
>> 25843
>>
>> ...
>>
>> Query: 986   tcaggtcccgggccctggaattcgatgctggccggattcaacggaacctttgctggggag
>> 1045
>>            ||||||||| ||||||||||||||||||| ||||||||| ||||| || |||||||||||
>> Sbjct: 24942 tcaggtccc-ggccctggaattcgatgct-gccggattcgacggagccgttgctggggag
>> 24885
>>
>>
>>
>>
>>
>> _______________________________________________
>> 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