-
Notifications
You must be signed in to change notification settings - Fork 167
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
Default y-min in chromsome scatter plots #643
Comments
Hi @micknudsen, Not an author of CNVkit, but you are probably right
Just to precise your issue, minimal command to reproduce is: Thanks a lot for reporting this ! Hope this helps. |
This old issue of mine might be related: #385. However, I'm not sure this behaviour is unexpected. I think (and @etal can confirm/deny) the rationale was to prevent very negative scores (such as the ones from biallelic deletions) from compressing the Y axis. Indeed, as you can see on your second graph, variations in most of the signals become hard to see now that the range on the Y axis is so wide. However, I agree that the data shouldn't just disappear like it happens now. The best solution I can think of is to keep the current default threshold (–5), but to clip the data to that threshold rather than hiding it. @etal @tetedange13 @micknudsen what do you think of this proposal? |
Maybe one could put a hard lower bound on the y-axis – as it is now – and then indicate segments falling below this with a line (or some other indicator) below the axis? Something along the line (pun intended) in which IGV indicates downsampling of reads by showing a thick, black line above the alignment. This could also be applied to very high values. |
@tskir , The problem I see with clipping, is cases like @micknudsen has: important number of data located relatively at same coordinates Idea of a line looks cool and not that hard to implement No matter the choice made, I think we should also add more logging about this |
Lemme look at this a little more. The intended behavior was:
Aside from the segments, there are almost always lots of spurious single-bin datapoints (probes) and I think it's OK to ignore these in setting the plot limits and focus our attention on the segments. I agree that showing clipping on the y-axis is much better than failing to plot those segments at all. I'm not sure the rug plot is exactly the right solution. I'd prefer to keep the color the same as the segments, only represent the segments (ignore individual probes, unless the input was only .cnr) and cling to the bottom spine rather than add another h-line. Maybe a rug plot with orange points facing upward, on a black line identical to the plot's bottom border? Or just spans of orange on that line, or a small triangle on the bottom to indicate each clipped segment? |
Hi @etal, Thanks for your feedback ! This makes sense to rather focus on masked segments Corresponding code: if segments and hidden_seg.sum():
x_hidden = segments.start[hidden_seg] * MB
y_hidden = np.array([y_min] * len(x_hidden)) + 0.2
axis.scatter(x_hidden, y_hidden, marker='^', linewidth=3, snap=False,
color=segment_color) Have a nice day. |
Yes, that mockup is very close. To ensure it's not mistaken for an ordinary segment, I'd like to avoid rounded corners (so it looks sharp and somewhat alarming), and ideally, overlap the plot's lower spine (higher z-order or something like that, so it obscures the plot boundary itself and is clearly "breaking through" -- if that's possible). To avoid rounding, maybe switch |
Hi @etal,
Result bellow is still with Have a nice day. |
Hey Felix, this looks great! If you have a PR for this feature I'd be very happy to merge it. |
Great, I've reviewed and merged #645. This feature is now part of CNVkit. |
I wonder if this should be
min
instead ofmax
?cnvkit/cnvlib/scatter.py
Line 370 in d4145c5
With the current default settings, some biallelic deletion are not shown. Here is an example (CNVkit v0.9.9) without
--y-min
specified:and with
--y-min=-10
:The text was updated successfully, but these errors were encountered: