sliceObj: Subset recoup output list objects

View source: R/util.R

sliceObjR Documentation

Subset recoup output list objects

Description

This function takes as input argument an output object from recoup and subsets it according to the inputs i,j,k. The attached plots may or may not be recalculated. Other input parameters stores in obj$callopts are not changed apart from any selector option which is dropped. Note that when slicing vertically (by j), the $coverage member of the input data (if present) is not sliced, but remains as is. You can drop it using removeData as it is used to recalculate profile matrices only if bin sizes are changed in a recoup call.

Usage

    sliceObj(obj, i = NULL, j = NULL, k = NULL, 
        dropPlots = FALSE, rc = NULL)

Arguments

obj

a list object created from recoup.

i

vector of numeric or character indices, corresponding to the index or rownames or names of reference genomic regions. The design object member will also be subset. If there is a selector attached to the input object (see recoup arguments) it will be dropped.

j

vector of numeric indices corresponding to the profile matrix vertical index (or base pair position or bin of base pairs) so as to subset the profile. The function will do its best to "guess" new plotting x-axis labels.

k

vector of numeric or character indices corresponding to sample index or sample names. These will be returned.

dropPlots

if profile and/or heatmap plots are attached to the input object, they will be recalculated if dropPlots=="TRUE" (default) or dropped otherwise

.

rc

fraction (0-1) of cores to use in a multicore system. It defaults to NULL (no parallelization).

Value

A recoup list object, susbet according to i, j.

Author(s)

Panagiotis Moulos

Examples

# 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.1
)

# Plot coverage profiles
o <- sliceObj(test.tss,i=1:10,k=1)

pmoulos/recoup documentation built on May 20, 2024, 2:22 a.m.