state.brewer {chromstaR} | R Documentation

## Obtain combinatorial states from specification

### Description

This function returns all combinatorial (decimal) states that are consistent with a given abstract specification.

### Usage

    state.brewer(replicates = NULL, differential.states = FALSE, min.diff = 1,
      common.states = FALSE, conditions = NULL, tracks2compare = NULL,
      sep = "+", statespec = NULL, diffstatespec = NULL,
      exclusive.table = NULL, binary.matrix = NULL)

### Arguments

`replicates` | A vector specifying the replicate structure. Similar entries will be treated as replicates.
`differential.states` | A logical specifying whether differential states shall be returned.
`min.diff` | The minimum number of differences between conditions.
`common.states` | A logical specifying whether common states shall be returned.
`conditions` | A vector with the same length as `replicates`. Similar entries will be treated as belonging to the same condition. Usually your tissue or cell types or time points.
`tracks2compare` | A vector with the same length as `replicates`. This vector defines the tracks between which conditions are compared. Usually your histone marks.
`sep` | Separator used to separate the tracknames in the combinations. The default '+' should not be changed because it is assumed in follow-up functions.
`statespec` | If this parameter is specified, `replicates` will be ignored. A vector composed of any combination of the following entries: `'0.[]', '1.[]', 'x.[]', 'r.[]'`, where [] can be any string. `'0.A'`: sample A is 'unmodified' `'1.B'`: sample B is 'modified' `'x.C'`: sample C can be both 'unmodified' or 'modified' `'r.D'`: all samples in group D have to be in the same state `'r.[]'`: all samples in group [] have to be in the same state
`diffstatespec` | A vector composed of any combination of the following entries: `'x.[]', 'd.[]'`, where [] can be any string. `'x.A'`: sample A can be both 'unmodified' or 'modified' `'d.B'`: at least one sample in group B has to be different from the other samples in group A `'d[]'`: at least one sample in group [] has to be different from the other samples in group []
`exclusive.table` | A `data.frame` or tab-separated text file with columns 'mark' and 'group'. Histone marks with the same group will be treated as mutually exclusive.
`binary.matrix` | A logical matrix produced by `dec2bin`. If this is specified, only states specified by the rows of this matrix will be considered. The number of columns must match `length(replicates)` or `length(statespec)`. Only for advanced use. No error handling for incorrect input.

### Details

The binary modification state (unmodified=0 or modified=1) of multiple ChIP-seq samples defines a (decimal) combinatorial state such as:

| sample1 | sample2 | sample3 | sample4 | sample5 | combinatorial state
bin1 | 0 | 0 | 1 | 0 | 0 | 4
bin2 | 0 | 0 | 0 | 0 | 0 | 0
bin3 | 0 | 1 | 0 | 1 | 0 | 10
bin4 | 0 | 1 | 1 | 1 | 1 | 15
bin5 | 0 | 0 | 1 | 0 | 1 | 5

### Value

A data.frame with combinations and their corresponding (decimal) combinatorial states.

### Author(s)

Aaron Taudt, David Widmann

### Examples

    # Get all combinatorial states where sample1=0, sample2=1, sample3=(0 or 1),
    #  sample4=sample5
    chromstaR:::state.brewer(statespec=c('0.A','1.B','x.C','r.D','r.D'))

    # Get all combinatorial states where sample1=sample2=sample3, sample4=sample5
    chromstaR:::state.brewer(statespec=c('r.A','r.A','r.A','r.B','r.B'))

    # Get all combinatorial states where sample1=sample5, sample2=sample3=1,
    #  sample4=(0 or 1)
    chromstaR:::state.brewer(statespec=c('r.A','1.B','1.C','x.D','r.A'))

[Package chromstaR version 1.10.0 Index]