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

Error in layout$fun(graph = list(1598, TRUE, c(0, 0, 0, 0, 0, 0, 0, 0, : At rinterface_extra.c:82 : The value 10.642051692927977 is not representable as an integer. Invalid value #362

Open
dhadsell opened this issue Feb 6, 2024 · 6 comments

Comments

@dhadsell
Copy link

dhadsell commented Feb 6, 2024

Hello,
I finally got through the scripts to the point where I am trying to tweak my Log2FC heat.tree
I get a tree with no issues if I use the following script

set.seed(1)
obj6 %>%
heat_tree(node_label = taxon_names,
node_size = n_obs, # number of OTUs
node_color = log2_median_ratio, # difference between groups
node_color_interval = c(-15, 15), # symmetric interval
node_color_range = c("cyan", "gray", "magenta"), # diverging colors
node_size_axis_label = "OTU count",
node_color_axis_label = "Log 2 ratio of median counts",
title = "Open vs Mat samples")
But if I add a line to control the layout as follows:
set.seed(1)
obj6 %>%
heat_tree(node_label = taxon_names,
node_size = n_obs, # number of OTUs
node_color = log2_median_ratio, # difference between groups
node_color_interval = c(-15, 15), # symmetric interval
node_color_range = c("cyan", "gray", "magenta"), # diverging colors
node_size_axis_label = "OTU count",
node_color_axis_label = "Log 2 ratio of median counts",
layout = "da", initial_layout = "re",
title = "Open vs Mat samples")

then I get this error:
Error in layout$fun(graph = list(1598, TRUE, c(0, 0, 0, 0, 0, 0, 0, 0, :
At rinterface_extra.c:82 : The value 10.642051692927977 is not representable as an integer. Invalid value

Any thoughts on how to fix this please?

Darryl

@dhadsell
Copy link
Author

dhadsell commented Feb 7, 2024

differential_Taxa_abundance_Mat_vs_Open_fdr05.pdf
the PDF shows what I get with my dataset when I leave the layout command out.

Also it is an issue with my dataset as the workshop example has no problem

@scilexenko
Copy link

same problem here !

@AllenLarocque
Copy link

AllenLarocque commented May 15, 2024

Hi team,
I've encountered the same error. Before recently (last six months?) everything rendered fine.

It seems to occur in large graphs more than small ones. For example, if I aggregate 16S data at the Order level things it renders perfectly! If I aggregate to Family, Genus, or Species however it does not and triggers the above error.

I thought this may be due to package updates and incompatibility. But it occurs even with minimal packages loaded. This doesn't mean there was some update to a metacoder dependency that has broken things.

Then: a clue! Trial and error has shown that using a layout diffferent than 'davidson-harel' things render fine! This is with using "reingold-tilford" as 'initial_layout'. I tested with using 'davidson-harel' as layout and all other layouts as 'initial layout' and the issue persists. So the problem seems to be in the 'davidson-harel' layout.

This is unfortunate, since for my data the other layouts do not give very useful plots. I would love to resolve this so I hope this may help others more knowledegable than me squash this bug!

Cheers,
A

@zachary-foster
Copy link
Contributor

Can anyone supply example code and data that reproduces this error? Thanks!

@AllenLarocque
Copy link

Example.zip

Hi Zach (and community!),
Attached is a .zip file containing a script and a phyloseq object that I have been using to test this.

The script includes a (roughly) minimal example and tests narrowing things down. I have commented it for you with observations. You just need to adjust input and output directory to match your file structure (I hope that is the only thing to change anyways).

I have at least figured out the cause of the problem: it is the Davidson-harel layout when trying to visualize very large (many-taxa) trees.
Visualization works fine when creating large trees with other layouts.
Visualization works fine when creating smaller trees with Davidson-harel layout.
Visualization breaks when the two are combined.

I am not sure if this is a memory problem; I tested on a machine with 128GB RAM so pretty large (I sadly do not have access to a cloud right now to test further).

I hope this was helpful!

  • Allen

@zachary-foster
Copy link
Contributor

Great, thanks! I have reproduced the error

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

4 participants