Learn R Programming

recoup (version 1.0.2)

simpleGetSet: Get and set some reusable objects from a recoup object

Description

The getr and setr functions are used to get several reusable/changeable objects of recoup or replcace them (e.g. when the user wishes to change some ggplot or ComplexHeatmap parameters manually in a plot, or change the heatmap profile ordering mode).

Usage

getr(obj, key = c("design", "profile", "heatmap", 
        "correlation", "orderBy", "kmParams", "plotParams"))
    setr(obj, key, value = NULL)

Arguments

obj
a list object created from recoup.
key
one of "design", "profile", "heatmap", "correlation", orderBy, kmParams, plotParams. For "profile", "heatmap", the respective plots are retrieved or changed according to which function is called. For setr it can (and preferably) be a named list of arguments to be changed in the recoup list object. The list names are the same as above. For the rest, see the main recoup man page.
value
a valid ggplot or HeatmapList object created from recoupProfile or recoupHeatmap recoupCorrelation when changing plots. Values for all other types are also checked for validity.

Value

  • For getr, the object asked to be retrieved. For setr, the obj with the respective slots filled or replaced with value.

Examples

Run this code
# Load some data
data("recoup_test_data",package="recoup")

# Calculate coverages
test.tss <- recoup(
    test.input,
    design=NULL,
    region="tss",
    type="chipseq",
    genome=test.genome,
    flank=c(2000,2000),
    selector=NULL,
    plotParams=list(plot=FALSE,profile=TRUE,
        heatmap=TRUE,device="x11"),
    rc=0.5
)

# Plot coverage profiles

# Get the curve profile plot
pp <- getr(test.tss,"profile")

# Change some ggplot parameter
pp <- pp + 
    theme(axis.title.x=element_text(size=14))
    
# Store the new plot
test.tss <- setr(test.tss,"profile",pp)
## or even better
# test.tss <- setr(test.tss,list(profile=pp))

Run the code above in your browser using DataLab