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

How to use layer_fun to add a box in the aim areas #1175

Open
yanglq-bioinfo opened this issue Apr 10, 2024 · 0 comments
Open

How to use layer_fun to add a box in the aim areas #1175

yanglq-bioinfo opened this issue Apr 10, 2024 · 0 comments

Comments

@yanglq-bioinfo
Copy link

hello
my code as follows:

Heatmap(expr,
col = colorRamp2(c(-5,0,5), c("navy","#F2F2F2","firebrick3")),
cluster_rows = F,
cluster_columns = F,
na_col = "white",
column_split = factor(anno$module),
row_split = gene_group$module,
column_title_rot = 90,
column_gap = unit(0.5, "mm"),
row_gap = unit(0.5, "mm"),
# column_title=NULL,
# row_title=NULL,
border = F,
use_raster = T,
heatmap_legend_param = list(title = "expr", at = seq(-4, 4, 2),color_bar = "continuous"),
top_annotation = ha,
layer_fun = function(j, i, x, y, width, height, fill){
v = pindex(expr, i, j)
if(min(i)==min(j)){
grid.rect(gp = gpar(lwd = 1, fill = "transparent" ,col="black",lty=2))
}
},
show_column_names = F,
show_row_names = F)

and I get this fig
fig1

However My ideal result would be like this
fig2

How Do I modify this code?

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

1 participant