Skip to content
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 custom filtering expressions to be applied to state or configuration of tracks #1988

Closed
cmdcolin opened this issue May 18, 2021 · 7 comments · Fixed by #4393
Closed
Labels
enhancement New feature or request size medium not trivial

Comments

@cmdcolin
Copy link
Collaborator

The alignments track implemented a number of bespoke filtering options. It could be useful for our other tracks to have some filtering ability too. The VCF for example, I may want to look for translocations specifically, or I might want to filter out a specific gene in a gene track for demonstration purposes

@cmdcolin cmdcolin added the enhancement New feature or request label May 18, 2021
@cmdcolin
Copy link
Collaborator Author

Some ideas about filtering discussed in gitter cc @scottcain , RE: having same GFF serve multiple tracks each with different filtering expressions.

This may download more data than is needed for each track since much data gets filtered out, but could still be interesting.

@cmdcolin

This comment was marked as off-topic.

@cmdcolin

This comment was marked as off-topic.

@cmdcolin
Copy link
Collaborator Author

some possible implementation notes

  1. the "ServerSideRendererType" which is used for most tracks is currently responsive to a "filters" property being used in the renderProps of a display method. "filters" is an array of jexl callbacks (just plain strings of the type "jexl:get(feature,'start')<100?true:false, receiving a "feature" object, and returning true or false to keep it
  2. To implement this in a way the config system can hook into, we could make a "filter" slot on the base track or something that is just a single string, that can be a jexl callback, that gets added to this filters property of renderProps [1]
  3. To make it something even easier to access, this is often done by adding a custom GUI element in e.g. to trackMenuItems. The trackMenuItem may pop up a dialog, and manipulate the track state instead of the config. This could allow the user to interactively choose edit their filters more easily than manually writing jexl callbacks in a copy of a track in the config editor. To make custom trackMenuItems, you can subclass a particular display type or extend it with the extendPluggableElements ExtensionPoint via a plugin for example

[1] I don't make it a stringArray of multiple filters because changing a stringArray to a jexl callback would be a single jexl callback that returns an array of strings, not an array of jexl callbacks. would need a different config slot type for that

@cmdcolin
Copy link
Collaborator Author

cc @andrzejgrzelak

@cmdcolin
Copy link
Collaborator Author

i'll just note that the alignments track could add this feature as a special filter for the sashimi's too if it is helpful

@cmdcolin
Copy link
Collaborator Author

this was added in internal form to alignments by @carolinebridge-oicr , could be generalized to other tracks and make UI for filter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size medium not trivial
Projects
None yet
1 participant