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: polygon edge not found #45

Open
mfahlberg824 opened this issue Apr 17, 2019 · 14 comments
Open

Error: polygon edge not found #45

mfahlberg824 opened this issue Apr 17, 2019 · 14 comments

Comments

@mfahlberg824
Copy link

Hi all,

When trying to plot a dotplot from my GatingSet using ggcyto, I'm unable to do so after applying +axis_x_inverse_trans() because the following error consistently occurs:

Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
polygon edge not found

I've done extensive searching on this and the issue stems from my x-axis and y-axis names having dashes, e.g. "Comp-PerCP-Cy7-A". The program really doesn't like that.

I can't figure out how to change the dashes to "_" or "." I've tried using gsub and changing the names of the columns, but then that completely messes up the gating scheme of my gating set.

Any advice?

@gfinak
Copy link
Member

gfinak commented Apr 17, 2019

I'm a little surprised by the root cause you identified since we've regularly plotted data with such axis names and not had any issues. That said we have seen this error pop up sporadically. If you have a reproducible example that you could post, that would be extremely helpful for us to finally get this dealt with. Thanks for the report.

@mfahlberg824
Copy link
Author

It might not be the cause - that just seems to be the predominant reason that I've found when searching online and seemed to make sense in my case. The other frequent comment I see is that there's an issue with font compatibility.

Here's the code:

xml<-list.files(pattern="wsp",full=T,recursive=TRUE)
ws<-openWorkspace(xml)
gs<-parseWorkspace(ws,name=1,execute=TRUE)
p<-ggcyto(gs, aes(x = "Comp-PerCP-A", y = "Comp-APC-Cy7-A"), subset = "CD3+") + axis_x_inverse_trans() + axis_y_inverse_trans()
p
Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
polygon edge not found

In my case the error is reproducible, it happens every single time.

@mfahlberg824
Copy link
Author

When I don't use the inverse trans functions, I don't have any issues seeing the plots I want.

@mfahlberg824
Copy link
Author

Sorry just caught a slight error in my code, the ggcyto plot should be:

p<-ggcyto(gs, aes(x = "Comp-PerCP-A", y = "Comp-APC-Cy7-A"), subset = "CD3+") + geom_hex(bins=64) + axis_x_inverse_trans() + axis_y_inverse_trans()

Accidentally took out the geom_hex when pasting it here. Everything else I reported still holds true

@mikejiang
Copy link
Member

Without the data (wsp and example FCS), we can't tell exactly where went wrong. Do you think see any warnings from parseWorkspace call?(e.g. "GatingSet contains different gating tree structures"). Since you set name=1, sometime wsp could contain multiple sample groups that carry somewhat different gates.

@mfahlberg824
Copy link
Author

No warnings when parsing the workspace. I have two groups, "All Samples" that's the default group in FlowJo, as well as one additional group. This has happened to me even when I only have the default All Samples group in the workspace without any additional groups.

The FCS Files I'm using are from Flow Repository, ID# FR-FCM-ZY36 about Chagas disease. I'm using all 54 files.

It won't let me attach the workspace here, I attached a screenshot but I can send the file via a different method if you want. Using the latest version of FlowJo and R.
Screen Shot 2019-04-17 at 1 35 02 PM

@mikejiang
Copy link
Member

You can zip you wsp and attach it here

@mfahlberg824
Copy link
Author

Chagas.wsp.zip

@mikejiang
Copy link
Member

I am able to plot it without the issue (using BioC devel). Let me switch to the current BioC release to doublecheck.

@mikejiang
Copy link
Member

I've verified it works on the latest BioC release (only show the first 4 samples here, but it also plots with all 54 files)

library(flowWorkspace)
ws <- openWorkspace("Chagas.wsp")
gs <- parseWorkspace(ws, name = 1)
library(ggcyto)
ggcyto(gs[1:4], aes(x = "Comp-PerCP-A", y = "Comp-APC-Cy7-A"), subset = "CD3+") + geom_hex(bins=64) + axis_x_inverse_trans() + axis_y_inverse_trans()

image

> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

other attached packages:
[1] ggcyto_1.10.2             flowWorkspace_3.30.2     
[3] ncdfFlow_2.28.1           BH_1.69.0-1              
[5] RcppArmadillo_0.9.300.2.0 flowCore_1.48.1          
[7] ggplot2_3.1.0             BiocManager_1.30.4       

loaded via a namespace (and not attached):
 [1] pcaPP_1.9-73        Rcpp_1.0.1          RColorBrewer_1.1-2 
 [4] pillar_1.3.1        compiler_3.5.3      DEoptimR_1.0-8     
 [7] plyr_1.8.4          zlibbioc_1.28.0     tools_3.5.3        
