jbrowse icon indicating copy to clipboard operation
jbrowse copied to clipboard

Better Support for GFF3 Dbxref and Ontology_term attributes

Open nathanhaigh opened this issue 5 years ago • 6 comments

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:

  • https://github.com/The-Sequence-Ontology/Specifications/blob/master/gff3.md#ontology-associations-and-db-cross-references
  • https://gist.github.com/sestaton/ff9424f28b165e761e934f078f07249f
  • https://gist.github.com/nathanhaigh/e7a6cca1bb38704059493359e055c91b
  • ftp://ftp.geneontology.org/pub/go/doc/GO.xrf_abbs
  • https://github.com/geneontology/go-site/blob/master/metadata/db-xrefs.yaml

nathanhaigh avatar Jul 05 '18 00:07 nathanhaigh

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?

rbuels avatar Jul 05 '18 02:07 rbuels

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

cmdcolin avatar Jul 06 '18 20:07 cmdcolin

@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.

nathanhaigh avatar Jul 09 '18 04:07 nathanhaigh

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 avatar Jul 10 '18 15:07 cmdcolin

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

cmdcolin avatar Jul 10 '18 15:07 cmdcolin

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 [email protected] 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 .

rbuels avatar Jul 11 '18 18:07 rbuels