[Bioperl-l] Blast Parser Error

Chris Fields cjfields at uiuc.edu
Tue Sep 19 23:35:32 UTC 2006


This is related to a bug that I'm working on (bug 1986 for the  
curious).  There are problems with certain BLAST reports where the  
order of the hit alignments doesn't match the order in the hit  
table.  Compounding that, the built-in event handler sorts repetitive  
hits, which throws the hit order off.

To solve this, change the event handler:

use Bio::SearchIO::SearchResultEventBuilder;

my $searchio = Bio::SearchIO->new(-file => 'unmasked.blast',
                                   -format => 'blast');
$searchio->attach_EventHandler 
(Bio::SearchIO::SearchResultEventBuilder->new());

When I tried this on your report the hit changes to the first one.

Thank Jason S. for pointing this one out.  I plan on changing the  
event handler to prevent this default behavior.

Chris


On Sep 19, 2006, at 11:41 AM, Lakshmi K Matukumalli wrote:

> Jason Stajich wrote:
>> Forwarding your question to the bioperl mailing list where it can be
>> answered.  Please consider making your BLAST file available one a
>> website - it is bad form to mail someone a very large email  
>> attachment
>> unsolicited.  If you do not have access to a website where you can
>> make the report avaialble you can submit this a bug at
>> http://bugzilla.open-bio.org and attached a report to the bug.
>>
>> it is possible the PARACEL BLAST format is not parseable with latest
>> code - please let the list know what version of bioperl you are using
>> etc.  Please test your question against the latest code in CVS as  
>> well
>> before you ask others to debug this problem.
>>
>> -jason
>>
>> On 9/19/06, *Lakshmi K Matukumalli* <lmatukum at gmu.edu
>> <mailto:lmatukum at gmu.edu>> wrote:
>>
>>     Hi Jason,
>>
>>     I am unable to get correct results with the following blast file.
>>     My input sequence has a repeat element so it has a number of  
>> hits.
>>
>>     But there is only one hit with complete identity across the  
>> length
>>     of query.
>>
>>     The Bioperl parser is not giving me the correct result for the
>>     first hit
>>     and first hsp.
>>
>>     Can you please look into this and let me know if I am doing  
>> something
>>     wrong or
>>     if you have to fix the script.
>>
>>     I am attaching the input file I used along with the script I  
>> used to
>>     print out the top hit.
>>
>>     Thank you,
>>
>>     Lakshmi Kumar
>>
>>
>>
>>
>>     use strict;
>>     use Bio::SearchIO;
>>
>>     my $searchio = Bio::SearchIO->new(-file => ' unmasked.blast',
>>                                       -format => 'blast');
>>
>>     while ( my $result = $searchio->next_result() ) {
>>       my $query_name = $result->query_name;
>>       my ($str);
>>       while( my $hit = $result->next_hit ) {
>>         # process the Bio::Search::Hit::HitI object
>>         while( my $hsp = $hit->next_hsp ) {
>>           # process the Bio::Search::HSP::HSPI object
>>           my ($qs,$qe,$hs,$he) =
>>     ($hsp->query->start,$hsp->query->end,$hsp->subject->start,$hsp- 
>> >subject->end);
>>
>>           my ($chr,$Bts,$Bte) = ($hit->description =~ /Bos taurus
>>     chromosome (.*)-FRAG\[(\d+)\,(\d+)\]/);
>>           $str = $query_name."\t".$chr."\t".($Bts+$hs)."\t".($Bts+ 
>> $he);
>>           last;
>>         }
>>         last;
>>       }
>>       print $str,"\n";
>>     }
>>
>>
>>
>>     BLASTN 1.5.4-Paracel [2003-06-05]
>>
>> [SNIP]
>>
>>
>> -- 
>> Jason Stajich
>> jason at bioperl.org <mailto:jason at bioperl.org>
>> http://www.duke.edu/~jes12/ <http://www.duke.edu/%7Ejes12/>
>
> Hi Jason,
>
> Thank you for forwarding the email. I apologize for sending the large
> attachment.
>
> I have placed the blast file here.
>
> http://mysite.verizon.net/lmatukum/blast/unmasked.blast
>
> You can right click and save the blast file.
>
> Thank you,
>
> Lakshmi Kumar
>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

Christopher Fields
Postdoctoral Researcher
Lab of Dr. Robert Switzer
Dept of Biochemistry
University of Illinois Urbana-Champaign






More information about the Bioperl-l mailing list