PoisonAlien / maftools

Summarize, Analyze and Visualize MAF files from TCGA or in-house studies.
http://bioconductor.org/packages/release/bioc/html/maftools.html
MIT License
442 stars 218 forks source link

Option to add margin to the right of the oncoplot #763

Closed ashishjain1988 closed 3 years ago

ashishjain1988 commented 3 years ago

I am using oncoplot function to generate the oncoplot for my mutation data. I am also adding a bunch of annotations in the figure. The legends for those annotations are going out of the figure and I tried increasing the gene_mar and barcode_mar options but that is not changing anything in the plot.

maftools::oncoplot(maf = maf.plus.cn,genes = genes,legendFontSize = 2,annotationFontSize = 2,clinicalFeatures = c("PrimaryLocation","Tissue","SampleType"),gene_mar = 10,barcode_mar = 10)

Session info

R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/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     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] RColorBrewer_1.1-2     circlize_0.4.13        ComplexHeatmap_2.6.2   KnowYourTarget_0.1.0   rcellminerData_2.13.1  MAFDash_0.1.0         
 [7] TCGAbiolinks_2.18.0    htmltools_0.5.1.1      knitr_1.33             rmarkdown_2.9          plotly_4.9.4.1         cowplot_1.1.1         
[13] gridExtra_2.3          forcats_0.5.1          purrr_0.3.4            readr_2.0.0            tidyr_1.1.3            tibble_3.1.3          
[19] tidyverse_1.3.1        ExperimentHub_1.16.1   AnnotationHub_2.22.1   BiocFileCache_1.14.0   dbplyr_2.1.1           depmap_1.4.0          
[25] dplyr_1.0.7            rrvgo_1.2.0            WebGestaltR_0.4.4      enrichR_3.0            WGCNA_1.70-3           fastcluster_1.2.3     
[31] dynamicTreeCut_1.63-1  RSQLite_2.2.7          rDGIdb_1.16.0          openxlsx_4.2.4         org.Hs.eg.db_3.12.0    AnnotationDbi_1.52.0  
[37] IRanges_2.24.1         S4Vectors_0.28.1       Biobase_2.50.0         BiocGenerics_0.36.1    clusterProfiler_3.18.1 ReactomePA_1.34.0     
[43] influential_2.2.3      concaveman_1.1.0       ggforce_0.3.3          randomcoloR_1.1.0.1    ggnewscale_0.4.5       ggnetwork_0.5.10      
[49] igraph_1.2.6           STRINGdb_2.2.2         plyr_1.8.6             stringr_1.4.0          ggplot2_3.3.5          maftools_2.6.05       

loaded via a namespace (and not attached):
  [1] graphlayouts_0.7.1            pbapply_1.4-3                 lattice_0.20-44               haven_2.4.3                   tcltk_4.0.3                  
  [6] vctrs_0.3.8                   graphite_1.36.0               V8_3.4.2                      usethis_2.0.1                 mgcv_1.8-36                  
 [11] blob_1.2.2                    survival_3.2-11               spatstat.data_2.1-0           later_1.2.0                   nloptr_1.2.2.2               
 [16] DBI_1.1.1                     R.utils_2.10.1                uwot_0.1.10                   rappdirs_0.3.3                gsubfn_0.7                   
 [21] jpeg_0.1-9                    zlibbioc_1.36.0               htmlwidgets_1.5.3             GlobalOptions_0.1.2           future_1.21.0                
 [26] leiden_0.3.9                  irlba_2.3.3                   tidygraph_1.2.0               Rcpp_1.0.7                    KernSmooth_2.23-20           
 [31] DT_0.18                       promises_1.2.0.1              DelayedArray_0.16.3           limma_3.46.0                  pkgload_1.2.1                
 [36] graph_1.68.0                  Hmisc_4.5-0                   apcluster_1.4.8               fs_1.5.0                      assertive.types_0.0-3        
 [41] textshaping_0.3.5             fastmatch_1.1-3               digest_0.6.27                 png_0.1-7                     sctransform_0.3.2            
 [46] scatterpie_0.1.6              DOSE_3.16.0                   i2dash_0.2.3                  ggraph_2.0.5                  pkgconfig_2.0.3              
 [51] GO.db_3.12.1                  gridBase_0.4-7                nnls_1.4                      ggbeeswarm_0.6.0              iterators_1.0.13             
 [56] minqa_1.2.4                   reticulate_1.20               SummarizedExperiment_1.20.0   beeswarm_0.4.0                GetoptLong_1.0.5             
 [61] xfun_0.24                     wordcloud_2.6                 bslib_0.2.5.1                 zoo_1.8-9                     tidyselect_1.1.1             
 [66] reshape2_1.4.4                ica_1.0-2                     viridisLite_0.4.0             pkgbuild_1.2.0                rlang_0.4.11                 
 [71] jquerylib_0.1.4               glue_1.4.2                    modelr_0.1.8                  matrixStats_0.60.0            flexdashboard_0.5.2          
 [76] MatrixGenerics_1.2.1          labeling_0.4.2                httpuv_1.6.1                  preprocessCore_1.52.1         assertive.base_0.0-9         
 [81] reactome.db_1.74.0            DO.db_2.9                     annotate_1.68.0               jsonlite_1.7.2                XVector_0.30.0               
 [86] bit_4.0.4                     mime_0.11                     systemfonts_1.0.2             gplots_3.1.1                  assertive.properties_0.0-4   
 [91] stringi_1.7.3                 processx_3.5.2                spatstat.sparse_2.0-0         TCGAbiolinksGUI.data_1.10.0   scattermore_0.7              
 [96] bitops_1.0-7                  cli_3.0.1                     ymlthis_0.1.4                 sqldf_0.4-11                  pheatmap_1.0.12              
