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

Add setting to color by query score per alignment for dotplot, support HTML in config slot descriptions #2483

Merged
merged 8 commits into from
Jun 1, 2022

Conversation

cmdcolin
Copy link
Collaborator

@cmdcolin cmdcolin commented Nov 2, 2021

Inspired by https://github.com/tpoorten/dotPlotly/blob/master/example/README.md

Draft PR because maybe a more flexible color system is needed but this is a cool way where we can get a sense strong vs weak homology, useful for looking at ancient whole genome duplication or similar phenomena

localhost_3000__config=test_data%2Fconfig_dotplot json session=local-mlvINQLx_ (1)

may also be useful to have a legend or similar, and add to regular synteny view

@github-actions github-actions bot added the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Nov 2, 2021
@cmdcolin cmdcolin added the enhancement New feature or request label Nov 2, 2021
@cmdcolin cmdcolin force-pushed the mean_query_id_per_ref branch from 42a21a9 to 56f1d42 Compare December 22, 2021 18:43
@codecov
Copy link

codecov bot commented Dec 22, 2021

Codecov Report

Merging #2483 (751d498) into main (60c79d7) will decrease coverage by 0.09%.
The diff coverage is 33.84%.

@@            Coverage Diff             @@
##             main    #2483      +/-   ##
==========================================
- Coverage   60.93%   60.83%   -0.10%     
==========================================
  Files         590      590              
  Lines       26729    26771      +42     
  Branches     6475     6483       +8     
==========================================
+ Hits        16286    16287       +1     
- Misses      10136    10177      +41     
  Partials      307      307              
Impacted Files Coverage Δ
.../comparative-adapters/src/PAFAdapter/PAFAdapter.ts 64.28% <15.21%> (-28.90%) ⬇️
...otplot-view/src/DotplotRenderer/DotplotRenderer.ts 61.41% <50.00%> (+0.61%) ⬆️
...pes/renderers/ComparativeServerSideRendererType.ts 64.51% <83.33%> (-1.11%) ⬇️
...ConfigurationEditorWidget/components/CodeEditor.js 100.00% <100.00%> (ø)
...ConfigurationEditorWidget/components/SlotEditor.js 64.28% <100.00%> (+1.12%) ⬆️
.../linear-genome-view/src/LinearGenomeView/index.tsx 84.93% <0.00%> (-0.35%) ⬇️
products/jbrowse-web/src/util.ts 27.27% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 60c79d7...751d498. Read the comment docs.

@cmdcolin cmdcolin force-pushed the mean_query_id_per_ref branch from 56f1d42 to 8df5aa6 Compare February 1, 2022 20:30
@cmdcolin cmdcolin force-pushed the mean_query_id_per_ref branch 4 times, most recently from 788a1e6 to 31c1bc6 Compare March 23, 2022 04:21
@cmdcolin cmdcolin marked this pull request as ready for review March 23, 2022 04:41
@cmdcolin cmdcolin force-pushed the mean_query_id_per_ref branch 4 times, most recently from 551dc59 to 2b8fdb5 Compare March 23, 2022 05:05
@cmdcolin
Copy link
Collaborator Author

Added an option for this to the colorBy option for dotplot renderer. Cites the dotPlotly tool since it is inspired by their result (example https://raw.githubusercontent.com/tpoorten/dotPlotly/master/example/Brapa_Bnapus.minimap2.plot.png)

Example rendering with this setting turned on, showing the HTML <ul> and <li> elements in the colorBy description

localhost_3000__config=test_data%2Fconfig_dotplot json session=local-Pf_rTKg-I (1)

@cmdcolin cmdcolin force-pushed the mean_query_id_per_ref branch from 2b8fdb5 to f572e48 Compare March 23, 2022 05:13
@cmdcolin cmdcolin removed the needs label triage Needs a label to show in changelog (breaking, enhancement, bug, documentation, or internal) label Mar 23, 2022
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Apr 5, 2022

This should be ready to go

One interesting thing is that I explicitly check if a config slot is a callback using config.isCallback. Is this a stable API to rely on? By checking if it is a callback, I can get the color with a single readConfObject instead of repeatedly calling readConfObject for each dot in a dotplot

@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Apr 5, 2022

The other interesting thing as mentioned above is it now allows HTML in config slot descriptions, and uses our html sanitizer to render it

@cmdcolin cmdcolin force-pushed the mean_query_id_per_ref branch from f572e48 to 6631334 Compare April 7, 2022 01:32
@cmdcolin cmdcolin force-pushed the mean_query_id_per_ref branch 4 times, most recently from e92281a to 6f1dcba Compare April 25, 2022 19:28
@cmdcolin cmdcolin force-pushed the mean_query_id_per_ref branch from 6f1dcba to 4adbbe6 Compare June 1, 2022 04:16
@cmdcolin
Copy link
Collaborator Author

cmdcolin commented Jun 1, 2022

this should be good to go, I moved the calculation for the mean query score per alignment to only happen if we are actually performing the colorBy:meanQueryIdentity which means if it happens to be slow, it would only happen during this color by setting

@cmdcolin cmdcolin merged commit 1a30a7a into main Jun 1, 2022
@cmdcolin cmdcolin changed the title Mean query score per alignment for dotplot Add setting to color by query score per alignment for dotplot, support HTML in config slot descriptions Jun 1, 2022
@cmdcolin cmdcolin deleted the mean_query_id_per_ref branch June 1, 2022 04:49
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.

1 participant