mglev1n / locusplotr

Create Regional Association Plots
https://mglev1n.github.io/locusplotr
Other
10 stars 0 forks source link

Questions about plotting gene in gg_locusplot #5

Closed JiaruiMi01 closed 5 months ago

JiaruiMi01 commented 5 months ago

Hi,

Thank you for writing such a nice package.

I have a question regarding the plotting the genes in gg_locusplot function.

When I run the code with "plot_genes = FALSE", it is perfectly fine. gg_locusplot( df = fto_locus_df, lead_snp = "rs62033413", rsid = rsid, chrom = chromosome, pos = position, ref = effect_allele, alt = other_allele, p_value = p_value, plot_genes = FALSE )

However, when I switch to plot_genes = TRUE, I always got an error message: Extracting LD for 16:53830055_C/G for the region 16:53580059-54079197 Extracting genes for the region 16:53580055-54080055 Found more than one class "simpleUnit" in cache; using the first, from namespace 'ggbio' Also defined by 'hexbin' Found more than one class "simpleUnit" in cache; using the first, from namespace 'ggbio' Also defined by 'hexbin' Error in Ops.data.frame(guide_loc, panel_loc) : '==' only defined for equally-sized data frames

Haven't figured out the way to solve this issue after I checked the source code.

The session info is as follows. sessionInfo() R version 4.2.2 Patched (2022-11-10 r83330) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 20.04.5 LTS

Matrix products: default BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0 LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

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] stats4 stats graphics grDevices utils datasets methods base

other attached packages: [1] SNPassoc_2.1-0 data.table_1.15.4 xQTLbiolinks_1.7.3
[4] moloc_0.1.0 ieugwasr_0.1.5 R453Plus1Toolbox_1.54.0
[7] pwalign_1.0.0 biovizBase_1.46.0 ggbio_1.46.0
[10] ensembldb_2.22.0 AnnotationFilter_1.22.0 GenomicAlignments_1.34.1
[13] VariantAnnotation_1.44.1 Rsamtools_2.14.0 BSgenome_1.72.0
[16] rtracklayer_1.58.0 BiocIO_1.8.0 KEGGREST_1.44.0
[19] Biostrings_2.72.1 SummarizedExperiment_1.28.0 MatrixGenerics_1.10.0
[22] matrixStats_1.3.0 XVector_0.38.0 GenomicFeatures_1.50.2
[25] AnnotationDbi_1.60.0 Biobase_2.58.0 GenomicRanges_1.50.2
[28] GenomeInfoDb_1.34.9 IRanges_2.32.0 S4Vectors_0.36.2
[31] BiocGenerics_0.44.0 lubridate_1.9.3 forcats_1.0.0
[34] stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2
[37] readr_2.1.5 tidyr_1.3.1 tibble_3.2.1
[40] ggplot2_3.5.1 tidyverse_2.0.0 locusplotr_0.2.0

