Closed cmdcolin closed 2 years ago
here is a random possibility for jbrowse 2
it could potentially be session level (?)
i did this out of convenience and because it kind of makes sense...oftentimes the fmtDetailValues were highly duplicated throughout a trackList, so perhaps centralizing it would be nice
here is an example expression that stitches together a URL for civicDB plugin, we have a config slot on session model (default value here just for example)
extraFields: {
type: 'string',
description: 'modifies on the base feature details',
defaultValue: `jexl:{civicdb:"<a href=https://civicdb.org/events/genes/"+feature.gene_id+"/summary/variants/"+feature.id+"/summary>Link to CIVIC</a>"}`,
contextVariable: ['feature'],
},
Then in basefeaturedetails, we call
const extraFields = getConf(session, ['featureDetails', 'extraFields'], {
feature,
})
And mix the result into the feature
This way, we can obtain new fields that are not in the data, and or mutate existing fields
screenshot showing link at the bottom
These was fairly common in jbrowse 1 to allow formatting detail panels to have custom link-outs to external DBs, etc.
fmtDetailValue was the way it was done in jbrowse 1