R/ComboMutPlot.R

Defines functions ComboMutPlot

Documented in ComboMutPlot

#' Create The Mutation Plot
#' @param ReturnClass instance of MutationPlot class
#' @param PRINT TRUE/FALSE - print the final plot?
#' @keywords Mutation Waterfall
#' @export
#' @examples
#' mutationPlot(Data, "SampleName", "GeneName", "Info")

## FuncColour=c("frameshift deletion" = "#7CAE00","." = "#00BFC4","nonsynonymous SNV" = "#F8766D")
ComboMutPlot <- function(ReturnClass, PRINT = FALSE) {
        ##theme_set(MutTheme)
        ReturnClass@plots[["FinalPlot"]] <- ReturnClass@plots$SampleCount + theme(legend.position = "none") +
                plot_spacer() +
                ReturnClass@plots$Waterfall + theme(legend.position = "none") +
                ReturnClass@plots$GeneCount +
                plot_layout(widths = c(5, 1), ncol=2) +
                ({ReturnClass@plots$WaterLegend +
                                ReturnClass@plots$CountLegend +
                                plot_layout(ncol=1) }) +
                plot_layout(heights=c(10,50,10))
        if ( PRINT == TRUE ) {
                print(ReturnClass@plots$FinalPlot)
                }
        ReturnClass
}
findlaycopley/MutPlot documentation built on March 4, 2020, 5:02 p.m.