metacoder icon indicating copy to clipboard operation
metacoder copied to clipboard

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

Open dhadsell opened this issue 1 year ago • 8 comments

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 avatar Feb 06 '24 20:02 dhadsell

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

dhadsell avatar Feb 07 '24 21:02 dhadsell

same problem here !

scilexenko avatar Apr 04 '24 13:04 scilexenko

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

AllenLarocque avatar May 15 '24 01:05 AllenLarocque

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

zachary-foster avatar May 15 '24 21:05 zachary-foster

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

AllenLarocque avatar May 22 '24 02:05 AllenLarocque

Great, thanks! I have reproduced the error

zachary-foster avatar May 23 '24 16:05 zachary-foster

Hi @zachary-foster,

Is there a fix for this? I'm running into the same issue.

Thank you!

susheelbhanu avatar May 30 '24 09:05 susheelbhanu