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

Annotation Legends of col_side_colors disappear after applying clustering to both column and row #144

Closed
JrTai opened this issue Jan 22, 2018 · 13 comments

Comments

@JrTai
Copy link

JrTai commented Jan 22, 2018

No description provided.

@alanocallaghan
Copy link
Collaborator

Can you be more specific?

@JrTai JrTai changed the title nnotation Legend of col_side_colors Annotation Legends of col_side_colors disappear after applying clustering to both column and row Jan 22, 2018
@JrTai
Copy link
Author

JrTai commented Jan 22, 2018

The annotation legend generated by col_side_colors disappear after applying clustering to both column and row data.

Before applying clustering:

before clustering

After applying clustering to both column and row:

after clustering

Many Thanks for helping with this problem!

Best,
Tai

@alanocallaghan
Copy link
Collaborator

alanocallaghan commented Jan 22, 2018 via email

@JrTai JrTai closed this as completed Jan 22, 2018
@JrTai JrTai reopened this Jan 22, 2018
@JrTai
Copy link
Author

JrTai commented Jan 22, 2018

Thanks a lot for your time! :)

@alanocallaghan
Copy link
Collaborator

For the time being, you can set plot_method = "plotly" in your call to heatmaply, which should show a colour legend for the side colours.

@JrTai
Copy link
Author

JrTai commented Jan 23, 2018

Hi Alanocallaghan,

Thanks a lot for the suggestion. I have tried setting plot_method = "plotly" in my heatmaply. It shows the annotation legend but seems some of the text is overlapped.

Before clustering (some text has little overlapped):
before clustering plotly

After clustering to both column and row (it shows the legend for the proper position):
after clustering plotly

After clustering to both column and row with a longer categories list (the text is totally overlapped):
after clustering plotly longer name list

@alanocallaghan
Copy link
Collaborator

How many unique values are in the column annotation?

@JrTai
Copy link
Author

JrTai commented Jan 23, 2018

For the last example above, I have 49 unique values are in the column annotation.

@alanocallaghan
Copy link
Collaborator

I can't replicate the problem, could you post an example?

@JrTai
Copy link
Author

JrTai commented Jan 24, 2018

I have tried this test code in Rstudio

library(gplots)
library(heatmaply)

df<- data.frame(replicate(49,sample(0:1,1000,rep=TRUE)))

annotation_df <- colnames(df)

heatmaply(df,
          fontsize_row = 7,
          fontsize_col = 7,

          plot_method = "plotly",

          col_side_colors = annotation_df,
          hide_colorbar = TRUE,

          dendrogram = "both"
          )

The small viewer shows the annotation text overlapped (49 unique values are in the column annotation ):
plotly_col49

If I zoom the viewer to a bigger window, the annotation text shows better:
plotly_col49_zoom

I have tried 70 unique values in the column annotation, even in the bigger window, the text is overlapped:
plotly_col70_zoom

I think the position of annotation legend text showing depends on the size of heatmap window. There's also an upper limit for the annotation legend to show the text in the bigger zoom window.

I previously show the column annotation legend, the heatmap, in a quite small window. That why even 49 unique values cannot be displayed properly.

@alanocallaghan
Copy link
Collaborator

Cheers, I understand where the issue is coming from now but I haven't figured out a fix just yet

@alanocallaghan
Copy link
Collaborator

I'll deal with this in #141

@yikeshu0611
Copy link

Why always "col_side_colors" exists beside that! Sometimes it seems not good.

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

3 participants