setColors {CAGEr} | R Documentation

## Set colors for samples

### Description

Assigns one color to each sample in the CAGEr object. These colors are used in various plots and exported tracks to consistently represent corresponding samples.

### Usage

    setColors(object, colors = NULL)

    ## S4 method for signature 'CAGEr'
    setColors(object, colors = NULL)

### Arguments

`object` | A `CAGEr` object.
`colors` | A character vector of one valid R color specification per sample (see `col2rgb` for details). Provided colors are assigned to samples in the order they are returned by the `sampleLabels` function.

### Value

Assigns one color to each sample in the CAGEr object and modifies it in place.

### Author(s)

Vanja Haberle

### See Also

Other CAGEr setter methods: `genomeName`, `inputFilesType`, `inputFiles`, `sampleLabels`

### Examples

    sampleLabels(exampleCAGEset)
    setColors(exampleCAGEset, colors = c("darkred", "navy", "forestgreen"))
    sampleLabels(exampleCAGEset)

    sampleLabels(exampleCAGEexp)
    setColors(exampleCAGEexp, 5)
    sampleLabels(exampleCAGEexp)
    setColors(exampleCAGEexp, c("#ff0000ff", "#CCFF00", "blue", "grey", 1))
    sampleLabels(exampleCAGEexp)
    setColors(exampleCAGEexp, c("red", "darkgreen", "blue", "grey", "black"))
    sampleLabels(exampleCAGEexp)

[Package CAGEr version 1.24.0 Index]