mergeReplicates {chroGPS} | R Documentation

## Merges information from epigenetic replicates at factor, gene and chroGPS MDS map level.

### Description

The function performs effectively merging of epigenetic replicate information, either as genomic intervals or as gene epigenetic profiles. It also allows merging of final chroGPS MDS factor maps so that multiple points for the same epigenetic factor (i.e. different antibodies or experimental sources) are returned as a single location in the map (centroid).

### Usage

    mergeReplicates(x,id,mergeBy='any',mc.cores=1)

### Arguments

`x` | Object containing the epigenetic information used to generate either factors or gene maps. Can also be a final chroGPS-factors MDS map object.
`id` | Identifier for epigenetic factors (list elements for x='GRangesList', column names for x='matrix' or 'data.frame', row names for x='mds'). This information will be used to identify valid replicates to be merged.
`mergeBy` | Either a character vector with possible values 'any' or 'all' to merge replicate genomic intervals or gene epigenetic profiles based on a logical 'OR' or 'AND' fashion, or a decimal number between (0,1] indicating the minimum proportion of replicates needed to consider.
`mc.cores` | Number of cores to use in calls to parallel::mclapply

### Value

An object from the same class as x, containing a data set with merged replicates as specified by the 'mergeBy' argument.

### Methods

signature(x='GRangesList')

  Each element in `x` is assumed to indicate the binding sites for a different sample, e.g. epigenetic factor. Typically `space(x)` indicates the chromosome, `start(x)` the start position and `end(x)` the end position (in bp). Strand information is ignored.

signature(x='matrix')

  Rows in `x` contain individuals for which we want to compute distances. Columns in `x` contain the variables, and should only contain either 0's and 1's or `FALSE` and `TRUE`.

signature(x='mds')

  A `MDS` object containing a chroGPS-factors map.

### See Also

`mds` to create MDS-oriented objects

### Examples

    ## Not run

    #data(s2)
    #data(bg3)

    #names(s2)
    #names(bg3)

    # Unify replicates
    #mnames <- sort(unique(intersect(s2names$Factor,bg3names$Factor)))
    #sel <- s2names$Factor %in% mnames
    #s2.repset <- mergeReplicateList(s2[sel],id=s2names$Factor[sel],mergeBy='any')
    #sel <- bg3names$Factor %in% mnames
    #bg3.repset <- mergeReplicateList(bg3[sel],id=bg3names$Factor[sel],mergeBy='any')

    #names(s2.repset)
    #names(bg3.repset)

[Package chroGPS version 2.4.0 Index]