Function to save Progeny plots — saveProgenyPlots • progeny
Description: This function is designed to save the plots (in pdf format) of a nested (2 level) list of arrangeGrob objects, such as the one returned by the progenyScatter function.

# Function to save Progeny plots

Source: `R/progenySuppFunc.r`
`saveProgenyPlots.Rd`

This function is designed to save the plots (in pdf format) of a nested (2 level) list of arrangeGrob objects, such as the one returned by the progenyScatter function.

    saveProgenyPlots(plots, contrast_names, dirpath)

## Arguments

plots | a list of list of arrangeGrob object (such as the one returned by the progenyScatter function.).The first level list elements correspond to samples/contrasts. The second level corresponds to pathways. The plots can be saved in a pdf format using the saveProgenyPlots function.
contrast_names | a vector of the same length as the first level of the plot list corresponding to the names of each sample/contrast
dirpath | the path to the directory where the plots should be saved

## Value

This function produces the pdf files of plots taken from the progenyScatter function

## Examples

    #create plots using progneyScatter function
    gene_expression <- read.csv(system.file("extdata",
    "human_input.csv", package = "progeny"))

    # getting a weight_matrix
    weight_matrix <- getModel("Human", top=100)
    weight_matrix <- data.frame(names = row.names(weight_matrix),
      row.names = NULL, weight_matrix)
    plots <- progenyScatter(gene_expression, weight_matrix)
    #> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 12 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 11 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 13 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 11 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 13 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 11 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 13 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 12 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 11 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 13 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 12 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 11 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 8 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 9 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 13 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 17 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 7 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 6 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).#> Warning: Removed 10 rows containing missing values (geom_label_repel).#> Warning: Removed 1 rows containing missing values (geom_hline).
    #create a list with contrast names
    contrast_names <- names(gene_expression[2:ncol(gene_expression)])

    #assign a path to store your plots
    dirpath <- "./progeny_plots/"

    # save it
    # saveProgenyPlots(plots, contrast_names, dirpath)