-
Notifications
You must be signed in to change notification settings - Fork 25
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
Colors in GWSS plots #591
Colors in GWSS plots #591
Conversation
Thanks @jonbrenas . Just checking whether this PR is ready for review, or if there is more to do on this part (in which case I might convert it to draft) ? |
OK, so it looks like I dreamt that I had added the code to this PR. I am going to fish for it. |
There are still some issues. Some are pretty minor (the colour map is hard-coded within the function which is dumb, the same needs to be done for the other GWSS functions, ...) but there is something that we need to discuss: the "different colours for different contigs"-thing and the "users can choose how their plots look"-thing don't work particularly well together yet and we need to decide what the parameters should look like. |
Thanks @jonbrenas . Yeah, it would be nice to get the default palette: ihs_params.palette = ihs_params.palette_default, palette_default: palette = "Blues" Regarding supporting both alternating contig colours and user-specified settings, what is the current situation with this PR's code? For instance, if the user doesn't specify any |
The situation is slightly different with iHS as you want a palette with very similar colours to represent the decreasing amount of haplotype homozygosity. Here, we want five clearly distinct colours. So, yes, eventually, the colours will be coming from a palette (the current values are, basically,
I updated the situation a little bit with my last commits but the idea is that there is a default list of |
Hi @jonbrenas, thanks so much, I think this is moving in a good direction :) We could simplify a little further here I think, because rather than create new functions Most users will rarely if ever call these functions directly, rather they will call |
Thanks @alimanfoo . I indeed created these functions to be backwards-compatible with the idea that we would move to the solution you proposed for the next major release (I thought that it was the idea, that minor releases and patches do not break any previously working code but that major releases can). That said, I am not sure I would have remembered ;) ! |
Thanks @jonbrenas. I'm happy to change the API and make a major release release. In general I think making a major release is fine, the main thing is to be aware that we have made an API change and so a major version bump is needed. Also it is good to think about whether the API change will impact lots of user code, and so only do it if there is clear value. But in this case I think the impact to user code will be minimal. |
Thanks @alimanfoo. This should be better now. |
@jonbrenas to resolve conflicts and provide examples here and in notebooks. |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #591 +/- ##
==========================================
- Coverage 95.66% 95.19% -0.47%
==========================================
Files 39 40 +1
Lines 3921 4144 +223
==========================================
+ Hits 3751 3945 +194
- Misses 170 199 +29 ☔ View full report in Codecov by Sentry. |
@alimanfoo, @leehart, I am having trouble with codecov. I don't think the part that is not covered is an issue as it is exclusively code that was already in master. |
@jonbrenas I think we have ignored and merged regardless before, e.g. #647, but I reckon it's a persistent issue, i.e. #554 |
Awesome, looking good! Could you post an example of what it looks like with default colours if you do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just a couple of really tiny suggestions.
# Change this name if you ever change the behaviour of this function, to | ||
# invalidate any previously cached data. | ||
name = "h12_gwss_v1" | ||
name = "h12_gwss_contig_v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = "h12_gwss_contig_v1" | |
name = "h12_gwss_v2" |
Nit, convention is to use the function name then add a version number.
# Change this name if you ever change the behaviour of this function, to | ||
# invalidate any previously cached data. | ||
name = "h1x_gwss_v1" | ||
name = "h1x_gwss_contig_v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = "h1x_gwss_contig_v1" | |
name = "h1x_gwss_v2" |
Do you notice any performance difference at all from this change? Just curious, if you aren't noticing any obvious slowdown then I'm not worried. |
Yeah I think we can ignore the codecov/project check for now. The main thing is that the codecov/patch check is passing, which shows you have good coverage of the code that is being changed in this PR. A previous PR reduced overall coverage for the project slightly, and the codecov/project check keeps complaining about this in every subsequent PR. Feels like there should be some way to reset the base for the codecov/project check, but not sure how. |
Adresses #583.
This commit works on the first point, more discussion is needed for the rest.