[Gmod-ajax] features color

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Gmod-ajax] features color

kkarra@stanford.edu
I am trying to display canvas features in different colors based on the value in column 9. I tried many different things, but, I don’t see the colors I have in functions.conf

Wondering where I am going wrong.. this link seems to indicate the value should be accessible by name and since there are no comma separated, I am assuming I get a string back..


Thanks!
-Kalpana

P.S. I looked at http://staging.wormbase.org/tools/genome/jbrowse/data/functions.conf and think I am trying similar thing



GFF example line: (not all lines have orf_classification value)
================

chrI    SGD     gene    13363   13743   .       -       .       ID=YAL064C-A;Name=YAL064C-A;gene=TDA8;Alias=TDA8,YAL065C-A;Ontology_term=GO:0003674,GO:0005575,GO:0008150;Note=Putative%20protein%20of%20unknown%20function%3B%20null%20mutant%20is%20sensitive%20to%20expression%20of%20the%20top1-T722A%20allele%3B%20not%20an%20essential%20gene;display=Putative%20protein%20of%20unknown%20function;dbxref=SGD:S000002140;orf_classification=Uncharacterized


trackList.json:
===============

      {
         "label" : "All Annotated Sequence Features",
         "trackType" : "CanvasFeatures",
         "key" : "All Annotated Sequence Features",
         "storeClass" : "JBrowse/Store/SeqFeature/NCList",
         "style" : {
            "description" : "description,note",
            "className" : "feature",
            "label" : "gene,name,id",
            "color" : "{geneColor}"
         },
         "type" : "CanvasFeatures",
         "glyph" : "JBrowse/View/FeatureGlyph/Box",
         "fmtDetailValue_Name" : "function(name, feature) {if(feature.get('type')=='gene') {return '<a href=\"<a href="http://www.yeastgenome.org/locus/'+name+'/overview\" class="">http://www.yeastgenome.org/locus/'+name+'/overview\">'+name+'</a>';} else { return name;}}",
         "urlTemplate" : "tracks/All Annotated Sequence Features/{refseq}/trackData.json",
         "compress" : 0
      },


functions.conf:
==============
geneColor = function(feature) {
    var orf_class = feature.get('orf_classification');
    if (orf_class.match(/Dubious/i))    {return 'lightgrey';}
    if (orf_class.match(/Uncharacterized/i)) {return 'peachpuff';}
    if (orf_class.match(/Verified/i))    {return 'red';}
    if (orf_class.match(/silenced_gene:Verified/i))  {return 'green';}
    if (orf_class.match(/silenced_gene/i))  {return 'brown';}
    return 'wheat'; }





------------------------------------------------------------------------------

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax