datapplab / pathview

pathway based data integration and visualization
37 stars 16 forks source link

Errors when using pathview with specific pathways #28

Open nvelden opened 1 year ago

nvelden commented 1 year ago

When I run the following code for the below 2 pathways I get error messages. Any idea what the issue could be?

library(pathview)
pathview::pathview(gene.data = pathview::gse16873.d, pathway.id = "01212", species = "hsa", kegg.native = TRUE)
pathview::pathview(gene.data = pathview::gse16873.d, pathway.id = "00531", species = "hsa", kegg.native = TRUE)

Pathway "01212", I see:

#> Info: some node width is different from others, and hence adjusted!
#> Error in array(col.rgb[, i], dim(node.rgb)[3:1]): the dims contain missing values

And for pathway "00531", I get:

#> Info: some node width is different from others, and hence adjusted!
#> Error in array(col.rgb[, i], dim(node.rgb)[3:1]): negative length vectors are not allowed

The session information during the run was as follows:

sessionInfo()
#> R version 4.2.1 (2022-06-23)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur ... 10.16
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2/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] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] pathview_1.38.0
#> 
#> loaded via a namespace (and not attached):
#>  [1] KEGGREST_1.38.0        styler_1.9.1           xfun_0.39             
#>  [4] purrr_1.0.1            vctrs_0.6.3            htmltools_0.5.5       
#>  [7] stats4_4.2.1           yaml_2.3.7             blob_1.2.4            
#> [10] XML_3.99-0.14          rlang_1.1.1            R.oo_1.25.0           
#> [13] glue_1.6.2             withr_2.5.0            DBI_1.1.3             
#> [16] R.utils_2.12.2         Rgraphviz_2.42.0       BiocGenerics_0.44.0   
#> [19] bit64_4.0.5            GenomeInfoDbData_1.2.9 R.cache_0.16.0        
#> [22] lifecycle_1.0.3        zlibbioc_1.44.0        Biostrings_2.66.0     
#> [25] R.methodsS3_1.8.2      evaluate_0.21          memoise_2.0.1         
#> [28] Biobase_2.58.0         knitr_1.43             IRanges_2.32.0        
#> [31] fastmap_1.1.1          GenomeInfoDb_1.34.9    AnnotationDbi_1.60.2  
#> [34] cachem_1.0.8           org.Hs.eg.db_3.16.0    S4Vectors_0.36.2      
#> [37] graph_1.76.0           XVector_0.38.0         fs_1.6.2              
#> [40] bit_4.0.5              png_0.1-8              digest_0.6.32         
#> [43] grid_4.2.1             cli_3.6.1              tools_4.2.1           
#> [46] bitops_1.0-7           magrittr_2.0.3         RCurl_1.98-1.12       
#> [49] RSQLite_2.3.1          crayon_1.5.2           pkgconfig_2.0.3       
#> [52] KEGGgraph_1.58.3       reprex_2.0.2           rmarkdown_2.23        
#> [55] httr_1.4.6             rstudioapi_0.14        R6_2.5.1              
#> [58] compiler_4.2.1

@farshadf

hosseinvk commented 1 year ago

I have same issue with some other pathways. @nvelden have you got this fixed?

andrewdtu commented 5 months ago

The xml likely has some atypical geometry for those 2 pathway charts, causing the rendering function to fail. One option is to do same.layer = FALSE to circumvent the kegg layer color rendering.