[Bioperl-l] coloring of HSPs in blast panel

Chris Fields cjfields at uiuc.edu
Mon Nov 26 18:59:23 UTC 2007


Steve, Bernd, (and Jason, since you may have some input on this as  
well),

I am now looking into the bug Bernd submitted and it seems there is a  
serious discrepancy with the way the hit raw_score, bits, and  
significance is determined for Hit objects.  Unless I am mistaken  
these should always come from the best HSP when they are present,  
falling back to the hit table data only when no HSP alignments are  
present.  Under the latter conditions a minimal Hit object is made  
from data in the hit table, which reports the rounded bit score, not  
the raw score, so in those cases the raw score would be undefined  
(and you probably should get a nasty warning indicating there are no  
HSPs present to get the data from).

What is occurring now, though, is the raw_score and significance is  
explicitly set from the hit table in the BLAST parser for the Hit  
object at all times, while the bits are correctly derived from the  
best HSP (no fallback to the hit table).  Changing to the behavior  
above results in several tests failing via SearchIO.t, with each  
failed test reporting the expected (read:correct) raw score.

I'll look through the tests just in case, but I am planning on  
committing changes to the BLAST parsers, GenericHit, and SearchIO.t  
(to reflect the correct expected data) in the next day or two unless  
there are any objections.

chris

On Nov 21, 2007, at 12:43 PM, Steve Chervitz wrote:

> On Nov 21, 2007 9:38 AM, Bernd Web <bernd.web at gmail.com> wrote:
>> [snip]
>>
>> Further is is possible to get the raw_score of a hit. $hit->raw_score
>> actually gets the bitscore (w/o decimal point).
>
> Hmmm. raw_score should not be the same as bit score. So given an
> example blast hit line such as:
>
>        Score = 60.0 bits (30), Expect = 1e-06
>
> $hit->raw_score() should return 30, not 60, as you seem to be getting.
>
> Could you submit a bug report for this?  http://www.bioperl.org/ 
> wiki/Bugs
>
> Thanks,
> Steve
>
>>
>> On Nov 21, 2007 5:42 PM, Bernd Web <bernd.web at gmail.com> wrote:
>>> Hi Russell,
>>>
>>> I came across your question. At first I thought all was well on my
>>> system, but indeed I also have these colouring problems.
>>> I noted that scrore in the bgcolor callback gets a different value!
>>> Printing score during hit parsing($hit->raw_score) gives the same
>>> score as -description
>>> my $score = $feature->score; However, printing score in the bgcolor
>>> sub gives 2573!
>>> All scores in the bgcolor routine all different and higher than the
>>> real scores. Were you able to solve this colouring issue?
>>>
>>> Regards,
>>> Bernd
>>>
>>>
>>>> Hi all,
>>>> I'm using a modified version of Lincoln's tutorial
>>>> (http://www.bioperl.org/wiki/ 
>>>> HOWTO:Graphics#Parsing_Real_BLAST_Output)
>>>> and I'm colouring the HSPs by setting the -bgcolor by score with  
>>>> a sub
>>>> to give a similar image to that from NCBI but for some reason, my
>>>> colours are coming out wrong (see attached example)
>>>> They seem to be off by one but I can't see why.
>>>>
>>>> Any ideas?
>>>>
>>>> I can't be certain but I think it's only started doing this  
>>>> since our
>>>> BLAST upgrade to 2.2.17 a few weeks ago.
>>>>
>>>> Here's the colouring code:
>>>> ------------------------------------------------------------------- 
>>>> -----
>>>> -------
>>>> my $track = $panel->add_track(
>>>>                               -glyph       => 'segments',
>>>>                               -label       => 1,
>>>>                               -connector   => 'dashed',
>>>>                               -bgcolor     => sub {
>>>>                                 my $feature = shift;
>>>>                                 my $score = $feature->score;
>>>>                         return 'red'       if $score >= 200;
>>>>                                     return 'fuchsia' if $score  
>>>> >= 80;
>>>>                                     return 'lime'      if $score  
>>>> >= 50;
>>>>                         return 'blue'      if $score >= 40;
>>>>                                     return 'black';
>>>>                                },
>>>>                               -font2color  => 'gray',
>>>>                               -sort_order  => 'high_score',
>>>>                               -description => sub {
>>>>                                 my $feature = shift;
>>>>                                 return unless
>>>> $feature->has_tag('description');
>>>>                                 my ($description) =
>>>> $feature->each_tag_value('description');
>>>>                                 my $score = $feature->score;
>>>>                                 "$description, score=$score";
>>>>                                },
>>>>                              );
>>>> ------------------------------------------------------------------- 
>>>> -----
>>>> ---------
>>>>
>>>>
>>>> Thanx,
>>>>
>>>> Russell Smithies
>>>>
>>>>
>>>>
>>>>
>>>> =================================================================== 
>>>> ====
>>>> Attention: The information contained in this message and/or  
>>>> attachments
>>>> from AgResearch Limited is intended only for the persons or  
>>>> entities
>>>> to which it is addressed and may contain confidential and/or  
>>>> privileged
>>>> material. Any review, retransmission, dissemination or other use  
>>>> of, or
>>>> taking of any action in reliance upon, this information by  
>>>> persons or
>>>> entities other than the intended recipients is prohibited by  
>>>> AgResearch
>>>> Limited. If you have received this message in error, please  
>>>> notify the
>>>> sender immediately.
>>>> =================================================================== 
>>>> ====
>>>>
>>>> _______________________________________________
>>>> Bioperl-l mailing list
>>>> Bioperl-l at lists.open-bio.org
>>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>>
>>>
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>
> _______________________________________________
> 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