Display gene products vs gene IDs for a GFF track #2729
Replies: 2 comments 2 replies
-
In general, one way to modify a track is to edit it with our graphical editor and then export the config for that track to add to your config file. On JBrowse Web, make a copy of the track (track menu -> Copy track), which will copy the track to your "Session tracks" (on JBrowse Desktop you don't have to make a copy, you can edit the track directly). Then in the copy, go to the settings (track menu -> Settings). Then you can update what you need, in this case probably the "name" under "labels". You can probably replace "id" with "product" in the existing entry (FYI these types of config slots use jexl to evaluate the expression). Once you're satisfied with the changes, export them (File -> Export session). The resulting JSON file will have a section called "sessionTracks" that contains your modified track that you can then copy into your config.json. For your change in particular, I would guess the necessary track config would look something like this: {
"type": "FeatureTrack",
"trackId": "gff3_genes",
"name": "GFF3 genes",
"assemblyNames": [
"volvox"
],
"adapter": {
"type": "Gff3Adapter",
"gffLocation": {
"locationType": "UriLocation",
"uri": "volvox.sort.gff3",
}
},
"displays": [
{
"type": "LinearBasicDisplay",
"displayId": "gff3_genes-LinearBasicDisplay",
"renderer": {
"type": "SvgFeatureRenderer",
"labels": {
"name": "jexl:get(feature,'product')"
}
}
}
]
} |
Beta Was this translation helpful? Give feedback.
-
I tried copying and modifying the tracks, but I think its running into a problem because the 'product' is from a sub-feature (CDS) and not a feature. So when I replaced: get(feature,'name') || get(feature,'id') with get(feature,'name') || get(feature,'product') no labels appeared. Is there a way to specify a label from a sub-feature? |
Beta Was this translation helpful? Give feedback.
-
Hi JBrowse2 developers,
Sorry in advance if I have missed this in the user guide, but I was wondering if there is a way to change what label is displayed per gene on a GFF track. I am hoping to modify some of my GFF tracks to show the 'product' from the CDS subfeature for each gene instead of the 'id'. This product value is visible when I click on a gene in the Feature Details panel but I would like it to show up without having to click on a gene. How can I modify the config.json file to do this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions