griffithlab / GenVisR

Genome data visualizations
Creative Commons Zero v1.0 Universal
210 stars 62 forks source link

waterfall produce null #319

Open Jumanah-y opened 6 years ago

Jumanah-y commented 6 years ago

Hello,

Amazing work! Thank you for the great effort. I'm trying to use waterfall function to produce the example plot. However, I keep getting null msg: Checking if input is properly formatted... Calculating frequency of mutations... setting mutation hierarchy... NULL

I tried running brcaMAF data and also my custom data but could not get the plot for either. Could you kindly help me with this issue? Thanks a lot

zlskidmore commented 6 years ago

Hi @Jumanah-y, appologies, just saw this. Can you send me the output of sessionInfo()?

Jumanah-y commented 6 years ago

Hello @zlskidmore, Happy holiday! Kindly find below. Thank you so much!

R version 3.4.1 (2017-06-30) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: OS X El Capitan 10.11.6

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.4/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 stats4 stats
[5] graphics grDevices utils datasets [9] methods base

other attached packages: [1] GenVisR_1.6.3 raster_2.6-7
[3] sp_1.2-5 Gviz_1.20.0
[5] GenomicRanges_1.28.6 GenomeInfoDb_1.12.3 [7] IRanges_2.10.5 S4Vectors_0.14.7
[9] BiocGenerics_0.22.1

loaded via a namespace (and not attached): [1] ProtGenerics_1.8.0
[2] bitops_1.0-6
[3] matrixStats_0.52.2
[4] bit64_0.9-7
[5] RColorBrewer_1.1-2
[6] httr_1.3.1
[7] tools_3.4.1
[8] backports_1.1.2
[9] R6_2.2.2
[10] rpart_4.1-11
[11] Hmisc_4.0-3
[12] DBI_0.7
[13] lazyeval_0.2.1
[14] colorspace_1.3-2
[15] nnet_7.3-12
[16] gridExtra_2.3
[17] GGally_1.3.2
[18] curl_3.1
[19] bit_1.1-12
[20] compiler_3.4.1
[21] graph_1.54.0
[22] Biobase_2.36.2
[23] htmlTable_1.11.0
[24] DelayedArray_0.2.7
[25] labeling_0.3
[26] rtracklayer_1.36.6
[27] ggbio_1.24.1
[28] scales_0.5.0
[29] checkmate_1.8.5
[30] RBGL_1.52.0
[31] stringr_1.2.0
[32] digest_0.6.13
[33] Rsamtools_1.28.0
[34] foreign_0.8-69
[35] XVector_0.16.0
[36] base64enc_0.1-3
[37] dichromat_2.0-0
[38] pkgconfig_2.0.1
[39] htmltools_0.3.6
[40] regioneR_1.8.1
[41] ensembldb_2.0.4
[42] BSgenome_1.44.2
[43] htmlwidgets_0.9
[44] rlang_0.1.4
[45] rstudioapi_0.7
[46] RSQLite_2.0
[47] BiocInstaller_1.26.1
[48] shiny_1.0.5
[49] karyoploteR_1.2.2
[50] bindr_0.1
[51] gtools_3.5.0
[52] BiocParallel_1.10.1
[53] acepack_1.4.1
[54] dplyr_0.7.4
[55] VariantAnnotation_1.22.3
[56] RCurl_1.95-4.8
[57] magrittr_1.5
[58] GenomeInfoDbData_0.99.0
[59] Formula_1.2-2
[60] Matrix_1.2-12
[61] Rcpp_0.12.14
[62] munsell_0.4.3
[63] viridis_0.4.0
[64] stringi_1.1.6
[65] yaml_2.1.16
[66] ggalluvial_0.5.0
[67] SummarizedExperiment_1.6.5
[68] zlibbioc_1.22.0
[69] FField_0.1.0
[70] plyr_1.8.4
[71] AnnotationHub_2.8.3
[72] blob_1.1.0
[73] lattice_0.20-35
[74] Biostrings_2.44.2
[75] splines_3.4.1
[76] GenomicFeatures_1.28.5
[77] knitr_1.17
[78] reshape2_1.4.3
[79] biomaRt_2.32.1
[80] XML_3.98-1.9
[81] glue_1.2.0
[82] biovizBase_1.24.0
[83] latticeExtra_0.6-28
[84] data.table_1.10.4-3
[85] httpuv_1.3.5
[86] gtable_0.2.0
[87] purrr_0.2.4
[88] tidyr_0.7.2
[89] reshape_0.8.7
[90] assertthat_0.2.0
[91] ggplot2_2.2.1
[92] mime_0.5
[93] xtable_1.8-2
[94] AnnotationFilter_1.0.0
[95] viridisLite_0.2.0
[96] survival_2.41-3
[97] OrganismDbi_1.18.1
[98] tibble_1.3.4
[99] GenomicAlignments_1.12.2
[100] AnnotationDbi_1.38.2
[101] memoise_1.1.0
[102] bindrcpp_0.2
[103] cluster_2.0.6
[104] interactiveDisplayBase_1.14.0