[10] tibble_2.1.1        gtable_0.3.0        lattice_0.20-38    
[13] pkgconfig_2.0.2     rlang_0.3.3         graph_1.60.0       
[16] Rgraphviz_2.26.0    parallel_3.5.3      mvtnorm_1.0-10     
[19] hexbin_1.27.2       gridExtra_2.3       stringr_1.4.0      
[22] withr_2.1.2         dplyr_0.8.0.1       cluster_2.0.7-1    
[25] IDPmisc_1.1.19      stats4_3.5.3        grid_3.5.3         
[28] tidyselect_0.2.5    data.table_1.12.0   glue_1.3.1         
[31] robustbase_0.93-4   Biobase_2.42.0      R6_2.4.0           
[34] rrcov_1.4-7         XML_3.98-1.19       latticeExtra_0.6-28
[37] purrr_0.3.2         corpcor_1.6.9       magrittr_1.5       
[40] scales_1.0.0        matrixStats_0.54.0  BiocGenerics_0.28.0
[43] MASS_7.3-51.3       assertthat_0.2.1    colorspace_1.4-1   
[46] KernSmooth_2.23-15  stringi_1.4.3       flowViz_1.46.1     
[49] lazyeval_0.2.2      munsell_0.5.0       crayon_1.3.4      

Please check your relevant package version and update them as needed.

@mfahlberg824
Copy link
Author

I'll do this and get back to you, thanks.

@mfahlberg824
Copy link
Author

Still not working for me:

sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.14.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] grid parallel stats graphics grDevices utils datasets methods base

other attached packages:
[1] extrafont_0.17 shiny_1.3.1 premessa_0.2.4 hexbin_1.27.2
[5] CytoML_1.8.1 gridExtra_2.3 ggridges_0.5.1 ggcyto_1.10.2
[9] ggplot2_3.1.1 flowStats_3.40.1 cluster_2.0.8 flowViz_1.46.1
[13] lattice_0.20-38 Rgraphviz_2.26.0 graph_1.60.0 BiocGenerics_0.28.0
[17] data.table_1.12.2 flowWorkspace_3.30.2 ncdfFlow_2.28.1 BH_1.69.0-1
[21] RcppArmadillo_0.9.300.2.0 flowCore_1.48.1 gdata_2.18.0 knitr_1.22

loaded via a namespace (and not attached):
[1] matrixStats_0.54.0 openCyto_1.20.2 RColorBrewer_1.1-2 tools_3.5.0 R6_2.4.0
[6] KernSmooth_2.23-15 lazyeval_0.2.2 colorspace_1.4-1 withr_2.1.2 tidyselect_0.2.5
[11] mnormt_1.5-5 extrafontdb_1.0 compiler_3.5.0 Biobase_2.42.0 flowClust_3.20.1
[16] rhandsontable_0.3.7 labeling_0.3 scales_1.0.0 DEoptimR_1.0-8 mvtnorm_1.0-10
[21] robustbase_0.93-4 RBGL_1.58.2 stringr_1.4.0 digest_0.6.18 R.utils_2.8.0
[26] rrcov_1.4-7 base64enc_0.1-3 pkgconfig_2.0.2 htmltools_0.3.6 htmlwidgets_1.3
[31] rlang_0.3.4 rstudioapi_0.10 jsonlite_1.6 mclust_5.4.3 gtools_3.8.1
[36] dplyr_0.8.0.1 R.oo_1.22.0 magrittr_1.5 Matrix_1.2-17 Rcpp_1.0.1
[41] munsell_0.5.0 R.methodsS3_1.7.1 stringi_1.4.3 yaml_2.2.0 MASS_7.3-51.4
[46] zlibbioc_1.28.0 plyr_1.8.4 promises_1.0.1 crayon_1.3.4 splines_3.5.0
[51] pillar_1.3.1 RUnit_0.4.32 fda_2.4.8 corpcor_1.6.9 stats4_3.5.0
[56] XML_3.98-1.19 glue_1.3.1 latticeExtra_0.6-28 httpuv_1.5.1 Rttf2pt1_1.3.7
[61] gtable_0.3.0 purrr_0.3.2 clue_0.3-57 assertthat_0.2.1 ks_1.11.4
[66] xfun_0.6 mime_0.6 xtable_1.8-3 flowUtils_1.46.1 later_0.8.0
[71] IDPmisc_1.1.19 pcaPP_1.9-73 tibble_2.1.1 ellipse_0.4.1

@mfahlberg824
Copy link
Author

I think it's an RStudio issue. I just tried to do it in R (not RStudio) and it worked.

@mfahlberg824
Copy link
Author

Also, when I open quartz() in RStudio prior to running the ggcyto plot, it also works.

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