dba.analyze {DiffBind} | R Documentation

## Perform differential binding affinity analysis

### Description

Performs differential binding affinity analysis. Performs default generation of a consensus peakset, read counting, normalization, and setting up of contrasts if they have not been specified.

### Usage

    dba.analyze(DBA, method=DBA$config$AnalysisMethod, design,
                bBlacklist=DBA$config$doBlacklist,
                bGreylist=DBA$config$doGreylist,
                bRetrieveAnalysis=FALSE, bReduceObjects=TRUE,
                bParallel=DBA$config$RunParallel)

### Arguments

`DBA` | Either a `DBA` object, or a sample sheet (either a `character` vector with the name of the sample sheet, or a `data.frame` containing the experimental metadata. If no blacklist or greylists are included, a call will be made to `dba.blacklist` using defaults. This can be skipped by setting the `bBlacklist` and/or `bGreylist` parameters. If no counts are included, a default consensus will be formed and read counts computed via a call to `dba.count` using defaults. If no normalization has been specified, the reads will be normalized via a call to `dba.normalize` using defaults. If no contrasts are specified (`DBA$contrast` is `NULL`), default contrasts will be added via a call to `dba.contrast` using defaults.
`method` | Underlying method, or vector of methods, by which to analyze differential binding affinity. Supported methods: `DBA_EDGER` use `edgeR` package for analysis `DBA_DESEQ2` use `DESeq2` package for analysis `DBA_ALL_METHODS` perform two analyses, using both `edgeR` and `DESeq2`
`design` | If present and a character string, will be used as the design formula for the analysis, replacing any previously established design if present. If `FALSE`, will complete analysis in pre-version 3 mode. See `link{dba.contrast}`.
`bBlacklist` | If `TRUE`, and no blacklist has been applied to the `DBA` object (or when starting from a samplesheet), the read bam files will be examined to determine the reference genome, and an appropriate blacklist applied, if available. See `link{dba.blacklist}`.
`bGreylist` | If `TRUE`, and no greylist has been applied to the `DBA` object (or when starting from a samplesheet), the control bam files, if present, will be examined to determine the reference genome, greylists will be computed for each, merged into a master greylist, and applied to the peaksets. See `link{dba.blacklist}`.
`bRetrieveAnalysis` | If changed from `FALSE`, the underlying DE analysis object is returned instead of running a new analysis. Possible values for `bRetrieveAnalysis`: `DBA_DESEQ2` Returns the `DESeq2` `DESeqDataSet`. `DBA_EDGER` Returns the `edgeR` `DGEList`. `TRUE` Returns the `DESeq2` `DESeqDataSet`, if present. If not, returns the `edgeR` `DGEList`, if present.. An analysis object will only be successfully returned if there is at least one contrast utilizing an explicit design (see `dba.contrast`), and an analysis has been carried out.
`bReduceObjects` | logical indicating whether strip the analysis objects of unnecessary fields to save memory. If it is desired to use the `DBA$contrasts[[n]]$edgeR` and/or `DBA$contrasts[[n]]$DESeq2` objects directly in the `edgeR` and/or `DESeq2` packages, this should be set to `FALSE`.
`bParallel` | logical indicating that the analyses is to be done in parallel using multicore (one process for each contrast for each method, plus an additional process per method).

### Details

In general, prior to calling `dba.analyze`, `dba.count` should have been run. If no contrasts have been established prior to invoking `dba.analyze`, then the default set of contrasts will be added using (`dba.contrast`).

If no normalization parameters have been supplied by calling `dba.normalize`, default normalization parameters will be used.

See the DBA User Guide for more details on how the `edgeR` and `DESeq2` analyses are carried out.

### Value

DBA object with results of analysis added to `DBA$contrasts`.

Alternatively, an analysis object (either a `DESeqDataSet` or a `DGEList`) if `bRetrieveAnalysis` if not `FALSE`.

### Note

If there is a blocking factor for the contrast(s) specified using a previous call to `dba.contrast` with `design=FALSE`, a multi-factor analysis will automatically be carried out in addition to a single factor analysis.

### Author(s)

Rory Stark

### See Also

`dba.blacklist`, `dba.count`, `dba.contrast`, `dba.normalize`, `dba.report`, `DBA.config`.

### Examples

    data(tamoxifen_counts)
    dba.analyze(tamoxifen)

    tamoxifen <- dba.analyze(tamoxifen, method=DBA_ALL_METHODS,
                             design="~Tissue + Condition")
    dba.show(tamoxifen, bContrasts=TRUE)

    dba.analyze(tamoxifen, bRetrieveAnalysis=TRUE)
    edger.object <- dba.analyze(tamoxifen, bRetrieveAnalysis=DBA_EDGER)
    class(edger.object)

[Package DiffBind version 3.2.7 Index]