zlskidmore commented 6 years ago

A while back there was a compatibility issue with the new gridExtra package version and GenVisR. Looking at your versions I suspect this is related to your issue. Try either upgrading GenVisR to the latest version on bioconductor or downgrading gridExtra to an earlier version (either 2.0.0 or maybe 2.2.0). The old package sources are here https://cran.r-project.org/src/contrib/Archive/gridExtra/. Either of these approaches should resolve your issue, but if it doesn't let me know

Jumanah-y commented 6 years ago

Hello @zlskidmore,

Thank you for your response. I tried all of the solutions you suggested and unfortunately still not working. My friend also trying to use the package at her lab and getting the same error.

Thank you for your time and help, Jumanah

zlskidmore commented 6 years ago

hmm, thats odd, can you run these commands and send me the output

waterfall(brcaMAF, mainRecurCutoff = .3, out = "grob")

The above should print out something similar to this

TableGrob (2 x 3) "arrange": 6 grobs z cells name grob 1 1 (1-1,1-1) arrange rect[GRID.rect.1142] 2 2 (1-1,2-2) arrange gtable[layout] 3 3 (1-1,3-3) arrange gtable[guide-box] 4 4 (2-2,1-1) arrange gtable[layout] 5 5 (2-2,2-2) arrange gtable[layout] 6 6 (2-2,3-3) arrange gtable[guide-box]

if it does can you also run

grid::grid.draw(waterfall(brcaMAF, mainRecurCutoff = .3, out = "grob"))

Also are you using Rstudio or just a typical R install?

Jumanah-y commented 6 years ago

Thank you so much! I got the same output for the first command. The second command generated a plot! Thanks a lot.

I use Studio.

zlskidmore commented 6 years ago

That is odd, I wish I knew what was causing this issue. gird.draw is the command thats run underneath so something should have been drawn originally. Can I ask you to try one more thing? Can you try running the following:

pdf(file="path/file.pdf", height=6, width=10)
waterfall(brcaMAF, mainRecurCutoff = .3)
dev.off()

Does the code above produce a waterfall plot on the pdf? I'm trying to determine if there's a problem with GenVisR, the packages loaded, or if it's just the way Rstudio is configured.

Jumanah-y commented 6 years ago

When I used the code above, It does not. The output is: Checking if input is properly formatted... Calculating frequency of mutations... setting mutation hierarchy... Performing recurrence cutoff... NULL

But when I used grid::grid.draw(waterfall(brcaMAF, mainRecurCutoff = .3)) It does produce a waterfall plot on the pdf.

kgoncal commented 6 years ago

Hi zlskidmore,

I've also run into the same problem while running both my data and the data in the tutorial here:

here is the code I run:

