Problem in color callback in bgcolor option

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem in color callback in bgcolor option

Luis Quintales
Hi.
I have the same callback in 'bgcolor' and 'label' options.
'label' works but 'bgcolor' seems no work.

[T]
visible = show
feature      = transcript
glyph        = processed_transcript
bgcolor      = sub { my $feature = shift;  
                my %attributehash = $feature->attributes;
                my $var = $attributehash{"biotype"}[0];
                if ($var eq 'ncRNA') {
                   return 'yellow';}
                else {
                   return 'red';}
               }
label    = sub { my $feature = shift;  
                my %attributehash = $feature->attributes;
                my $var = $attributehash{"biotype"}[0];
                if ($var eq 'ncRNA') {
                   return 'yellow';}
                else {
                   return 'red';}
               }      
key          = Transcript


Some idea?
Thank you,
Luis.

<http://generic-model-organism-system-database.450254.n5.nabble.com/file/n5712392/gbrowsecolor.jpg>



--
View this message in context: http://generic-model-organism-system-database.450254.n5.nabble.com/Problem-in-color-callback-in-bgcolor-option-tp5712392.html
Sent from the gmod-gbrowse mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: Problem in color callback in bgcolor option

Douglas Senalik
This has happened to me more than once, I always forget. When there are
parent and child features, you need to access the parent feature for some
things. I usually use the idiom

  my ($feature,$option_name,$part_no,$total_parts,$glyph) = @_;
  my $parent = $glyph->parent_feature;
 
and then use $parent in place of $feature



--
View this message in context: http://generic-model-organism-system-database.450254.n5.nabble.com/Problem-in-color-callback-in-bgcolor-option-tp5712392p5712393.html
Sent from the gmod-gbrowse mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: Problem in color callback in bgcolor option

Luis Quintales
Thank you very much, dsenalik.
Solved!
I do not understand why, but it works correctly.




--
View this message in context: http://generic-model-organism-system-database.450254.n5.nabble.com/Problem-in-color-callback-in-bgcolor-option-tp5712392p5712394.html
Sent from the gmod-gbrowse mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse