From 6d9b8bd4d08d55a7b24ee64fa1d9394c11d06100 Mon Sep 17 00:00:00 2001 From: PoisonAlien Date: Wed, 23 Oct 2019 19:35:00 +0200 Subject: [PATCH] update NEWS, vignette --- .gitignore | 1 + DESCRIPTION | 2 +- R/dashboard.R | 2 +- R/forestPlot.R | 2 +- R/gisticOncoPlot.R | 4 ++-- R/lollipopPlot.R | 2 +- R/lollipopPlot2.R | 2 +- R/plotApobecDiff.R | 2 +- R/plotClusters.R | 2 +- R/plotMafSummary.R | 2 +- R/plotSignatures.R | 4 ++-- R/plotTiTv.R | 4 ++-- R/plot_vaf.R | 2 +- R/rainfallPlot.R | 2 +- inst/NEWS | 17 ++++++++++------- man/plotVaf.Rd | 2 +- vignettes/maftools.Rmd | 14 +++----------- 17 files changed, 31 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index e2f9424..cf312d6 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ unsrturl.bst .settings .tm_properties .cloud +.icloud diff --git a/DESCRIPTION b/DESCRIPTION index bd535d8..7524ae3 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: maftools Type: Package Title: Summarize, Analyze and Visualize MAF Files -Version: 2.1.31 +Version: 2.1.32 Date: 2015-12-14 Authors@R: person(given = "Anand", diff --git a/R/dashboard.R b/R/dashboard.R index ff44592..fcf5f60 100644 --- a/R/dashboard.R +++ b/R/dashboard.R @@ -19,7 +19,7 @@ dashboard = function(maf, color = NULL, rmOutlier = TRUE, log_conv = FALSE, titv vcs = t(vcs) lo = matrix(data = 1:6, nrow = 2, byrow = TRUE) - layout(mat = lo, heights = c(3.5, 3), widths = c(3, 2, 2)) + graphics::layout(mat = lo, heights = c(3.5, 3), widths = c(3, 2, 2)) par(cex.axis = fontSize, font = 3, cex.main = titleSize[1], lwd = 1.2) #--------------------------- variant classification plot ----------------- diff --git a/R/forestPlot.R b/R/forestPlot.R index 3714a5a..018a47e 100644 --- a/R/forestPlot.R +++ b/R/forestPlot.R @@ -80,7 +80,7 @@ forestPlot = function(mafCompareRes, pVal = 0.05, fdr = NULL, color = NULL, names(color) = c(m1Name, m2Name) } - layout(mat = matrix(c(1, 2, 3, 4, 5, 5, 5, 5), byrow = TRUE, ncol = 4, nrow = 2), widths = c(4, 1, 1), heights = c(6, 1.2)) + graphics::layout(mat = matrix(c(1, 2, 3, 4, 5, 5, 5, 5), byrow = TRUE, ncol = 4, nrow = 2), widths = c(4, 1, 1), heights = c(6, 1.2)) par(mar = c(3, 1, 3, 5)) plot(rep(0, nrow(m.sigs)), 1:nrow(m.sigs), xlim = c(-lim, lim), axes = FALSE, pch = NA, xlab = "", ylab = "", ylim = c(0.5, nrow(m.sigs))) segments(x0 = m.sigs$log10OR_low, y0 = 1:nrow(m.sigs), x1 = m.sigs$log10OR_high, y1 = 1:nrow(m.sigs), lwd = lineWidth, color[m.sigs$flow]) diff --git a/R/gisticOncoPlot.R b/R/gisticOncoPlot.R index fbdb377..1826709 100644 --- a/R/gisticOncoPlot.R +++ b/R/gisticOncoPlot.R @@ -118,10 +118,10 @@ gisticOncoPlot = function(gistic = NULL, top = NULL, #Plot layout if(is.null(clinicalFeatures)){ mat_lo = matrix(data = c(1,2), nrow = 2, ncol = 1, byrow = TRUE) - lo = layout(mat = mat_lo, heights = c(12, 2)) + lo = graphics::layout(mat = mat_lo, heights = c(12, 2)) }else{ mat_lo = matrix(data = c(1,2,3), nrow = 3, ncol = 1, byrow = TRUE) - lo = layout(mat = mat_lo, heights = c(12, 1, 4)) + lo = graphics::layout(mat = mat_lo, heights = c(12, 1, 4)) } if(is.null(clinicalFeatures)){ diff --git a/R/lollipopPlot.R b/R/lollipopPlot.R index 15c06dc..60d6163 100644 --- a/R/lollipopPlot.R +++ b/R/lollipopPlot.R @@ -278,7 +278,7 @@ lollipopPlot = function(maf, gene = NULL, AACol = NULL, labelPos = NULL, labPosS col = col[unique(as.character(prot.snp.sumamry[,Variant_Classification]))] lo = matrix(data = c(1, 1, 2, 2), nrow = 2, byrow = TRUE) - layout(mat = lo, heights = c(4, 1.25)) + graphics::layout(mat = lo, heights = c(4, 1.25)) par(mar = c(1, 2.5, 2, 1)) plot(0, 0, pch = NA, ylim = c(0, 6.5), xlim = c(0, len), axes = FALSE, xlab = NA, ylab = NA) diff --git a/R/lollipopPlot2.R b/R/lollipopPlot2.R index 22ffcdf..10831ce 100644 --- a/R/lollipopPlot2.R +++ b/R/lollipopPlot2.R @@ -65,7 +65,7 @@ lollipopPlot2 = function(m1, m2, gene = NULL, AACol1 = NULL, AACol2 = NULL, m1_n col2 = col[as.character(m2.lp[[1]][,Variant_Classification])] lo = matrix(data = c(1, 1, 2, 2), nrow = 2, byrow = TRUE) - layout(mat = lo, heights = c(4, 1.25)) + graphics::layout(mat = lo, heights = c(4, 1.25)) par(mar = c(2, 2.5, 2, 1)) plot(0, 0, xlim = c(0, max(m1.lp[[2]], na.rm = TRUE)+10), ylim = c(-6.5, 6.5), axes = FALSE, pch = NA, xlab = "", ylab = "") diff --git a/R/plotApobecDiff.R b/R/plotApobecDiff.R index 900f27a..414ab50 100644 --- a/R/plotApobecDiff.R +++ b/R/plotApobecDiff.R @@ -78,7 +78,7 @@ plotApobecDiff = function(tnm, maf, pVal = 0.05, title_size = 1, axis_lwd = 1, f pieCol = c("#084594", "#9ECAE1") - layout(matrix(c(1,2,3,1,4,4), 2, 3, byrow = TRUE), widths=c(2, 2, 2)) + graphics::layout(matrix(c(1,2,3,1,4,4), 2, 3, byrow = TRUE), widths=c(2, 2, 2)) par(bty="n", mgp = c(0.5,0.5,0), mar = c(2,3.5,4,0) + 0.1, las=1, tcl=-.25, font.main=4, xpd=NA) yp = as.integer(pretty(log10(sub.tbl[,n_mutations]))) diff --git a/R/plotClusters.R b/R/plotClusters.R index 1194a4f..d0df65b 100644 --- a/R/plotClusters.R +++ b/R/plotClusters.R @@ -50,7 +50,7 @@ plotClusters = function(clusters, tsb = NULL, genes = NULL, showCNvars = FALSE, tsb_nclust = as.numeric(unique(tsb.dat[!cluster %in% c("outlier", "CN_altered"),cluster])) lo_mat = matrix(c(tsb_nclust, max(tsb_nclust)+1) , ncol = 1) #return(lo_mat) - layout(mat = lo_mat, heights = c(rep(0.5, length(tsb_nclust)), 4)) + graphics::layout(mat = lo_mat, heights = c(rep(0.5, length(tsb_nclust)), 4)) tsb.dat.spl = split(tsb.dat, as.factor(as.character(tsb.dat$cluster))) for(cl in seq_along(tsb_nclust)){ diff --git a/R/plotMafSummary.R b/R/plotMafSummary.R index e95362d..7389c07 100644 --- a/R/plotMafSummary.R +++ b/R/plotMafSummary.R @@ -70,7 +70,7 @@ plotmafSummary = function(maf, rmOutlier = TRUE, dashboard = TRUE, titvRaw = TRU #--------------------------- variant per sample plot ----------------- - layout(mat = matrix(c(1, 1, 2, 2, 3, 3), nrow = 3, byrow = TRUE), heights = c(4, 4, 3)) + graphics::layout(mat = matrix(c(1, 1, 2, 2, 3, 3), nrow = 3, byrow = TRUE), heights = c(4, 4, 3)) if(showBarcodes){ par(mar = c(7, 2, 3, 1)) b = barplot(vcs, col = col[rownames(vcs)], border = NA, axes = FALSE, names.arg = rep("", ncol(vcs))) diff --git a/R/plotSignatures.R b/R/plotSignatures.R index 772c2f6..d0f41a1 100644 --- a/R/plotSignatures.R +++ b/R/plotSignatures.R @@ -40,7 +40,7 @@ plotSignatures = function(nmfRes = NULL, contributions = FALSE, color = NULL, pa cols = RColorBrewer::brewer.pal(n = 8, name = 'Set2') if(show_barcodes){ - lo = layout(mat = matrix(data = c(1, 2), nrow = 2), heights = c(6, 2)) + lo = graphics::layout(mat = matrix(data = c(1, 2), nrow = 2), heights = c(6, 2)) par(mar = c(6, 4, 2, 1)) b = barplot(contrib, axes = FALSE, horiz = FALSE, col = cols, border = NA, names.arg = rep("", ncol(contrib))) axis(side = 1, at = b, labels = colnames(contrib), lwd = 2, cex.axis = font_size, @@ -53,7 +53,7 @@ plotSignatures = function(nmfRes = NULL, contributions = FALSE, color = NULL, pa border = NA, bty = "n", pch = 15, xpd = TRUE, ncol = 1, cex = 1.2, pt.cex = 1.5, horiz = TRUE) }else{ - lo = layout(mat = matrix(data = c(1, 2), nrow = 2), heights = c(6, 2)) + lo = graphics::layout(mat = matrix(data = c(1, 2), nrow = 2), heights = c(6, 2)) par(mar = c(3, 4, 2, 1)) b = barplot(contrib, axes = FALSE, horiz = FALSE, col = cols, border = NA, names.arg = rep("", ncol(contrib))) axis(side = 2, at = seq(0, 1, 0.25), lwd = 3, font = 1, las = 2, cex.axis = 0.9) diff --git a/R/plotTiTv.R b/R/plotTiTv.R index 70119d9..3dfee27 100644 --- a/R/plotTiTv.R +++ b/R/plotTiTv.R @@ -90,7 +90,7 @@ plotTiTv = function(res = NULL, plotType = 'both', sampleOrder = NULL, add_legend(x = "topright", legend = names(col), col = col, bty = "n", pch = 15, y.intersp = 0.7, text.font = 1) } else if(plotType == 'box'){ - layout(matrix(data = c(1, 2), nrow = 1), widths = c(4, 2)) + graphics::layout(matrix(data = c(1, 2), nrow = 1), widths = c(4, 2)) par(mar = c(2, 4, 2, 2)) b = boxplot(value ~ variable, data = titv.frac.melt, axes = FALSE, xlab = "", ylab = "", col = col[levels(titv.frac.melt[,variable])], names=NA, lty = 1, staplewex = 0, pch = 16, xaxt="n", notch = plotNotch, @@ -109,7 +109,7 @@ plotTiTv = function(res = NULL, plotType = 'both', sampleOrder = NULL, } else if(plotType == 'both'){ - layout(mat = matrix(data = c(1, 2, 3, 3), byrow = TRUE, nrow = 2), widths = c(4, 2), heights = c(5, 4)) + graphics::layout(mat = matrix(data = c(1, 2, 3, 3), byrow = TRUE, nrow = 2), widths = c(4, 2), heights = c(5, 4)) par(mar = c(2, 4, 2, 1)) plot(NA, axes = FALSE, xlim = c(0.25, 6.25), ylim = c(0, 100), xlab = NA, ylab = NA) abline(h = seq(0, 100, 25), v = 1:6, col = grDevices::adjustcolor(col = "gray70", alpha.f = 0.5), lty = 2, lwd = 0.6) diff --git a/R/plot_vaf.R b/R/plot_vaf.R index 8105619..e08c4d7 100644 --- a/R/plot_vaf.R +++ b/R/plot_vaf.R @@ -1,5 +1,5 @@ #' Plots vaf distribution of genes -#' @description Plots vaf distribution of genes as a boxplot. +#' @description Plots vaf distribution of genes as a boxplot. Each dot in the jitter is a variant. #' #' @param maf an \code{\link{MAF}} object generated by \code{\link{read.maf}} #' @param vafCol manually specify column name for vafs. Default looks for column 't_vaf' diff --git a/R/rainfallPlot.R b/R/rainfallPlot.R index 0ecbbd1..c0d619f 100644 --- a/R/rainfallPlot.R +++ b/R/rainfallPlot.R @@ -79,7 +79,7 @@ rainfallPlot = function(maf, tsb = NULL, detectChangePoints = FALSE, ylims = round(seq(min(summary(maf.snp[,diff]), na.rm = TRUE), max(summary(maf.snp[,diff]), na.rm = TRUE), length.out = 4), 2) - layout(mat = matrix(data = c(1, 2), nrow = 2, byrow = T), heights= c(4, 1)) + graphics::layout(mat = matrix(data = c(1, 2), nrow = 2, byrow = T), heights= c(4, 1)) par(mar = c(1, 4, 2, 0)) plot(NA, NA, axes = FALSE, xlab = NA, ylab = NA, diff --git a/inst/NEWS b/inst/NEWS index 85c7238..dc9ca90 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -1,7 +1,11 @@ CHANGES IN VERSION 2.2.0 ------------------------- NEW FUNCTIONS - o survGroup - Predict genes/genesets associated with survival. Issue: #396 + o `survGroup`, `mafSurvGroup` - Predict genes/genesets associated with survival. Issue: #396 + +DEPRECATED + o `oncotate` - Oncotator is no longer supported by Broad. Issue: #403 #384 #381 + o `findPathways` argument in `somaticInteractions` function has been deprecated SIGNIFICANT USER-LEVEL IMPROVEMENT o Signature analysis has been modified to be more flexible. It now consits of three functions namely: @@ -9,12 +13,11 @@ SIGNIFICANT USER-LEVEL IMPROVEMENT o `plotCophenetic` - which draws an elbow plot of cophenetic correlation metric from `estimateSignatures` and helps to decide an optimal number of signature `(n)`. o `extractSignatures` - which then extracts final `n` signatures o `compareSignatures` now has two databases of known signatures. Classic 30 signatures and newer 67 SBS signatures from COSMIC. - o `findPathways` argument in `somaticInteractions` function has been deprecated BUG FIX - o gisticChromPlot bug fix. Issue: #392 - o annovarToMaf bug fix for results without exonic variants. Issue: #388 - o Avoid conflict with plotly::layout with graphcis::layout. Issue: #387 + o `gisticChromPlot` bug fix. Issue: #392 + o `annovarToMaf` bug fix for results without exonic variants. Issue: #388 + o Avoid conflict with `plotly::layout` with `graphcis::layout`. Issue: #387 #202 o Fix side-bar heights in Oncoplot with copy-number data. Issue: #383 - o Update y-axis label for tcgaCompare plot. Issue: #366 - o annovarToMaf annotating variants with MNPs. Issue: #335 + o Update y-axis label for `tcgaCompare` plot. Issue: #366 + o `annovarToMaf` annotating variants with MNPs. Issue: #335 diff --git a/man/plotVaf.Rd b/man/plotVaf.Rd index 9d7d929..5eebbda 100644 --- a/man/plotVaf.Rd +++ b/man/plotVaf.Rd @@ -40,7 +40,7 @@ plotVaf(maf, vafCol = NULL, genes = NULL, top = 10, Nothing. } \description{ -Plots vaf distribution of genes as a boxplot. +Plots vaf distribution of genes as a boxplot. Each dot in the jitter is a variant. } \examples{ laml.maf <- system.file("extdata", "tcga_laml.maf.gz", package = "maftools") diff --git a/vignettes/maftools.Rmd b/vignettes/maftools.Rmd index fc2a13e..6151c77 100644 --- a/vignettes/maftools.Rmd +++ b/vignettes/maftools.Rmd @@ -247,13 +247,6 @@ Many disease causing genes in cancer are co-occurring or show strong exclusivene somaticInteractions(maf = laml, top = 25, pvalue = c(0.05, 0.1)) ``` -We can visualize the above results using `oncostrip`. For example, in above analysis, gene set TP53, FLT3 and RUNX1 show a strong exclusiveness with each other a p-value of 4.8e-5. - -```{r, fig.height=2.3,fig.width=8,fig.align='center'} -oncostrip(maf = laml, genes = c('TP53', 'FLT3', 'RUNX1')) -``` - - ## Detecting cancer driver genes based on positional clustering maftools has a function `oncodrive` which identifies cancer genes (driver) from a given MAF. `oncodrive` is a based on algorithm [oncodriveCLUST](http://bg.upf.edu/group/projects/oncodrive-clust.php) which was originally implemented in Python. Concept is based on the fact that most of the variants in cancer causing genes are enriched at few specific loci (aka hot-spots). This method takes advantage of such positions to identify cancer genes. If you use this function, please cite [OncodriveCLUST article](http://bioinformatics.oxfordjournals.org/content/early/2013/07/31/bioinformatics.btt395.full) [7](#references). @@ -505,7 +498,7 @@ arrows(x0 = 5, y0 = 4, x1 = 5, y1 = 1, length = 0.1, lwd = 2) text(x = 5, y = 0, labels = "plotSignatures()", font = 3) ``` -Note: In previous versions, `extractSignatures` used to take care of above steps automatically. After versions 2.2.0, main function is split inot above 5 stpes for user flexibility. +***Note:*** In previous versions, `extractSignatures` used to take care of above steps automatically. After versions 2.2.0, main function is split inot above 5 stpes for user flexibility. To keep vignette run time minimal, below example is run with `nTry = 4`. ```{r, fig.height=5, fig.width=5, eval=FALSE, message=FALSE} @@ -552,7 +545,7 @@ Finally plot signatures maftools::plotSignatures(nmfRes = laml.sig, title_size = 0.8) ``` -NOTE: +***NOTE:*** 1. Should you receive an error while running `extractSignatures` complaining `none of the packages are loaded`, please manually load the `NMF` library and re-run. @@ -662,7 +655,6 @@ devtools::install_github(repo = "PoisonAlien/TCGAmutations") 3. Mermel, C.H. et al. GISTIC2.0 facilitates sensitive and confident localization of the targets of focal somatic copy-number alteration in human cancers. Genome Biol 12, R41 (2011). 4. Olshen, A.B., Venkatraman, E.S., Lucito, R. & Wigler, M. Circular binary segmentation for the analysis of array-based DNA copy number data. Biostatistics 5, 557-72 (2004). 5. Alexandrov, L.B. et al. Signatures of mutational processes in human cancer. Nature 500, 415-21 (2013). -6. Leiserson, M.D., Wu, H.T., Vandin, F. & Raphael, B.J. CoMEt: a statistical approach to identify combinations of mutually exclusive alterations in cancer. Genome Biol 16, 160 (2015). 7. Tamborero, D., Gonzalez-Perez, A. & Lopez-Bigas, N. OncodriveCLUST: exploiting the positional clustering of somatic mutations to identify cancer genes. Bioinformatics 29, 2238-44 (2013). 8. Dees, N.D. et al. MuSiC: identifying mutational significance in cancer genomes. Genome Res 22, 1589-98 (2012). 9. Lawrence MS, Stojanov P, Mermel CH, Robinson JT, Garraway LA, Golub TR, Meyerson M, Gabriel SB, Lander ES, Getz G: Discovery and saturation analysis of cancer genes across 21 tumour types. Nature 2014, 505:495-501. @@ -687,7 +679,7 @@ sessionInfo() If you have any issues, bug reports or feature requests please feel free to raise an [issue](https://github.com/PoisonAlien/maftools/issues) on [GitHub](https://github.com/PoisonAlien/maftools) page. ## acknowledgements - + * Thanks to [Shixiang Wang](https://github.com/ShixiangWang) fot many bug fixes, improvements, feature requests, and contribution to overall package maintenance * Thanks to [Ryan Morin](https://github.com/rdmorin) for crucial bug fixes * Thanks to [Peter Ellis](https://twitter.com/ellis2013nz) for beautiful [markdown template](http://ellisp.github.io/blog/2017/09/09/rmarkdown) * `somaticInteractions` plot is inspired from the article [Combining gene mutation with gene expression data improves outcome prediction in myelodysplastic syndromes](https://www.nature.com/articles/ncomms6901). Thanks to authors for making source code available.