Merging two CAGEset objects into one

Share:

Description

Merges two CAGEset objects into one by combining the CTSS genomic coordinates and raw tag counts. Merged CAGEset object will contain a union of TSS positions present in the two input CAGEset objects and raw tag counts for those TSSs in all samples from both input CAGEset objects.

Usage

1
mergeCAGEsets(cs1, cs2)

Arguments

cs1

A CAGEset object

cs2

A CAGEset object

Details

Note that merging discards all other information present in the two CAGEset objects, i.e. the merged object will not contain any normalised tag counts, CTSS clusters, quantile positions, etc., so these have to be calculated again by calling the appropriate functions on the merged CAGEset object. Also, it is only possible to merge two CAGEset objects that contain TSS information for the same reference genome and do not share any sample names.

Value

A CAGEset object is returned, which contains a union of TSS positions present in the two input CAGEset objects and raw tag counts for those TSSs in all samples from both input CAGEset objects.

Author(s)

Vanja Haberle

See Also

CAGEset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(BSgenome.Drerio.UCSC.danRer7)

pathsToInputFiles <- system.file("extdata", c("Zf.unfertilized.egg.chr17.ctss",
"Zf.30p.dome.chr17.ctss", "Zf.prim6.rep1.chr17.ctss"), package="CAGEr")

myCAGEset1 <- new("CAGEset", genomeName = "BSgenome.Drerio.UCSC.danRer7",
inputFiles = pathsToInputFiles[1:2], inputFilesType = "ctss", sampleLabels = 
c("sample1", "sample2"))
getCTSS(myCAGEset1)

myCAGEset2 <- new("CAGEset", genomeName = "BSgenome.Drerio.UCSC.danRer7",
inputFiles = pathsToInputFiles[3], inputFilesType = "ctss", sampleLabels = 
"sample3")
getCTSS(myCAGEset2)

myCAGEset <- mergeCAGEsets(myCAGEset1, myCAGEset2)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.