[Bioperl-l] coloring of HSPs in blast panel
Smithies, Russell
Russell.Smithies at agresearch.co.nz
Tue Oct 2 21:05:25 EDT 2007
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.
=======================================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: example.png
Type: image/png
Size: 18507 bytes
Desc: example.png
URL: <http://lists.open-bio.org/pipermail/bioperl-l/attachments/20071003/72371841/attachment-0002.png>
More information about the Bioperl-l
mailing list