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

Filter tracks that match all view.assemblyNames in multi-assembly track selector modes #3725

Merged
merged 2 commits into from May 26, 2023

Conversation

cmdcolin
Copy link
Collaborator

Currently, tracks in e.g. the track selector to turn on synteny tracks will display any track where

intersection(readConfObject(track,'assemblyNames'), view.assemblyNames).length!==0

This changes it so that it only displays

intersection(readConfObject(track,'assemblyNames'), view.assemblyNames).length===view.assemblyNames.length

I think overall, this conveys a better situation for users. We could alternatively make it so that it can display it in both modes

Fixes #3539

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label May 23, 2023
@cmdcolin
Copy link
Collaborator Author

screenshots of before and after

this branch
image

the only synteny track displayed is the one that is relevant to the current linear synteny view

main branch

Screenshot from 2023-05-23 14-55-59

@cmdcolin cmdcolin added enhancement New feature or request and removed needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) labels May 23, 2023
@cmdcolin
Copy link
Collaborator Author

made a fallback where a particular view type can specify on their view model trackSelectorAnyOverlap:true to display tracks that have 'any overlap' with view.assemblyNames

.views(self => ({
/**
* #method
*/
get(asmName: string) {
return self.assemblies.find(asm => asm.hasName(asmName))
return self.assemblyNameMap[asmName]
Copy link
Collaborator Author

@cmdcolin cmdcolin May 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this refactor to assemblyManager.get speeds up potentially calling assemblyManager.get here many times (for every track * for every assemblyName on track) https://github.com/GMOD/jbrowse-components/pull/3725/files#diff-57f9ccf43c6a6dfb5af36c32f44b8bba8c6339a9e1a76409b44c26f2fefe5cebR71

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #3725 (9ffd734) into main (8bd4796) will increase coverage by 0.00%.
The diff coverage is 78.43%.

@@           Coverage Diff           @@
##             main    #3725   +/-   ##
=======================================
  Coverage   64.29%   64.30%           
=======================================
  Files         961      961           
  Lines       29962    29956    -6     
  Branches     7190     7189    -1     
=======================================
- Hits        19263    19262    -1     
+ Misses      10535    10530    -5     
  Partials      164      164           
Impacted Files Coverage Δ
...ns/alignments/src/PileupRenderer/PileupRenderer.ts 62.44% <ø> (+0.12%) ⬆️
...it-view/src/BreakpointSplitView/components/util.ts 63.51% <ø> (-0.49%) ⬇️
...kpoint-split-view/src/BreakpointSplitView/model.ts 75.75% <ø> (-0.25%) ⬇️
...ectorWidget/components/faceted/FacetedSelector.tsx 0.00% <0.00%> (ø)
...ckSelectorWidget/components/tree/HamburgerMenu.tsx 39.06% <ø> (-3.80%) ⬇️
...ectorWidget/components/tree/HierarchicalHeader.tsx 60.00% <ø> (ø)
...ement/src/HierarchicalTrackSelectorWidget/model.ts 84.21% <96.66%> (+2.47%) ⬆️
packages/core/assemblyManager/assemblyManager.ts 74.64% <100.00%> (+2.77%) ⬆️
packages/core/util/index.ts 82.34% <100.00%> (+0.07%) ⬆️
...torWidget/components/HierarchicalTrackSelector.tsx 76.19% <100.00%> (-4.58%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@cmdcolin
Copy link
Collaborator Author

should be good to go. there could be some future case where this needs adjusting, where e.g. in a multisyntenyview, we have the need to open synteny tracks that don't match all of view.assemblyNames, but i think we can address that as it comes and in the meantime a potential multisyntenyview can enable a property on the view model view.trackSelectorAnyOverlap:true)

@cmdcolin cmdcolin merged commit 22ca290 into main May 26, 2023
11 checks passed
@cmdcolin cmdcolin deleted the every_trackname branch May 26, 2023 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Synteny track selector filtering modes
1 participant