[101] rcellminer_2.12.1             data.table_1.14.0             rstudioapi_0.13               assertive.sets_0.0-3          nlme_3.1-152                 
[106] qvalue_2.22.0                 locfit_1.5-9.4                listenv_0.8.0                 miniUI_0.1.1.1                R.oo_1.24.0                  
[111] canvasXpress_1.35.0           sessioninfo_1.1.1             readxl_1.3.1                  lifecycle_1.0.0               munsell_0.5.0                
[116] cellranger_1.1.0              R.methodsS3_1.8.1             caTools_1.18.2                codetools_0.2-18              GenomeInfoDb_1.26.7          
[121] vipor_0.4.5                   lmtest_0.9-38                 htmlTable_2.2.1               proto_1.0.0                   xtable_1.8-4                 
[126] ROCR_1.0-11                   BiocManager_1.30.16           abind_1.4-5                   farver_2.1.0                  FNN_1.1.3                    
[131] parallelly_1.27.0             RANN_2.6.1                    askpass_1.1                   SeuratObject_4.0.2            GenomicRanges_1.42.0         
[136] goftest_1.2-2                 RcppAnnoy_0.0.19              patchwork_1.1.1               cluster_2.1.2                 future.apply_1.7.0           
[141] Seurat_4.0.3                  Matrix_1.3-4                  ellipsis_0.3.2                prettyunits_1.1.1             lubridate_1.7.10             
[146] ggridges_0.5.3                reprex_2.0.1                  fgsea_1.16.0                  remotes_2.4.0                 NLP_0.2-1                    
[151] slam_0.1-48                   testthat_3.0.4                spatstat.utils_2.2-0          yaml_2.2.1                    hash_2.2.6.1                 
[156] utf8_1.2.2                    interactiveDisplayBase_1.28.0 XML_3.99-0.6                  foreign_0.8-81                withr_2.4.2                  
[161] fitdistrplus_1.1-5            BiocParallel_1.24.1           bit64_4.0.5                   rngtools_1.5                  doRNG_1.8.2                  
[166] foreach_1.5.1                 spatstat.core_2.3-0           GOSemSim_2.16.1               ragg_1.1.3                    devtools_2.4.2               
[171] memoise_2.0.0                 evaluate_0.14                 tzdb_0.1.2                    callr_3.7.0                   ps_1.6.0                     
[176] curl_4.3.2                    fansi_0.5.0                   GSEABase_1.52.1               edgeR_3.32.1                  tensor_1.5                   
[181] checkmate_2.0.0               cachem_1.0.5                  desc_1.3.0                    deldir_0.2-10                 impute_1.64.0                
[186] rjson_0.2.20                  ggrepel_0.9.1                 clue_0.3-59                   rprojroot_2.0.2               tools_4.0.3                  
[191] sass_0.4.0                    magrittr_2.0.1                RCurl_1.98-1.3                xml2_1.3.2                    httr_1.4.2                   
[196] assertthat_0.2.1              boot_1.3-28                   globals_0.14.0                R6_2.5.0                      nnet_7.3-16                  
[201] progress_1.2.2                gtools_3.9.2                  shape_1.4.6                   BiocVersion_3.12.0            splines_4.0.3                
[206] colorspace_2.0-2              generics_0.1.0                base64enc_0.1-3               chron_2.3-56                  pillar_1.6.2                 
[211] treemap_2.4-2                 tweenr_1.0.2                  rvcheck_0.1.8                 GenomeInfoDbData_1.2.4        gtable_0.3.0                 
[216] rvest_1.0.1                   zip_2.2.0                     latticeExtra_0.6-29           shadowtext_0.0.8              biomaRt_2.46.3               
[221] fastmap_1.1.0                 crosstalk_1.1.1.9000          Cairo_1.5-12.2                doParallel_1.0.16             ensurer_1.1                  
[226] tm_0.7-8                      broom_0.7.9                   openssl_1.4.4                 scales_1.1.1                  backports_1.2.1              
[231] plotrix_3.8-1                 vroom_1.5.3                   lme4_1.1-27.1                 enrichplot_1.10.2             hms_1.1.0                    
[236] Rtsne_0.15                    shiny_1.6.0                   polyclip_1.10-0               lazyeval_0.2.2                bsplus_0.1.2                 
[241] Formula_1.2-4                 whisker_0.4                   crayon_1.4.1                  MASS_7.3-54                   downloader_0.4               
[246] viridis_0.6.1                 svglite_2.0.0                 rpart_4.1-15                  spatstat.geom_2.2-2           compiler_4.0.3

image

PoisonAlien commented 3 years ago

Hi,

Unfortunately this is a known issue :| Try increasing the anno_height. Also make sure to save the image to pdf with enough height and width - its seems to help in my case.

awast commented 1 year ago

Hi sir, I am also facing the same issue in case of gisticOncoPlot. Can you please sugggest how can i increase the right margin?