`library(GenVisR)

Load relevant data from the manuscript

mutationData <- read.delim("BKM120_Mutation_Data.tsv") clinicalData <- read.delim("BKM120_Clinical.tsv") mutationBurden <- read.delim("BKM120_MutationBurden.tsv")

Reformat the mutation data for waterfall()

mutationData <- mutationData[,c("patient", "gene.name", "trv.type", "amino.acid.change")] colnames(mutationData) <- c("sample", "gene", "variant_class", "amino.acid.change")

Define a mutation hierarchy

mutationHierarchy <- c("nonsense", "frame_shift_del", "frame_shift_ins", "in_frame_del", "splice_site_del", "splice_site", "missense", "splice_region", "rna")

Create an initial plot

waterfall(mutationData, fileType = "Custom", variant_class_order=mutationHierarchy)`

My sessionInfo:

R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

other attached packages: [1] GenVisR_1.8.1

loaded via a namespace (and not attached): [1] SummarizedExperiment_1.8.1 progress_1.1.2 gtools_3.5.0
[4] reshape2_1.4.3 lattice_0.20-35 colorspace_1.3-2
[7] viridisLite_0.3.0 stats4_3.4.1 rtracklayer_1.38.3
[10] yaml_2.1.19 GenomicFeatures_1.30.3 blob_1.1.1
[13] XML_3.98-1.11 rlang_0.2.0 R.oo_1.22.0
[16] pillar_1.2.2 DBI_1.0.0 BiocParallel_1.12.0
[19] BiocGenerics_0.24.0 bit64_0.9-7 matrixStats_0.53.1
[22] GenomeInfoDbData_1.0.0 plyr_1.8.4 stringr_1.3.1
[25] zlibbioc_1.24.0 Biostrings_2.46.0 munsell_0.4.3
[28] gtable_0.2.0 R.methodsS3_1.7.1 memoise_1.1.0
[31] labeling_0.3 Biobase_2.38.0 knitr_1.20
[34] IRanges_2.12.0 biomaRt_2.34.2 GenomeInfoDb_1.14.0
[37] parallel_3.4.1 AnnotationDbi_1.40.0 Rcpp_0.12.17
[40] scales_0.5.0 DelayedArray_0.4.1 S4Vectors_0.16.0
[43] XVector_0.18.0 bit_1.1-13 gridExtra_2.3
[46] Rsamtools_1.30.0 FField_0.1.0 ggplot2_2.2.1
[49] RMySQL_0.10.15 digest_0.6.15 stringi_1.1.7
[52] GenomicRanges_1.30.3 grid_3.4.1 tools_3.4.1
[55] bitops_1.0-6 magrittr_1.5 lazyeval_0.2.1
[58] RCurl_1.95-4.10 tibble_1.4.2 RSQLite_2.1.1
[61] pkgconfig_2.0.1 Matrix_1.2-14 prettyunits_1.0.2
[64] viridis_0.5.1 assertthat_0.2.0 httr_1.3.1
[67] R6_2.2.2 GenomicAlignments_1.14.2 igraph_1.2.1
[70] compiler_3.4.1

zlskidmore commented 6 years ago

Hi @kgoncal

It looks like the GenVisR version you're using is out of date, can you try updating GenVisR and see if it fixes the issue?

RiversPharmD commented 5 years ago

Hi @zlskidmore-

I'm having this same issue. I've attached my session info below. It produces a plot in the plot viewer, which is ok, but does not produce an object when I try to assign it to an object or use it in a Markdown file.

R version 3.6.0 (2019-04-26) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.6 LTS

Matrix products: default BLAS: /usr/lib/libblas/libblas.so.3.6.0 LAPACK: /usr/lib/lapack/liblapack.so.3.6.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] stats graphics grDevices utils datasets methods base

other attached packages: [1] naniar_0.4.2 devtools_2.2.1 usethis_1.5.1 forcats_0.4.0 stringr_1.4.0
[6] dplyr_0.8.3 purrr_0.3.2 readr_1.3.1 tidyr_1.0.0 tibble_2.1.3
[11] ggplot2_3.2.1 tidyverse_1.2.1 GenVisR_1.16.1