loaded via a namespace (and not attached): [1] bigstatsr_1.5.12 Hmisc_5.1-0 ps_1.7.6
[4] class_7.3-20 foreach_1.5.2 echotabix_0.99.10
[7] crayon_1.5.2 rbibutils_2.2.16 MASS_7.3-58.1
[10] nlme_3.1-160 backports_1.5.0 metafor_4.6-0
[13] basilisk_1.10.2 flock_0.7 rlang_1.1.3
[16] SparseM_1.81 irlba_2.3.5.1 callr_3.7.3
[19] nloptr_2.0.3 filelock_1.0.3 BiocParallel_1.32.6
[22] rjson_0.2.21 bit64_4.0.5 glue_1.7.0
[25] mixsqp_0.3-48 rngtools_1.5.2 processx_3.8.0
[28] parallel_4.2.2 R2HTML_2.3.3 tidyselect_1.2.0
[31] coloc_5.2.3 XML_3.99-0.16.1 zoo_1.8-12
[34] catalogueR_1.0.1 echoplot_0.99.7 MatrixModels_0.5-3
[37] xtable_1.8-4 ggnetwork_0.5.12 magrittr_2.0.3
[40] evaluate_0.23 Rdpack_2.4 cli_3.6.2
[43] zlibbioc_1.44.0 hwriter_1.3.2.1 rstudioapi_0.16.0
[46] doRNG_1.8.6 rpart_4.1.19 mathjaxr_1.6-0
[49] echoannot_0.99.11 maps_3.4.2 runonce_0.2.3
[52] xfun_0.44 arsenal_3.6.3 cluster_2.1.4
[55] echoconda_0.99.9 ggtext_0.1.2 quantreg_5.94
[58] expm_0.999-9 ggrepel_0.9.2 ape_5.8
[61] listenv_0.9.1 echodata_0.99.17 png_0.1-8
[64] reshape_0.8.9 future_1.33.2 withr_3.0.0
[67] bitops_1.0-7 RBGL_1.74.0 plyr_1.8.8
[70] gap.datasets_0.0.6 e1071_1.7-14 pillar_1.9.0
[73] TeachingDemos_2.13 cachem_1.1.0 multcomp_1.4-20
[76] fs_1.6.4 googleAuthR_2.0.0 echoLD_0.99.9
[79] osfr_0.2.9 snpStats_1.48.0 vctrs_0.6.4
[82] ellipsis_0.3.2 generics_0.1.3 RMySQL_0.10.27
[85] bigsnpr_1.12.2 poisbinom_1.0.1 tools_4.2.2
[88] foreign_0.8-83 munsell_0.5.1 susieR_0.12.40
[91] echolocatoR_2.0.3 proxy_0.4-27 DelayedArray_0.24.0
[94] fastmap_1.2.0 compiler_4.2.2 DescTools_0.99.41
[97] GenomeInfoDbData_1.2.9 gridExtra_2.3 rms_6.7-0
[100] lattice_0.20-45 dir.expiry_1.6.0 ggnewscale_0.4.8
[103] deldir_2.0-4 utf8_1.2.4 BiocFileCache_2.6.0
[106] jsonlite_1.8.8 GGally_2.1.2 scales_1.3.0
[109] gld_2.6.6 graph_1.76.0 lazyeval_0.2.2
[112] doParallel_1.0.17 RCircos_1.2.2 latticeExtra_0.6-30
[115] R.utils_2.12.2 reticulate_1.35.0 checkmate_2.3.1
[118] sandwich_3.0-2 rmarkdown_2.18 openxlsx_4.2.5.2
[121] cowplot_1.1.1 dichromat_2.0-0.1 igraph_1.3.5
[124] survival_3.6-4 numDeriv_2016.8-1.1 yaml_2.3.8
[127] htmltools_0.5.8.1 memoise_2.0.1 supraHex_1.36.0
[130] viridisLite_0.4.2 digest_0.6.35 assertthat_0.2.1
[133] commonmark_1.9.1 piggyback_0.1.5 rappdirs_0.3.3
[136] bigsparser_0.6.1 dnet_1.1.7 downloadR_0.99.6
[139] pals_1.8 RSQLite_2.2.18 future.apply_1.10.0
[142] mapproj_1.2.11 Exact_3.2 blob_1.2.3
[145] R.oo_1.26.0 labeling_0.4.3 splines_4.2.2
[148] Formula_1.2-5 OrganismDbi_1.40.0 ProtGenerics_1.30.0
[151] gridtext_0.1.5 RCurl_1.98-1.14 hms_1.1.2
[154] colorspace_2.1-0 base64enc_0.1-3 BiocManager_1.30.23
[157] echofinemap_0.99.5 nnet_7.3-18 Rcpp_1.0.12
[160] mvtnorm_1.2-5 fansi_1.0.6 tzdb_0.3.0
[163] parallelly_1.37.1 R6_2.5.1 grid_4.2.2
[166] crul_1.4.2 polspline_1.1.25 lifecycle_1.0.4
[169] meta_6.0-0 ShortRead_1.56.1 rootSolve_1.8.2.4
[172] zip_2.3.1 metadat_1.2-0 MungeSumstats_1.6.0
[175] curl_5.2.1 minqa_1.2.7 XGR_1.1.9
[178] gap_1.5-3 Matrix_1.6-1.1 TH.data_1.1-1
[181] RColorBrewer_1.1-3 iterators_1.0.14 htmlwidgets_1.6.2
[184] markdown_1.12 biomaRt_2.54.0 timechange_0.1.1
[187] globals_0.16.3 lmom_3.0 htmlTable_2.4.1
[190] patchwork_1.1.2 codetools_0.2-18 prettyunits_1.2.0
[193] dbplyr_2.3.4 basilisk.utils_1.10.0 R.methodsS3_1.8.2
[196] gtable_0.3.1 DBI_1.2.2 httr_1.4.4
[199] haplo.stats_1.9.5.1 stringi_1.8.4 progress_1.2.2
[202] farver_2.1.2 reshape2_1.4.4 viridis_0.6.2
[205] hexbin_1.28.3 Rgraphviz_2.42.0 DT_0.26
[208] xml2_1.3.3 boot_1.3-28 lme4_1.1-31
[211] restfulr_0.0.15 interp_1.1-3 bigparallelr_0.3.2
[214] CompQuadForm_1.4.3 bit_4.0.5 jpeg_0.1-10
[217] pkgconfig_2.0.3 gargle_1.2.1 bigassertr_0.1.6
[220] knitr_1.41 bigreadr_0.2.5 httpcode_0.3.0

Thanks!

all the best, Jiarui

mglev1n commented 5 months ago

This seems related to https://github.com/tidyverse/ggplot2/issues/5612 - I was able to replicate the error using an older version of patchwork (1.1.2), which looks like the version you have currently installed. I was able to resolve the error by upgrading to the latest version of patchwork (version 1.2.0) available on CRAN.

JiaruiMi01 commented 5 months ago

Correct, the issue has been solved. Thanks!