plotClusterAverage {SNPhood} | R Documentation

## Visualize average enrichment per cluster

### Description

`plotClusterAverage` visualizes the average reads per cluster. Note that the function `plotAndClusterMatrix` has to be executed before `plotClusterAverage` is called for the same read group and dataset

### Usage

    plotClusterAverage(SNPhood.o, readGroup, dataset, fileToPlot = NULL,
      returnOnlyPlotNotObject = FALSE, verbose = FALSE)

### Arguments

`SNPhood.o` | Object of class `SNPhood`
`readGroup` | Character(1). Default NULL. Read group that should be plotted, specified by its name as obtained by the function `annotationReadGroups`). If only one read group is defined in the object, this may also be NULL for user conveniance.
`dataset` | Numeric(1) or Character(1). Single dataset that should be used for plotting, either specified as integer (such as 1, value must be between 1 and the total number of datasets as defined in the object) or its annotation (name must appear in the dataset names as obtained via the function `annotationDatasets`).
`fileToPlot` | Character(1) or `NULL`. Default `NULL`. Filename of the PDF file for the output plots. If set to `NULL`, plots will be plotted to the currently active device.
`returnOnlyPlotNotObject` | Logical(1). Default FALSE. If set to TRUE, only the plots are returned but not the actual object. Otherwise, for consistancy among the various visualization functions, the `SNPhood` object is always returned, while the plots are either written to a PDF file as specified by the parameter `fileToPlot` and/or to the currently active graphics device (i.e., the console usually)
`verbose` | Logical(1). Default FALSE. Should the verbose mode (i.e., diagnostic messages during execution of the script) be enabled?

### Value

the generated ggplot2 plot(s) as list for further processing. May contain multiple plots, depending on the function. The plot(s) can then be plotted individually or modified arbitrarily as the user wants. For example, if multiple plots are returned and the plots have been saved in a variable called plots.l, simply type plots.l[[1]] to view the first plot.

### See Also

`plotAndClusterMatrix`

### Examples

    data(SNPhood.o, package="SNPhood")
    plot = plotClusterAverage(SNPhood.o, readGroup = "paternal", dataset = 1)

[Package SNPhood version 1.17.0 Index]