rgb for xyplot part_color

View: New views
2 Messages — Rating Filter:   Alert me  

rgb for xyplot part_color

by alesk sboob :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi everyone,

I'd like to use RGB notation when using part_color.
I tried that :

[MyFeature]
feature = MyFeature
glyph           = xyplot
graph_type      =  boxes
label           = 0
part_color   = sub {
                my $feat = shift;
                if($feat->has_tag('MyTag')) {
                        return rgb(150,150,0);
                }
                else{
                        return 'grey';
                }
        }
max_score       = 3
min_score       = -3
key             = MyFeatureKey
group_on = display_name
height          =100
bump    =0

Unfortunately it didnt work.
Here is the error.log :
Error returned while evaluating value of 'part_color' option for glyph Bio::Graphics::Glyph::xyplot=HASH(0x98bb348), feature MyFeature:MySource(MyType): Undefined subroutine &Bio__Graphics__BrowserConfig_HASH_0x9083850_::rgb called at (eval 87) line 3.

I tried to add "use Bio::Graphics::Panel;" in the xyplot.pm file ... no succes.
Any idear anyone?

Alesk



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gmod-gbrowse mailing list
Gmod-gbrowse@...
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse

Re: rgb for xyplot part_color

by Scott Cain-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alesk,

Here's what the perldoc for Bio::Graphics::Panel says about the rgb method:

           This method is only useful within a
           glyph’s draw() routine, after the panel has allocated a GD::Image
           and is populating it.

and it's not clear to me that the callback is evaluated in this
context, which is why you don't have access to that method.  Instead,
I suggest you use the html # notation, but instead of writing the "#"
character (because that causes problems too), write it as a char:

  return chr(35)."686800";

Scott


On Fri, Oct 16, 2009 at 8:33 AM, alesk sboob <aleskouille@...> wrote:

>
> Hi everyone,
>
> I'd like to use RGB notation when using part_color.
> I tried that :
>
> [MyFeature]
> feature = MyFeature
> glyph           = xyplot
> graph_type      =  boxes
> label           = 0
> part_color   = sub {
>                 my $feat = shift;
>                 if($feat->has_tag('MyTag')) {
>                         return rgb(150,150,0);
>                 }
>                 else{
>                         return 'grey';
>                 }
>         }
> max_score       = 3
> min_score       = -3
> key             = MyFeatureKey
> group_on = display_name
> height          =100
> bump    =0
>
> Unfortunately it didnt work.
> Here is the error.log :
> Error returned while evaluating value of 'part_color' option for glyph
> Bio::Graphics::Glyph::xyplot=HASH(0x98bb348), feature
> MyFeature:MySource(MyType): Undefined subroutine
> &Bio__Graphics__BrowserConfig_HASH_0x9083850_::rgb called at (eval 87) line
> 3.
>
> I tried to add "use Bio::Graphics::Panel;" in the xyplot.pm file ... no
> succes.
> Any idear anyone?
>
> Alesk
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Gmod-gbrowse mailing list
> Gmod-gbrowse@...
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
>
>



--
------------------------------------------------------------------------
Scott Cain, Ph. D.                                   scott at scottcain dot net
GMOD Coordinator (http://gmod.org/)                     216-392-3087
Ontario Institute for Cancer Research

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Gmod-gbrowse mailing list
Gmod-gbrowse@...
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse