GMOD / jbrowse

JBrowse 1, a full-featured genome browser built with JavaScript and HTML5. For JBrowse 2, see https://github.com/GMOD/jbrowse-components.
http://jbrowse.org
Other
463 stars 199 forks source link

Better Support for GFF3 Dbxref and Ontology_term attributes #1089

Open nathanhaigh opened 6 years ago

nathanhaigh commented 6 years ago

As things are, the GFF3 attributes Dbxref and Ontology_term are displayed in plain text in the "view details" window: image

While it is possible to use fmtDetailValue_Dbxref and fmtDetailValue_Ontology_term with callbacks to render a link:

"fmtDetailValue_Dbxref" : "function(dbxref){if(typeof dbxref!='string'){return dbxref}var dbid=dbxref.split(':');var prefix='';switch(dbid[0].toLowerCase()){case 'interpro':prefix='http://www.ebi.ac.uk/interpro/entry/';break;case 'pfam':prefix='http://pfam.sanger.ac.uk/family/';break;case 'reactome':prefix='http://www.reactome.org/content/detail/';break;case 'unipathway':prefix='http://www.grenoble.prabi.fr/obiwarehouse/unipathway/upa?upid=';break;case 'kegg':prefix='http://www.genome.jp/kegg-bin/show_pathway?ec';break;case 'prositepatterns':prefix='http://prosite.expasy.org/';break;case 'prositeprofiles':prefix='http://prosite.expasy.org/cgi-bin/prosite/PSView.cgi?ac=';break;case 'smart':prefix='http://smart.embl-heidelberg.de/smart/do_annotation.pl?BLAST=DUMMY&DOMAIN=';break;case 'superfamily':prefix='http://supfam.org/SUPERFAMILY/cgi-bin/scop.cgi?sunid=';dbid[1]=dbid[1].replace('SSF','');break;case 'gene3d':prefix='http://www.cathdb.info/version/latest/superfamily/';dbid[1]=dbid[2];break;case 'pirsf':prefix='http://pir.georgetown.edu/cgi-bin/ipcSF?id=';break;case 'prodom':prefix='http://prodom.prabi.fr/prodom/current/cgi-bin/request.pl?question=DBEN&query=';break;case 'tigrfam':prefix='http://www.jcvi.org/cgi-bin/tigrfams/HmmReportPage.cgi?acc=';break;default:return dbxref};return'<a target=\"_blank\" href=\"'+prefix+dbid[1]+'\">'+dbxref+'</a>'}",
"fmtDetailValue_Ontology_term": "function(ontology_term){if(typeof ontology_term!='string'){return ontology_term}var id=ontology_term.split(':');var prefix='';switch(id[0].toLowerCase()){case 'go':prefix='https://www.ebi.ac.uk/QuickGO/GTerm?id=GO:';break;case 'so':prefix='http://www.sequenceontology.org/browser/current_svn/term/SO:';break;default:return ontology_term};return'<a target=\"_blank\" href=\"'+prefix+id[1]+'\">'+ontology_term+'</a>'}"

image

It seems that there is a centrally maintained file with Ontology and DB cross references: ftp://ftp.geneontology.org/pub/go/doc/GO.xrf_abbs

JBrowse could use this information to support these links out of the box. Then users would only need to fiddle with fmtDetailValue_Dbxref and fmtDetailValue_Ontology_term if they wanted to use a different, non-authoritative, database or a custom DB.

Some useful links:

rbuels commented 6 years ago

This is a very interesting idea Nathan. Do you guys run a Chado database for your data? What does your current data transformation / loading process look like for your JBrowse installation?

cmdcolin commented 6 years ago

I thought at one point that this type of functionality would be good as a plugin since the reference to specific URLs is something that seems like it can shift and change and it increases some maintenance burden on jbrowse, but could be very nice for a plugin to maintain

nathanhaigh commented 6 years ago

@rbuels No Chado DB...just generating track data and config files via a Snakemake pipeline and using some publicly available gene models and functional annotations.

@cmdcolin I thought that given the Gene Ontology are already actively maintaining a specification for these IDs/DB/URLs (ftp://ftp.geneontology.org/pub/go/doc/GO.xrf_abbs) that it could be used as a "definitive" source for default values.

cmdcolin commented 6 years ago

If there was an API that could automatically be understood that would be very nice. That file appears to be hard to mechanically parse.

I don't know if maybe purl is able to automatically map ontology IDs to a url though? Example http://www.obofoundry.org/docs/Policy_for_OBO_namespace_and_associated_PURL_requests.html

In either case, it seems like it should be configurable and/or pluggable

cmdcolin commented 6 years ago

Example http://purl.obolibrary.org/obo/GO_0000002

rbuels commented 6 years ago

When it comes to automatically understanding things, if there is a public SPARQL endpoint around that we could use for this, that would probably be the way to go. SPARQL queries are pretty powerful, and you can do some basic automated reasoning in them (traverse subclass relationships, etc).

On Tue, Jul 10, 2018 at 8:19 AM Colin Diesh notifications@github.com wrote:

Example http://purl.obolibrary.org/obo/GO_0000002

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GMOD/jbrowse/issues/1089#issuecomment-403861206, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEgFaobcsAw2Ta0AgAJ-YC_hN5GwuMNks5uFMXpgaJpZM4VDG_o .