dba.mask {DiffBind} | R Documentation

## Derive a mask to define a subset of peaksets or sites for a DBA object

### Description

Derives a mask to define a subset of peaksets or sites for a DBA object.

### Usage

    dba.mask(DBA, attribute, value, combine='or', mask, merge='or', bApply=FALSE,
             peakset, minValue=-1)

### Arguments

`DBA` | DBA object
`attribute` | when deriving a peakset mask, attribute to base mask on: DBA_ID DBA_TISSUE DBA_FACTOR DBA_CONDITION DBA_TREATMENT DBA_REPLICATE DBA_CONSENSUS DBA_CALLER DBA_CONTROL

`value` | when deriving a peakset/sample mask, attribute value (or vector of attribute values) to match.
`combine` | when deriving a peakset/sample mask, if value is a vector, OR when deriving a site mask, and peaksets is a vector, this is method for combining result of each value: “or” “and” “nor” “nand”
`mask` | when deriving a peakset/sample mask, this specifies an existing mask to merge with; if missing, create new mask
`merge` | when deriving a peakset/sample mask, and an existing mask is supplied, this specifies the method for combining new mask with supplied mask: “or” “and” “nor” “nand” note: if mask is missing, “nand” results in negative of mask
`bApply` | when deriving a peakset/sample mask, a logical indicating that a new DBA object with the mask applied will be returned.
`peakset` | when deriving a peak/site mask, this specifies a peakset number, or a vector of peakset numbers. The resulting mask will indicate which of the overall sites were called as peaks in this peakset or set of peaksets. If a vector, the masks for each of the peaksets will be combined using the method specified in the combine parameter.
`minValue` | when deriving a peak/site mask, scores greater than this value will be considered as indicating that the site corresponds to a called peakset.

### Details

MODE: Derive a a mask of peaksets/samples:

dba.mask(DBA, attribute, value, combine, mask, merge, bApply)

MODE: Derive a mask of peaks/sites:

dba.mask(DBA, combine, mask, merge,bApply, peakset, minValue)

### Value

either a logical mask, or new DBA object if bApply is TRUE.

### Note

dba automatically generates masks for each unique value of DBA_TISSUE, DBA_FACTOR, DBA_CONDITION, DBA_TREATMENT, DBA_CALLER, and DBA_REPLICATE. These are accessible using masks field of the DBA object (DBA$masks), and can be viewed using names(DBA$masks).

### Author(s)

Rory Stark

### See Also

`dba.show`

### Examples

    data(tamoxifen_peaks)

    # Pre-made masks
    names(tamoxifen$masks)
    dba.show(tamoxifen,tamoxifen$masks$MCF7)

    # New masks
    mcf7Mask <- dba.mask(tamoxifen,DBA_TISSUE, "MCF7")
    mcf7DerivedMask <- dba.mask(tamoxifen,DBA_TISSUE,"TAMR",mask=mcf7Mask)
    mcf7Derived <- dba(tamoxifen,mcf7DerivedMask)
    mcf7Derived

[Package DiffBind version 2.14.0 Index]