[Gmod-ajax] Regarding Canvas Features

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

[Gmod-ajax] Regarding Canvas Features

Vijay Bhasker
Hi GMOD

I have typed this code in JBrowse-1.11.0/data/tracks.conf. Is there any error in this like should I replace featurename with any other string in the code because when I refreshed the browser after writing this code I can be able to find a track named 'My Gene Track' but when I click on it nothing appears.

Code in tracks.conf

[tracks.mygff]
key = My Gene Track
storeClass = JBrowse/Store/SeqFeature/NCList
type = FeatureTrack
fmtDetailvalue_Name = function(name){
return "<a href = 'http://www.google.com?featurename="+name+"'>"+name+"</a?";
}
"onClick": {
        "label" : "<div style='font:normal 12px Univers,Helvetica,Arial,sans-se$
        "title" : "{name} {type}",
        "action": "defaultDialog"
    }
variantIsHeterozygous - function(feature)
{var genotypes = feature.get('genotypes');
for( var sampleName in genotypes){
try{
  var gtString = genotypes[sampleName].GT.values[0];
if(! /^1([\|\/]1)*$/.test(gtString) && ! /^0([\|\/]0)*$/.test(gtString))
return true;
}catch(e){}
}
return false;
}
style.color = function(feature,variableName,glyphObject,traack){
return track.config.variantIsHeterozygous(feature) ? 'red' : 'blue';
}

Thanks.

Regards
Vijay.

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

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Canvas Features

Saari, Travis

Vijay,

 

Is it possible that you’re viewing a genomic region which has no annotations? Try zooming out or looking at a different contig? I’m just guessing where you may be having trouble, but it is really hard to understand without more detail. Please, please include screenshots or longer descriptions to make it easier to help you.

 

Travis

 

From: Vijay Bhasker [mailto:[hidden email]]
Sent: Tuesday, August 23, 2016 2:12 PM
To: [hidden email]
Subject: [Gmod-ajax] Regarding Canvas Features

 

Hi GMOD

I have typed this code in JBrowse-1.11.0/data/tracks.conf. Is there any error in this like should I replace featurename with any other string in the code because when I refreshed the browser after writing this code I can be able to find a track named 'My Gene Track' but when I click on it nothing appears.

Code in tracks.conf

[tracks.mygff]
key = My Gene Track
storeClass = JBrowse/Store/SeqFeature/NCList
type = FeatureTrack
fmtDetailvalue_Name = function(name){
return "<a href = 'http://www.google.com?featurename="+name+"'>"+name+"</a?";
}
"onClick": {
        "label" : "<div style='font:normal 12px Univers,Helvetica,Arial,sans-se$
        "title" : "{name} {type}",
        "action": "defaultDialog"
    }
variantIsHeterozygous - function(feature)
{var genotypes = feature.get('genotypes');
for( var sampleName in genotypes){
try{
  var gtString = genotypes[sampleName].GT.values[0];
if(! /^1([\|\/]1)*$/.test(gtString) && ! /^0([\|\/]0)*$/.test(gtString))
return true;
}catch(e){}
}
return false;
}
style.color = function(feature,variableName,glyphObject,traack){
return track.config.variantIsHeterozygous(feature) ? 'red' : 'blue';
}

Thanks.

Regards

Vijay.


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

_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|

Re: Regarding Canvas Features

Scott Cain
In reply to this post by Vijay Bhasker
Pretty close to the top of the JBrowse configuration guide is a description of the config file formats:


What you've posted is a hybrid of the two (presumably from copying and pasting from various sources), and certainly will never work like that.  I suggest that you try to start *simple* and work up from there rather than trying to write functions before you even know if you have data in the right place.


On Tue, Aug 23, 2016 at 3:12 PM, Vijay Bhasker <[hidden email]> wrote:
Hi GMOD

I have typed this code in JBrowse-1.11.0/data/tracks.conf. Is there any error in this like should I replace featurename with any other string in the code because when I refreshed the browser after writing this code I can be able to find a track named 'My Gene Track' but when I click on it nothing appears.

Code in tracks.conf

[tracks.mygff]
key = My Gene Track
storeClass = JBrowse/Store/SeqFeature/NCList
type = FeatureTrack
fmtDetailvalue_Name = function(name){
return "<a href = 'http://www.google.com?featurename="+name+"'>"+name+"</a?";
}
"onClick": {
        "label" : "<div style='font:normal 12px Univers,Helvetica,Arial,sans-se$
        "title" : "{name} {type}",
        "action": "defaultDialog"
    }
variantIsHeterozygous - function(feature)
{var genotypes = feature.get('genotypes');
for( var sampleName in genotypes){
try{
  var gtString = genotypes[sampleName].GT.values[0];
if(! /^1([\|\/]1)*$/.test(gtString) && ! /^0([\|\/]0)*$/.test(gtString))
return true;
}catch(e){}
}
return false;
}
style.color = function(feature,variableName,glyphObject,traack){
return track.config.variantIsHeterozygous(feature) ? 'red' : 'blue';
}

Thanks.

Regards
Vijay.

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

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




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

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

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