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

retrieve data after producing heatmap #134

Open
Ollipolli1909 opened this issue Oct 29, 2024 · 7 comments
Open

retrieve data after producing heatmap #134

Ollipolli1909 opened this issue Oct 29, 2024 · 7 comments

Comments

@Ollipolli1909
Copy link

Hi,
I am looking for a way to retrieve the ordered data after generating the heatmap. Just producing a heatmap without being able to also get the data in the same order is pretty useless. Am I missing something ? I like tidyHeatmap, but wihtout being able to do this I will have to go back to ComplexHeatmaps - and even there it is a pain.

@stemangiola
Copy link
Owner

Can you please make a practical example of what retrieving the "ordered data" would look like, from input to output?

@Ollipolli1909
Copy link
Author

I would like to retrieve a data frame that has the same order (rows/columns) as shown in the heatmap after clustering etc (i.e. I cannot find where the order etc is stored in the object)

@stemangiola
Copy link
Owner

Sorry for the delay, few deadlines are accumulating. I will attend this asap.

@Ollipolli1909
Copy link
Author

Thanks Stefano ! :)

@stemangiola
Copy link
Owner

Actually, I think you can use

... |> as_ComplexHeatmap()

And extract your data from the ComplexHeatmap object. If you have doubts have a look to ComplexHeatmap documentation.

If you manage to extract you data in this way, please update README.Rmd and Vignettes with your example. It will be helpful for others in the future!

@Ollipolli1909
Copy link
Author

I know how to extract what I want from Complexheatmap objects, and there are countless treads on this on biostars etc how to do it via complex for loops or similar. I just wish there was a simple solution/function implemented into the package itself, given it is a necessary output for any downstream analyses.
But i can't complain, you are putting in the effort for everyone ! :)

@stemangiola
Copy link
Owner

The dendrogram, is calculated by ComplexHeatmap, so that information is created after tidyHeatmap takes care of interpreting your commands. So tidyHeatmaps does not know of what the dendrogram will be.

Nonetheless, we could create wrappers to extract some info from the resulting object.

Let's keep into the to-do list. If you know how to extract, you could even implement it yourself pretty easily, and add that function to tidyHeatmap. Very happy to review the 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

2 participants