ContactGroup-class {bnbc} | R Documentation

## Class `"ContactGroup"`

### Description

The ContactGroup class represents a collection of contact matrices which are observations from different samples on the same set of genomic loci.

### Usage

    ContactGroup(rowData, contacts, colData)

### Arguments

`rowData` | Object of class `GenomicRanges` equal in length to the number of rows/columns in contact matrices.
`contacts` | Object of class `list` that contains all contact matrices.
`colData` | Object of class `DataFrame` containing sample-level information.

### Details

The ContactGroup class contains a set of contact matrices in the slot 'contacts'. All matrices are required to be of the same dimensionality. 'ContactGroup()' expects a list of symmetric matrices to be passed to the contstructor. Data about these contact matrices is held in two other slots. Data about the genomic loci represented in the ContactGroup is found in the 'rowData' slot as a GenomicRanges objects, and sample-level information is located in the 'colData' slot as a DataFrame.

### Value

A ContactGroup object.

### Methods

In the code snippets below, `x` is a ContactGroup object.

[

  `signature(x = "ContactGroup", i = "ANY", j = "ANY", drop = "ANY")`: Allows for subsetting the contact matrices through use of `i` or of samples through `j`.

colData

  `signature(x = "ContactGroup")`: Get sample-level information about samples in `x`

colData<-

  `signature(x = "ContactGroup", value = "DataFrame")`: Set sample-level information about samples in `x`. `value` is expected to be a `DataFrame` object.

dim

  `signature(x = "ContactGroup")`: Obtain the dimensions of a ContactGroup. Returns 2 values: one representing the number of bins in the contact matrices and another representing the number of samples.

rowData

  `signature(x = "ContactGroup")`: Get the GenomicRanges object describing the loci in the ContactGroup. `value` is expected to be a GenomicRanges object.

rowData<-

  `signature(x = "ContactGroup")`: Set the GenomicRanges object describing the bins in the ContactGroup. `value` is expected to be a GenomicRanges object.

show

  `signature(object = "ContactGroup")`: Method to display summary information about a ContactGroup: the number of bins, the width of the bins and the number of samples.

librarySize

  `signature(x = "ContactGroup")`: Method to compute the library size of each contact matrix in `x`. Library size is defined to be the sum of the upper triangle of a contact matrix.

logCPM

  `signature(x = "ContactGroup")`: Method to transform each contact matrix to logCPM scale.

### Utilities

  `contacts(x)`, `contacts(x) <- value`: Method to extract the list of contact matrices from a ContactGroup. `value` is expected to be a list object.

distanceIdx

  `signature(cg = "ContactGroup", threshold="ANY", step="ANY")`: Method to identify which matrix bands are no more than `threshold` bins apart, where each bin represents `step` base pairs.

### References

Law, C.W., Chen, Y., Shi, W. and Smyth G.K. voom: Precision weights unlock linear model analysis tools for RNA-seq read counts. Genome Biology 2014, 15:R29. doi: 10.1186/gb-2014-15-2-r29.

### Examples

    data(cgEx)

    cgEx[1,]
    cgEx[,1]

    cd <- colData(cgEx)
    colData(cgEx) <- cd

    gr <- rowData(cgEx)
    rowData(cgEx) <- gr

    cgEx

    cl <- contacts(cgEx)
    contacts(cgEx) <- cl

    d.idx <- distanceIdx(cgEx, 1e7, 4e4)

    libs <- librarySize(cgEx)

    cgEx.cpm <- logCPM(cgEx)

    ## below, upper.mats.list is a list of upper triangular matrices
    ## SampleData is a DataFrame of sample data and LociData is a GenomicRanges objec
    ## Not run:
      MatsList <- lapply(upper.mats.list, function(M) M[lower.tri(M)] = M[upper.tri(M)])
      cg <- ContactGroup(LociData, MatsList, SampleData)

    ## End(Not run)

[Package bnbc version 1.4.0 Index]