loaded via a namespace (and not attached): [1] nlme_3.1-141 bitops_1.0-6 matrixStats_0.55.0
[4] fs_1.3.1 lubridate_1.7.4 bit64_0.9-7
[7] progress_1.2.2 httr_1.4.1 rprojroot_1.3-2
[10] GenomeInfoDb_1.20.0 tools_3.6.0 backports_1.1.5
[13] utf8_1.1.4 R6_2.4.0 DBI_1.0.0
[16] lazyeval_0.2.2 BiocGenerics_0.30.0 colorspace_1.4-1
[19] withr_2.1.2 tidyselect_0.2.5 gridExtra_2.3
[22] prettyunits_1.0.2 processx_3.4.1 bit_1.1-14
[25] compiler_3.6.0 rvest_0.3.4 cli_1.1.0
[28] Biobase_2.44.0 xml2_1.2.2 desc_1.2.0
[31] DelayedArray_0.10.0 labeling_0.3 rtracklayer_1.44.4
[34] scales_1.0.0 callr_3.3.2 digest_0.6.21
[37] Rsamtools_2.0.1 XVector_0.24.0 pkgconfig_2.0.3
[40] sessioninfo_1.1.1 BSgenome_1.52.0 readxl_1.3.1
[43] rlang_0.4.0 rstudioapi_0.10 RSQLite_2.1.2
[46] generics_0.0.2 jsonlite_1.6 BiocParallel_1.18.1
[49] gtools_3.8.1 VariantAnnotation_1.30.1 RCurl_1.95-4.12
[52] magrittr_1.5 GenomeInfoDbData_1.2.1 Matrix_1.2-17
[55] fansi_0.4.0 Rcpp_1.0.2 munsell_0.5.0
[58] S4Vectors_0.22.1 viridis_0.5.1 visdat_0.5.3
[61] lifecycle_0.1.0 stringi_1.4.3 yaml_2.2.0
[64] SummarizedExperiment_1.14.1 zlibbioc_1.30.0 pkgbuild_1.0.5
[67] FField_0.1.0 plyr_1.8.4 grid_3.6.0
[70] blob_1.2.0 parallel_3.6.0 crayon_1.3.4
[73] lattice_0.20-38 haven_2.1.1 Biostrings_2.52.0
[76] GenomicFeatures_1.36.4 hms_0.5.1 knitr_1.25
[79] zeallot_0.1.0 ps_1.3.0 pillar_1.4.2
[82] GenomicRanges_1.36.1 reshape2_1.4.3 biomaRt_2.40.4
[85] stats4_3.6.0 pkgload_1.0.2 XML_3.98-1.20
[88] glue_1.3.1 modelr_0.1.5 data.table_1.12.4
[91] remotes_2.1.0 BiocManager_1.30.4 vctrs_0.2.0
[94] cellranger_1.1.0 testthat_2.2.1 gtable_0.3.0
[97] assertthat_0.2.1 xfun_0.10 broom_0.5.2
[100] viridisLite_0.3.0 GenomicAlignments_1.20.1 AnnotationDbi_1.46.1
[103] memoise_1.1.0 IRanges_2.18.2 ellipsis_0.3.0

zlskidmore commented 5 years ago

@rdsx50 did you try the workaround in this thread:

grid::grid.draw(waterfall(brcaMAF, mainRecurCutoff = .3, out = "grob"))

I'll have to create an R session mimicking what you have to explore further, in the meantime though it will help to know that output is at least being created if not plotted.

RiversPharmD commented 5 years ago

That does it. The sample brcaMAF file runs, and my code produces the grob with the out call. I wonder if it's a RAM issue with the size of the dataset I'm working with. I appreciate your quick reply!

*Update- it's not a RAM issue, I spun it up in digital ocean with 8 of RAM, and it still threw the error.