-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow users to configure filters and set them at runtime via a editable dialog #4393
Conversation
note: this was motivated originally by this issue (transcription factor track from UCSC called JASPAR) #2624 which is very feat dense and on the UCSC website, they only display features with score>400 by default. this PR allows us to recapitulate a similar behavior in jbrowse |
4f16921
to
95d9fe0
Compare
|
thanks for checking out. the textbox had readonly mistakenly from copying to another part of the codebase and the submit button is disabled and checks if empty and checks basic jexl syntax and reports an error if there is any e.g. syntax error now |
|
not sure what this means, you can edit the textbox?
good catch, i recommended this fix upstream to typos-cli also
onhover where? |
i see regarding clear filters. I will just allow it to submit now with an empty textbox then |
The problem with allowing to submit it with an empty textbox is it errors out because you are "submitting jexl to filter by" |
Could add a filter icon beside the track name and have the onhover show the filter applied ;; clicking on icon could open the modal? Hidden when no filters applied |
error with this fixed now
i think the design of the user interface for this is a little tricky. that is not a bad idea. there is also the concept of a "DispayBlurb" that displays in the lower left corner. I might say that this could go into a follow up PR. it would be valuable, but designing the right UI might take some extra work. I would also say the idea for fetching all the available fields could also be a follow up PR. it is a good idea, but it is a bit on the tricky side to implement and delive correctly. |
Will this work for filtering genomic regions on BAM tracks? There's a Bioinformatics SE question that's just been asked about filtering for medical research to avoid seeing incidental findings: variants in genomic locations not related to the phenotype of their patient. |
this filtering was for arbitrary jexl expressions to be added to gene type tracks (with BAM and CRAM having their own system that is implemented separately).filtering by arbitrary jexl expressions is not exposed to BAM/CRAM right now via the GUI but we can add that too that said, it sounds a bit like what this user wants is related to "regions of interest" IGV has the "regions of interest" functionality JBrowse 2 has the sort of general spreadsheet functionality which a user can load with a BED file with regions of interest, and then it will have links to the various places they want to go if you are trying to auto-generate a link, you can auto-link to a spreadsheet view in JBrowse like this example here with a VCF file but works with BED also note that a custom user interface could also use the embedded jbrowse components to create a little filterable data grid outside of the jbrowse app, and then automatically control the jbrowse app |
full url query params docs here https://jbrowse.org/jb2/docs/urlparams/ |
This allows users to configure a filter in their config.json as an array of jexl strings, or set an array of jexl filters
Fixes #1988
Screenshot showing the runtime dialog
The filters are stored on the LinearBasicDisplay model as a prop named jexlFilters, and the state model is used if no config filters are supplied (otherwise config filters are used, which is an empty array by default)
As the UI is currently designed, the user actually types out jexl: when they are hand-editing the UI. this is a small code simplification, but we could remove it and make it automatically prepend this string. Random note regarding that: i am somewhat just discouraged by the limitations of jexl, so we could consider looking at escape routes e.g. trying to create a javascript eval if security concerns can be addressed