plot_connections() Too many stacks to draw error

324 views
Skip to first unread message

Matt R

unread,
Jan 10, 2020, 11:10:58 AM1/10/20
to cicero-users
Hannah and others,

I am trying to plot connections with gene annotations but I am receiving this error:

Error in .local(GdObject, ...) : 
  Too many stacks to draw. Either increase the device size or limit the drawing to a smaller region.

 I have tried changing viewport dimensions and increasing the dimensions of the png file, but this does not resolve the issue. It simply plots the connection plot without gene annotations on the bottom. Any ideas or advice? 

Thanks in advance! 
Matt R

R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS: /usr/local/lib64/R/lib/libRblas.so
LAPACK: /usr/local/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
 [1] bedtoolsr_2.29.0-3                ChIPpeakAnno_3.16.1              
 [3] VennDiagram_1.6.20                futile.logger_1.4.3              
 [5] stringr_1.4.0                     SummarizedExperiment_1.12.0      
 [7] DelayedArray_0.8.0                BiocParallel_1.16.6              
 [9] matrixStats_0.55.0                cicero_1.0.15                    
[11] Gviz_1.26.5                       monocle_2.10.1                   
[13] DDRTree_0.1.5                     irlba_2.3.3                      
[15] VGAM_1.1-1                        ggplot2_3.2.1                    
[17] Matrix_1.2-15                     EnsDb.Hsapiens.v86_2.99.0        
[19] ensembldb_2.6.8                   AnnotationFilter_1.6.0           
[21] GenomicFeatures_1.34.8            AnnotationDbi_1.44.0             
[23] Biobase_2.42.0                    chromVAR_1.4.1                   
[25] BSgenome.Hsapiens.UCSC.hg38_1.4.1 BSgenome_1.50.0                  
[27] rtracklayer_1.42.2                Biostrings_2.50.2                
[29] XVector_0.22.0                    GenomicRanges_1.34.0             
[31] GenomeInfoDb_1.18.2               IRanges_2.16.0                   
[33] S4Vectors_0.20.1                  BiocGenerics_0.28.0              
[35] TFBSTools_1.20.0                  JASPAR2018_1.1.1                 
[37] Seurat_3.1.2                      Signac_0.1.6                     

loaded via a namespace (and not attached):
  [1] rappdirs_0.3.1              GGally_1.4.0               
  [3] R.methodsS3_1.7.1           tidyr_1.0.0                
  [5] acepack_1.4.1               bit64_0.9-7                
  [7] knitr_1.21                  multcomp_1.4-11            
  [9] R.utils_2.9.2               data.table_1.12.8          
 [11] rpart_4.1-13                KEGGREST_1.22.0            
 [13] RCurl_1.95-4.12             metap_1.2                  
 [15] lambda.r_1.2.4              cowplot_1.0.0              
 [17] TH.data_1.0-10              RSQLite_2.1.1              
 [19] RANN_2.6.1                  combinat_0.0-8             
 [21] future_1.15.1               bit_1.1-14                 
 [23] mutoss_0.1-12               httpuv_1.5.2               
 [25] assertthat_0.2.1            DirichletMultinomial_1.24.1
 [27] viridis_0.5.1               xfun_0.5                   
 [29] hms_0.5.2                   promises_1.1.0             
 [31] progress_1.2.0              caTools_1.17.1.3           
 [33] igraph_1.2.4.2              DBI_1.0.0                  
 [35] htmlwidgets_1.5.1           sparsesvd_0.2              
 [37] reshape_0.8.8               purrr_0.3.3                
 [39] dplyr_0.8.3                 backports_1.1.5            
 [41] annotate_1.60.1             gbRd_0.4-11                
 [43] RcppParallel_4.4.4          biomaRt_2.38.0             
 [45] SingleCellExperiment_1.4.1  vctrs_0.2.1                
 [47] ROCR_1.0-7                  withr_2.1.2                
 [49] checkmate_1.9.1             sctransform_0.2.1          
 [51] GenomicAlignments_1.18.1    prettyunits_1.0.2          
 [53] mnormt_1.5-5                cluster_2.0.7-1            
 [55] ape_5.3                     lazyeval_0.2.2             
 [57] seqLogo_1.48.0              crayon_1.3.4               
 [59] pkgconfig_2.0.3             slam_0.1-47                
 [61] nlme_3.1-137                ProtGenerics_1.14.0        
 [63] nnet_7.3-12                 rlang_0.4.2                
 [65] globals_0.12.5              lifecycle_0.1.0            
 [67] miniUI_0.1.1.1              sandwich_2.5-1             
 [69] seqinr_3.6-1                rsvd_1.0.2                 
 [71] dichromat_2.0-0             lmtest_0.9-37              
 [73] graph_1.60.0                ggseqlogo_0.1              
 [75] zoo_1.8-6                   base64enc_0.1-3            
 [77] ggridges_0.5.1              pheatmap_1.0.12            
 [79] png_0.1-7                   viridisLite_0.3.0          
 [81] bitops_1.0-6                R.oo_1.23.0                
 [83] KernSmooth_2.23-15          blob_1.1.1                 
 [85] regioneR_1.14.0             readr_1.3.1                
 [87] CNEr_1.18.1                 scales_1.1.0               
 [89] memoise_1.1.0               magrittr_1.5               
 [91] plyr_1.8.4                  ica_1.0-2                  
 [93] gplots_3.0.1.1              bibtex_0.4.2               
 [95] gdata_2.18.0                zlibbioc_1.28.0            
 [97] compiler_3.5.2              HSMMSingleCell_1.2.0       
 [99] lsei_1.2-0                  RColorBrewer_1.1-2         
