jbrowse icon indicating copy to clipboard operation
jbrowse copied to clipboard

Popup for a GFF3Tabix feature: callbacks not working in the "Attributes" section

Open loraine-gueguen opened this issue 5 years ago • 5 comments

Thanks for the fix of https://github.com/GMOD/jbrowse/issues/1122 in JBrowse-1.15.0

Unlike with NCList StoreClass, the callbacks ("fmtDetailValue" or "fmtDetailField") are not working in the "Attributes" section of the popup with GFF3Tabix storeClass (but they are working well in the "Primary Data" section).

Here part of the popup with a NCList StoreClass (created using flatfile-to-json.pl):

nclist_callback

Here the same data with the GFF3Tabix (and same track configuration -except for storeClass, urlTemplate and tbiUrlTemplate- with multiple callbacks to reformat field names, add links, remove fields):

gfftabix_callback

loraine-gueguen avatar Jul 24 '18 14:07 loraine-gueguen

I think the difference might be that GFF3Tabix is lowercasing all of the attribute names when it makes JBrowse features. Internally, the attribute names of JBrowse features are case insensitive when you get and set them, but maybe we can have it remember the original case for when it iterates over them.

In the meantime, if you update your fmt* function to use lower-case attribute names, does that fix it?

rbuels avatar Jul 24 '18 15:07 rbuels

Indeed, it is ok with lower-case attribute names in the fmt functions. Thanks! I would say it is better if attributes are handled the same way in fmt functions in NClist or GFF3Tabix tracks, but there may be other constraints that prevent that.

loraine-gueguen avatar Jul 25 '18 07:07 loraine-gueguen

And for the GFF3Tabix, attribute handling in fmt function is not consistent between the "Primary data" section (must have same case as in the GFF file) and the "attributes" section (must have lower case).

loraine-gueguen avatar Jul 25 '18 07:07 loraine-gueguen

Yes, that is pretty inconsistent. We should look at cleaning that up. Categorizing as a bug.

rbuels avatar Aug 08 '18 19:08 rbuels

Not sure if I've said this before, but...

GFF attributes are case sensitive. In fact attributes starting with an uppercase letter are reserved. The spec stats:

Note that attribute names are case sensitive. "Parent" is not the same as "parent".

All attributes that begin with an uppercase letter are reserved for later use. Attributes that begin with a lowercase letter can be used freely by applications.

nathanhaigh avatar Aug 17 '18 00:08 nathanhaigh