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
Error: invalid 'xscale' in viewport #800
Comments
ComplexHeatmap::Heatmap(matrix(c(0, 0, 1, 1), nrow=2), show_row_dend = FALSE) does not have this problem. So it's about the row dendograms. I could imagine that the problem is here: ComplexHeatmap/R/Heatmap-draw_component.R Lines 363 to 368 in e412dfc
Assume that If that is true, you may want to make sure Another fix may be around the caller to make sure ComplexHeatmap/R/Heatmap-layout.R Lines 195 to 196 in e412dfc
Either way, good luck! |
Yes, thanks! That was because the height of the dendrogram is zero. Now I reset It is fixed and I have updated it on GitHub. |
Thanks, 3e2efb6 does indeed fix the issue. May I ask when you expect this fix to be available via Bioconductor? Also, my understanding is that R4.0 users will not be able to install anything newer than Bioconductor 3.12 anyway (is that right?), so I have a hard time figuring out what to put in a Update: I just tried Sorry for all these questions, but this is the first time I interact with a Bioconductor package. I think what I wonder most if this can be backported to Bioconductor 3.13 (the issue does not see to be present in 3.12). |
That is a little bit complicated for the management of Bioc packages. Current Bioc version is 3.13 and it corresponds to R 4.1.0. It only means the packages under bioc 3.13 are ensured to be stable with R 4.1.0. There might be problems if you use R packages earlier than 3.13 or use R < 4.1.0. The first scenario is more likely to happen because bioc packages (especially core packages) change their interface when evolving (e.g. GenomicRanges has changed a little bit internally), and the second scenario is less to happen only for some visualization packages which reply on grid may have problem with R-3.*. However, use of R >=4.1 is not enforced. E.g. for ComplexHeatmap R>=4.0 is enough and I think generally putting R>=4.0 is OK unless you are submitting new packages to bioc. For |
Alright, good to know. Thanks!
Yes, I'll experiment some more once the package is in 3.14, thanks again! |
Related:
|
This is fixed in the just-released BioConductor 3.14 - thanks! |
Here's another instance of the basically the same bug, using ComplexHeatmap 2.10 :( ComplexHeatmap::Heatmap(
matrix(c(1, 2), nrow = 2),
right_annotation = ComplexHeatmap::rowAnnotation(
anno = ComplexHeatmap::anno_barplot(c(0, 0))
)
) |
Thanks @bersbersbers ! There should be more places with this type of error. :) |
I guess, yes :) Fyi, this one is easier to workaround for the user by passing some |
fixed :) |
Thanks! I have twos concern about 826b321, though.
What I would propose instead of adding The
This way, you can easily ensure that |
Good point! I will update it according to your suggestion. |
(And maybe it would not hurt to do something like |
This thing is back again :) empty heatmaps work, but fail with an empty annotation: ComplexHeatmap::Heatmap(matrix(nrow = 0, ncol = 5)) # works
ComplexHeatmap::Heatmap(matrix(nrow = 0, ncol = 5), # fails
right_annotation = ComplexHeatmap::rowAnnotation(
y = matrix(nrow = 0, ncol = 1), col = list(y = color)
)
)
|
Zero length annotation affects many places... Is it important for you to have a real zero-length annotation? |
Important? No, not really - the app I am working on let's you filter your data, and some filters just return empty data. But I can easily check for empty data myself. It would make cleaner code if I did not have to do that, though. Also, future users might save some time tracking down this same bug again. (What made me wonder was that empty heatmaps are working fine, so I thought it had to be something else this time.) |
Because I considered empty heatmaps only :) OK, then I will work on empty annotations. Current implementation always assumes there are data points in annotations. |
Hi @jokergoo I am having a similar error when Im trying to label specific genes in the heatmap. Could this be the cause for the issue? Error in valid.viewport(x, y, width, height, just, gp, clip, mask, xscale, :
|
gives
The text was updated successfully, but these errors were encountered: