Skip to content

Ensure that missing CNVs are shown in a different colour in plot_diplotype_clustering_advanced#670

Merged
alimanfoo merged 4 commits intomasterfrom
559-Dipclust-deal-with-missing-CNVs
Dec 3, 2024
Merged

Ensure that missing CNVs are shown in a different colour in plot_diplotype_clustering_advanced#670
alimanfoo merged 4 commits intomasterfrom
559-Dipclust-deal-with-missing-CNVs

Conversation

@jonbrenas
Copy link
Copy Markdown
Collaborator

@jonbrenas jonbrenas commented Nov 27, 2024

Resolves #559.

I followed bokeh's lead (and @sanjaynagi's hint) and replaced NaNs with -1. I have been trying to use zhoverformat to have the z value show as NaN instead of -1 but I couldn't find a way to make it work.

Here is a picture of what it looks like:
Screenshot 2024-11-27 at 08 19 47

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@alimanfoo
Copy link
Copy Markdown
Member

Here is a picture of what it looks like

Looks good!

]

# This is grey followed by PuOr5
colorscale_default = ["#cccccc", "#5e3c99", "#b2abd2", "#f7f7f7", "#fdb863", "#e66101"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice to have this defined in a common location. Could we also now use this within the plot_cnv_hmm_heatmap() function so we know the same colours for CNV states are being used throughout?

@jonbrenas jonbrenas marked this pull request as ready for review November 28, 2024 14:33
@jonbrenas
Copy link
Copy Markdown
Collaborator Author

Thanks @alimanfoo . I have set the palette for plot_cnv_hmm_heatmap() to be the same. However, it is hard-coded and I think it would be better to offer users the option to choose their own palette (as is the case for plot_diplotype_clustering_advanced) so I will add palette to the parameters.

@jonbrenas jonbrenas marked this pull request as draft November 28, 2024 16:11
@jonbrenas jonbrenas marked this pull request as ready for review December 2, 2024 15:04
@alimanfoo
Copy link
Copy Markdown
Member

Thanks @alimanfoo . I have set the palette for plot_cnv_hmm_heatmap() to be the same. However, it is hard-coded and I think it would be better to offer users the option to choose their own palette (as is the case for plot_diplotype_clustering_advanced) so I will add palette to the parameters.

Thanks @jonbrenas, good call.

Copy link
Copy Markdown
Member

@alimanfoo alimanfoo left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@alimanfoo alimanfoo changed the title Making sure that missing CNVs are shown in a different colour in plot_diplotype_clustering_advanced Ensure that missing CNVs are shown in a different colour in plot_diplotype_clustering_advanced Dec 3, 2024
@alimanfoo alimanfoo merged commit d6d9d13 into master Dec 3, 2024
@alimanfoo alimanfoo deleted the 559-Dipclust-deal-with-missing-CNVs branch December 3, 2024 18:48
@alimanfoo alimanfoo added the BMGF-068808 Work supported by BMGF grant INV-068808 (MalariaGEN 2024-2027). label Dec 4, 2024
@leehart
Copy link
Copy Markdown
Collaborator

leehart commented May 29, 2025

@jonbrenas Pylint is telling me that it's "dangerous" to have a mutable list as a default value for an argument, so we might want to remedy this at some point.
https://pylint.readthedocs.io/en/latest/user_guide/messages/warning/dangerous-default-value.html

@jonbrenas
Copy link
Copy Markdown
Collaborator Author

Thanks @leehart. Is Python's policy that all parameters should be tuples then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BMGF-068808 Work supported by BMGF grant INV-068808 (MalariaGEN 2024-2027).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display normal copy number (2) differently from missing CNV call (NaN) in advanced diplotype clustering

3 participants