plotGenotypesPerCluster {SNPhood} | R Documentation

## Visualize average counts/enrichment based on strong and weak genotypes.

### Description

The function `plotGenotypesPerCluster` plots average clusters per genotype based on the clustering results of the strong an weak genotype analysis (see `plotAndCalculateWeakAndStrongGenotype`), which has to be executed before.

### Usage

    plotGenotypesPerCluster(SNPhood.o, printBinLabels = TRUE, fileToPlot = NULL,
      printPlot = TRUE, returnOnlyPlotNotObject = FALSE, verbose = FALSE)

### Arguments

`SNPhood.o` | Object of class `SNPhood`
`printBinLabels` | Logical(1). Default TRUE. Should the bin labels be printed? If multiple clusters are plotted simultaenously, bin labels might overlap, in which case `printBinLabels` can be set to FALSE.
`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.
`printPlot` | Logical(1). Default TRUE. Should the plots be printed? Only relevant if `fileToPlot` is set to NULL; otherwise, the plots are always printed to the output file.
`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

`plotAndCalculateWeakAndStrongGenotype`

### Examples

    data(SNPhood.o, package="SNPhood")
    SNPhood_merged.o = mergeReadGroups(SNPhood.o)
    SNPhood_merged.o = plotAndCalculateWeakAndStrongGenotype(SNPhood_merged.o)
    plot = plotGenotypesPerCluster(SNPhood_merged.o, printPlot = FALSE)

[Package SNPhood version 1.12.0 Index]