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

Column annotation label disappeared #79

Open
shreyagupta0909 opened this issue Jul 23, 2020 · 10 comments
Open

Column annotation label disappeared #79

shreyagupta0909 opened this issue Jul 23, 2020 · 10 comments
Labels

Comments

@shreyagupta0909
Copy link

Hi ,

We are using this package and suddenly with below code Column annotation labels have disappeared. Is there any way to get it back?
Below is the dummy code. This is a bit urgent
mat <- matrix(rnorm(24), ncol = 6)
annotation <- data.frame(gender = c(rep("M", 3),rep("F",3)),
age = c(20,34,27,19,23,30))
hm <- main_heatmap(mat) %>% add_col_annotation(annotation) %>% add_col_labels() %>%
add_row_labels()

Thanks,
Shreya

@AliciaSchep
Copy link
Contributor

What version of the code are you using? And can you clarify exactly what result you're getting and what you're expecting to get?

@shreyagupta0909
Copy link
Author

I am using 0.5.0 version. I have attached the expected result (result_expected.png)
Result_expected

and result I am getting (result_getting.png)
Result_getting

@shreyagupta0909
Copy link
Author

What version of the code are you using? And can you clarify exactly what result you're getting and what you're expecting to get?

Hello, I am using version 0.5.0. I have also attached the screenshots in below message. Could you please help me find the solution to this?

Thanks,
Shreya

@halhen
Copy link

halhen commented Jul 28, 2020

I poked around a bit and haven't quite gotten to the bottom of it, but here is what I found. Hope it helps.

Generating plots in 0.4.12 and 0.5.1 with the code below. I too get not annotation labels in 0.5.1.

set.seed(1)
mat <- matrix(rnorm(24), ncol = 6)
annotation <- data.frame(gender = c(rep("M", 3),rep("F",3)),
                         age = c(20,34,27,19,23,30))
p <- main_heatmap(mat) %>% add_col_annotation(annotation, show_colorbar = TRUE) %>% add_col_labels() %>%
  add_row_labels() 
to_plotly_json(p)

Diffing the two generated plotly jsons give only a small diff:

$ diff /tmp/0.5.1.json /tmp/0.4.12.json                
201a202
> 
224,226c225
<       "y": [
<         1
<       ],
---
>       "y": 1,
298,300c297
<       "y": [
<         1
<       ],
---
>       "y": 1,

It looks like there has been some changes in how lists are handled. For 0.5.1, the screenshot below shows that the trace is marked as AsIs (I(somevalue)). It looks like these values shouldn't be unboxed: jeroen/jsonlite#78 . Maybe the new list handling accidentally does this?

Screenshot from 2020-07-28 22-27-50

That's how far I got down the rabbit hole before I need to get away from the computer. Hope it is useful to track things down; sorry if it leads you astray.

(Unfortunately no workaround to offer).

JSON output: json.zip

@AliciaSchep
Copy link
Contributor

Thanks for your investigation @halhen -- think it revealed the source of the bug that got introduced in an effort to fix another bug (#78 ). Will put in a fix.

@shreyagupta0909
Copy link
Author

Thanks for your investigation @halhen -- think it revealed the source of the bug that got introduced in an effort to fix another bug (#78 ). Will put in a fix.

Hi @AliciaSchep

Is this bug fixed? Will I have to use an updated version for the package now?

@AliciaSchep
Copy link
Contributor

@shreyagupta0909 It should be fixed in the latest version on Github which can be installed via devtools::install_github (but has not yet been submitted to CRAN).

@shreyagupta0909
Copy link
Author

@shreyagupta0909 It should be fixed in the latest version on Github which can be installed via devtools::install_github (but has not yet been submitted to CRAN).

@AliciaSchep till when would this package be available on CRAN?

@halhen
Copy link

halhen commented Oct 9, 2020

Ping on this. When could we hope to get 0.5.1 to CRAN?

@AliciaSchep
Copy link
Contributor

Aiming to submit it some time this week.

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

No branches or pull requests

4 participants