-
Notifications
You must be signed in to change notification settings - Fork 232
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
Add API, prototype demo UI for interactive filtering #1927
Open
eweitz
wants to merge
31
commits into
igvteam:master
Choose a base branch
from
broadinstitute:interactive-filtering
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks @eweitz, this looks straightforward. The demo looks great. I'll get to this asap, no later than next week. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This updates the IGV API to enable point-and-click filtering for genomic features. That makes analysis richer and nimbler.
Impact
Previously, if users wanted to e.g. subset a VCF track to show only variants that are SNPs with AF > 0.05, then they would need to generate a new track. That requires significant effort writing code, managing resulting data, and configuring IGV.
Now, it's feasible to develop an interactive filtering UI that makes such detailed genome analysis quick and easy in IGV. Below is a filtering UI that shows how a user can load an arbitrary VCF and query genomic features in view by any INFO field.
Categorical fields like "Variant type" or "Ancestral allele" are filterable via checkboxes. Numeric fields like "Allele frequency" or "Read depth" are filterable via range inputs. The distribution of field values can also be assessed at a glance. Checkboxes show counts beside them, and range inputs show a histogram above them. The demo UI shows utility, but it's very unpolished. It simply shows that the API is adequate for the core filtering UI.
The client presents faceted search controls using only pre-existing data; no file-specific configuration or processing is needed to enable filtering. In addition to VCFs as shown below, these API updates also enable developing filtering UIs for BED data.
Here's how it looks!
IGV_interactive_filtering_prototype__2025-01-15.mov
Technical overview
A few small igv.js API updates enable clients to develop an IGV filtering UI:
FeatureUtils
andFeatureCache
: surfacing these modules enables efficiently rendering filtered features in a track.featuresloaded
: this event allows clients to respond to track data updates, and show a faceted search UI on track loadThe example demonstrates how those small API changes unlock downstream UI functionality. It uses Crossfilter for fast n-dimensional filtering, grouping, and counting. It makes each INFO field into a queryable dimension. The genomic data is already available in client memory; Crossfilter just makes it easily and efficiently queryable.
The demo UI code is a first pass at porting a mature React IGV filtering UI to plain JavaScript. That aids interoperability and reusability. The React IGV filtering UI is from Single Cell Portal, particularly SCP's multiome filtering functionality. A related announcement shows a richer demo of the faceting widgets in the video above, including possible enhancements like sliders, better collapsing, and sparkbars.