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

vertical white lines #621

Closed
ccshao opened this issue Oct 27, 2020 · 10 comments
Closed

vertical white lines #621

ccshao opened this issue Oct 27, 2020 · 10 comments

Comments

@ccshao
Copy link

ccshao commented Oct 27, 2020

Hello,

When saving the heatmap to pdf/png files, the plots show vertical white lines, more in png files.
Input is a large matrix, 113 genes by 10154 cells.

Here is the codes for a pdf file, draw makes no difference.

pdf("net_heatmap.pdf", height = 10)
draw(
ComplexHeatmap::Heatmap(mtx,
                        name                      = "mat",
                        col                       = colfn,
                        top_annotation            = colanno,
                        show_column_name          = FALSE,
                        clustering_method_rows    = "ward.D2",
                        clustering_method_columns = "ward.D2",
                        row_names_gp              = grid::gpar(fontsize = 4))
)
dev.off()

Googled it but I don't get a clear answer. Any suggestions? Many thanks!

Saved pdf file
Screenshot_2020-10-27_10-32-46

Saved png file

Screenshot_2020-10-27_10-32-58

@jokergoo
Copy link
Owner

Hi, can you update the package for GitHub to the newest version? I think I've fixed that bug (I hope!).

@ccshao
Copy link
Author

ccshao commented Oct 28, 2020

Thanks, the lastest version solved the issue.

By the way, with magick package, the saved figure was blurry. An example is shown below.
Screenshot_2020-10-28_14-16-35

@ccshao ccshao closed this as completed Oct 28, 2020
@mmfalco
Copy link

mmfalco commented Feb 17, 2021

Hi @jokergoo, I am using the l am trying to replicate the output plot from inferCNV package using a recent version of your package (2.7.6.1004).I'm trying to get some plot like this:
infercnv

I'm having some white lines but in the row annotation color bars of the upper heatmap. In my casethere are ~7000 rows in the upper heatmap,so it's probable it is due to a raster problem, but even specifying the argument raster_device = "CairoPNG" there are some white lines appearing in the annotation bars of the plot. Also I don't know if it has something to do that, since it is a list of heatmaps, I'm using the draw() function to print the plot. But I think that's not the case because when I plot the upper heatmap alone I still have the lines
Any suggestion?
Thanks in advance

@jokergoo
Copy link
Owner

@mmfalco What version of ComplexHeatmap are you using?

@mmfalco
Copy link

mmfalco commented Feb 18, 2021

@jokergoo I used ComplexHeatmap_2.7.6.1004. I replicated the plot with random data so you can see what I mean.
The dim() for the upper heatmap is 6891 5863 and for the lower heatmap 2848 5863
random

And this is how I made the plot:

ht1<-Heatmap(imat,name = "ht1",
             cluster_rows = F,cluster_columns = F,show_row_names = F,show_column_names = F,#remove dendograms and name labels in col and row
             row_title = "Observations(Cells)",row_title_side = "left",
             col = col_fun,#custom legend
             left_annotation = subc_annot,
             right_annotation = sample_annotation,
             bottom_annotation = chr_labels,
             heatmap_legend_param = list(title="Modified Expression"),
             height = 0.75,raster_device = "CairoPNG"
)

ref_ht<-Heatmap(rmat,name = "ref_ht",
             cluster_rows = F,cluster_columns = F,show_row_names = F,show_column_names = F,#remove dendograms and name labels in col and row
             row_title = "Reference(Cells)",row_title_side = "left",
             show_heatmap_legend = F,
             col = col_fun,#custom legend
             right_annotation = ref_annotation,
             height = 0.25,raster_device = "CairoPNG"
             
             
)

draw(ref_ht %v% ht1, merge_legends=T,ht_gap = unit(0.8, "cm"),
     legend_title_gp=gpar(fontsize = 16),legend_labels_gp=gpar(fontsize = 14))
#add cluster and chr lines for Observations
decorate_heatmap_body("ht1", {
  eval(parse(text =chr_lines ))
  eval(parse(text =clus_lines ))
  
})
#add  lines for ref
decorate_heatmap_body("ref_ht", {
  eval(parse(text =chr_lines ))
  eval(parse(text = ref_clus_lines))
  
})

@ATpoint
Copy link

ATpoint commented Mar 2, 2022

Same issue here, what worked for me was to install the magick package.

@prinkessbambi
Copy link

@ATpoint Hi, I have the same problem but with the oncoprint() function. I've installed magick 2.7.3, but I don't see an improvement. Do you have any tips? Did you use something specific from the magick package?

@ATpoint
Copy link

ATpoint commented Aug 29, 2022

@prinkessbambi I have no additional advise, sorry. It really just was installing that packing, restarting the session and done.

@jokergoo
Copy link
Owner

@prinkessbambi If you can provide your code, your plot and your session info, I can help you with it.

@avishai987
Copy link

For me, use_raster = F in Heatmap function solved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants