Skip to content

Instantly share code, notes, and snippets.

@sestaton
Created May 12, 2016 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sestaton/b48b993f1d70cb28de2e9e39fd2fe98e to your computer and use it in GitHub Desktop.
Save sestaton/b48b993f1d70cb28de2e9e39fd2fe98e to your computer and use it in GitHub Desktop.
create GO term links for jbrowse
fmtDetailValue_Ontology_term : function(goterm) {
if (typeof goterm != 'string') {
return goterm;
}
var dbid = goterm.split(':');
var prefix = '';
switch (dbid[0]) {
case 'GO':
prefix = 'http://amigo.geneontology.org/amigo/medial_search?q=GO:';
break;
default:
return goterm;
};
return '<a href=\"'+ prefix + dbid[1] + '\">' + goterm + '</a>';
}
@sestaton
Copy link
Author

minified for trackList.json:

"fmtDetailValue_Ontology_term" : "function(goterm) { if (typeof goterm != 'string') { return goterm; } var dbid = goterm.split(':'); var prefix = ''; switch (dbid[0]) { case 'GO': prefix = 'http://amigo.geneontology.org/amigo/medial_search?q=GO:'; break; default: return goterm; }; return '<a href=\"'+ prefix + dbid[1] + '\">' + goterm + '</a>'; }"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment