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

ComplexHeatmap with specific rownames #1174

Open
ManarRashad opened this issue Apr 7, 2024 · 0 comments
Open

ComplexHeatmap with specific rownames #1174

ManarRashad opened this issue Apr 7, 2024 · 0 comments

Comments

@ManarRashad
Copy link

Dears,
I am trying to draw a heatmap using ComplexHeatmap package and don't want to show the rownames except row number 283.

I wrote the following code:

desired_row_index <- 283

Heatmap(scoresPathway, name = "Z-score", show_column_names = FALSE,
column_title = "Cluster.1scorespathway",
column_title_side = "top",
column_title_gp = gpar(fontsize = 20),
cluster_columns = TRUE,
clustering_distance_columns = "euclidean",
clustering_method_columns = "ward.D2",
cluster_rows = TRUE,
show_row_names = gpar(ifelse(1:nrow(scoresPathway) == desired_row_index, TRUE, FALSE)),
row_names_gp = gpar(col = "red"),
clustering_distance_rows = "euclidean",
clustering_method_rows = "ward.D2",
column_dend_height = unit(1.5, "cm"),
row_dend_width = unit(1.5, "cm"))

but I don't know where is the problem with using if condition in show_row_names.

As I always get this error:

Error in if (show_row_names) { : argument is not interpretable as logical

Could you help me with this? or even how I make this row with red and others with black?

Thanks,

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