mergeRuns: Merge recoup outputs of same type

View source: R/util.R

mergeRunsR Documentation

Merge recoup outputs of same type

Description

This function accepts two or more recoup output objects holding single samples to a merged object so that all samples can be used together. This is useful when many coverages must be calulated/plotted and memory issues do not allow effective parallelization.

Usage

    mergeRuns(..., withDesign = c("auto", "drop"),
        dropPlots = TRUE)

Arguments

...

one or more recoup output objects.

withDesign

one of "auto" (default) or "drop". Determines how to merge designs. See details for further information.

dropPlots

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

.

Details

The withDesign argument controls what should be done if any input has an attached design. The default behavioir ("auto") will try to do its best to preserve compatible designs. If one or more inputs have the same design, it will be applied to the rest of the samples. If there is only one design, it will be applied to all samples (if you don't want this to happen, choose "drop"). If more than one sample has an attached design but these are incompatible (different numbers of rows/rownames, columns/columnnames), then all designs are dropped. Obviously, withDesign="drop" drops all attached designs and the output object is free of a design data frame.

Value

A recoup output object with as many samples as in ....

Author(s)

Panagiotis Moulos

Examples

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

test.input.shift <- test.input
names(test.input.shift) <- paste(names(test.input.shift),"_1",sep="")
test.input.shift[[1]]$id <- paste0(test.input.shift[[1]]$id,"_1")
test.input.shift[[1]]$ranges <- 
    shift(test.input.shift[[1]]$ranges,100)
test.input.shift[[2]]$id <- paste0(test.input.shift[[2]]$id,"_1")
test.input.shift[[2]]$ranges <- 
    shift(test.input.shift[[2]]$ranges,100)

test.tss.1 <- recoup(
    test.input,
    design=NULL,
    region="tss",
    type="chipseq",
    genome=test.genome,
    flank=c(2000,2000),
    selector=NULL,
    rc=0.1
)

test.tss.2 <- recoup(
    test.input.shift,
    design=NULL,
    region="tss",
    type="chipseq",
    genome=test.genome,
    flank=c(2000,2000),
    selector=NULL,
    rc=0.1
)

test.tss <- mergeRuns(test.tss.1,test.tss.2)

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