[101] plotrix_3.7-7               fitdistrplus_1.0-14        
[103] ade4_1.7-13                 Rsamtools_1.34.1           
[105] listenv_0.8.0               pbapply_1.4-2              
[107] formatR_1.7                 htmlTable_1.13.1           
[109] Formula_1.2-3               MASS_7.3-51.1              
[111] tidyselect_0.2.5            stringi_1.4.3              
[113] densityClust_0.3            yaml_2.2.0                 
[115] latticeExtra_0.6-28         ggrepel_0.8.1              
[117] VariantAnnotation_1.28.13   tools_3.5.2                
[119] future.apply_1.3.0          rstudioapi_0.9.0           
[121] TFMPvalue_0.0.8             foreign_0.8-71             
[123] gridExtra_2.3               idr_1.2                    
[125] Rtsne_0.15                  digest_0.6.23              
[127] BiocManager_1.30.10         FNN_1.1.3                  
[129] shiny_1.4.0                 qlcMatrix_0.9.7            
[131] motifmatchr_1.4.0           Rcpp_1.0.3                 
[133] SDMTools_1.1-221.2          later_1.0.0                
[135] RcppAnnoy_0.0.14            OrganismDbi_1.24.0         
[137] httr_1.4.1                  ggbio_1.30.0               
[139] biovizBase_1.30.1           npsurv_0.4-0               
[141] Rdpack_0.11-1               colorspace_1.4-1           
[143] XML_3.98-1.18               reticulate_1.14            
[145] uwot_0.1.5                  RBGL_1.58.2                
[147] sn_1.5-4                    multtest_2.38.0            
[149] plotly_4.9.1                xtable_1.8-4               
[151] futile.options_1.0.1        jsonlite_1.6               
[153] poweRlaw_0.70.2             glasso_1.11                
[155] zeallot_0.1.0               R6_2.4.1                   
[157] TFisher_0.2.0               Hmisc_4.2-0                
[159] pillar_1.4.3                htmltools_0.4.0            
[161] mime_0.8                    DT_0.5                     
[163] glue_1.3.1                  fastmap_1.0.1              
[165] codetools_0.2-16            tsne_0.1-3                 
[167] mvtnorm_1.0-11              lattice_0.20-38            
[169] tibble_2.1.3                numDeriv_2016.8-1.1        
[171] curl_4.3                    leiden_0.3.1               
[173] gtools_3.8.1                GO.db_3.7.0                
[175] survival_2.43-3             limma_3.38.3               
[177] docopt_0.6.1                fastICA_1.2-2              
[179] munsell_0.5.0               GenomeInfoDbData_1.2.0     
[181] reshape2_1.4.3              gtable_0.3.0   

Hannah Pliner

unread,
Jan 13, 2020, 8:00:03 AM1/13/20
to cicero-users
Hi Matt,

This sometimes happens when there are a lot of transcripts in the region so they make the the gene band of the figure very large. A couple of things to try:

- Try making the device size giant just to see if that is likely the problem - i.e. something like png("plot.png", width=10, height=20, units="in")
- Try condensing the transcripts into 1 per gene by using collapseTranscripts="longest" in plot_annotation
- Try plotting a smaller region, or a region with only a few transcripts (again, just to check if this is where the issue is coming from)

Write back if it seems like this is not the issue!

Best,

Hannah
Reply all
Reply to author
Forward
0 new messages