mergeSamples: Merging CAGE datasets (samples)

Description Usage Arguments Details Value Author(s) Examples


Merges individual CAGE datasets (experiments, samples) within the CAGEset object into specified groups.


mergeSamples(object, mergeIndex, mergedSampleLabels)



A CAGEset object


Integer vector specifying which experiments should be merged. Must be the same length as the number of datasets in the CAGEset object. See Details.


Labels for the merged datasets. Must be the same lenght as the number of unique values in mergeIndex. See Details.


This function merges CAGE datasets within the CAGEset object at the level of CTSS tag counts, i.e. tag counts of individual CTSS are summed over a group of datasets that are being merged. After merging, all other slots in the CAGEset object will be reset and any previous data for individual experiments will be removed.
mergeIndex controls which datasets will be merged. It is an integer vector that assigns a value to each dataset in the CAGEset object in the same order as they are returned by sampleLabels(object). Datasets with the same value in the mergeIndex will be merged. For example, if there are 8 CAGE datasets in the CAGEset object and mergeIndex = c(1,1,2,2,3,2,4,4), this will merge a) samples 1 and 2 b) samples 3, 4 and 6 c) samples 7 and 8, and it will leave sample 5 as it is, resulting in 4 final merged datasets.
Labels provided in mergedSampleLabels will be assigned to merged datasets in the ascending order of mergeIndex values, i.e. first label will be assigned to a dataset created by merging datasets labeled with lowest mergeIndex value (in this case 1), etc.


The slots sampleLabels, librarySizes and tagCountMatrix of the provided CAGEset object will be updated with the information on merged CAGE datasets and will replace the previous information on individual CAGE datasets. All further slots with downstream information will be reset.


Vanja Haberle


load(system.file("data", "exampleCAGEset.RData", package="CAGEr"))

mergeSamples(exampleCAGEset, mergeIndex = c(1,1,2),
mergedSampleLabels = c("mergedSample1", "mergedSample2"))

CAGEr documentation built on May 31, 2017, 3 p.m.

Search within the CAGEr package
Search all R packages, documentation and source code