exportPlots {ddPCRclust} | R Documentation

## Plot the algorithms results with ggplot2

### Description

A convinience function that takes the results of the ddPCRclust algorithm, plots them using the ggplot2 library and a custom colour palette and saves the plots to a folder.

### Usage

    exportPlots(data, directory, annotations, format = "png", invert = FALSE)

### Arguments

`data` | The result of the ddPCRclust algorithm
`directory` | The parent directory where the files should saved. A new folder with the experiment name will be created (see below).
`annotations` | Some basic metadata about the ddPCR reaction. If you provided `ddPCRclust` a template, this paramater can be filled with the corresponding field in the result. Otherwise, you have to provide a character vector containing a name and the the color channels, e.g. `c(Name='ddPCR_01-04-2017', Ch1='HEX', Ch2='FAM')`
`format` | Which file format to use. Can be either be a device function (e.g. png), or one of 'eps', 'ps', 'tex' (pictex), 'pdf', 'jpeg', 'tiff', 'png', 'bmp', 'svg' or 'wmf' (windows only). See also `ggsave`
`invert` | Invert the axis, e.g. x = Ch2.Amplitude, y = Ch1.Amplitude

### Value

None

### Examples

    # Read files
    exampleFiles <- list.files(paste0(find.package('ddPCRclust'), '/extdata'), full.names = TRUE)
    files <- readFiles(exampleFiles[3])
    # To read all example files uncomment the following line
    # files <- readFiles(exampleFiles[1:8])

    # Read template
    template <- readTemplate(exampleFiles[9])

    # Run ddPCRclust
    result <- ddPCRclust(files, template)

    # Export the plots
    dir.create('./Results')
    exportPlots(data = result, directory = './Results/', annotations = result$annotations)

[Package ddPCRclust version 1.4.0 Index]