coerce: Methods for coercing an object to a class

as.DESeqDataSetR Documentation

Methods for coercing an object to a class

Description

Force an object to belong to a class.

Usage

as.DESeqDataSet(x, ...)

as.DESeqTransform(x, ...)

as.DGEList(x, ...)

## S4 method for signature 'bcbioRNASeq'
as.DESeqDataSet(x, quiet = FALSE)

## S4 method for signature 'bcbioRNASeq'
as.DESeqTransform(x, quiet = FALSE)

## S4 method for signature 'bcbioRNASeq'
as.DGEList(x, quiet = FALSE)

Arguments

x

Object.

quiet

logical(1). Perform command quietly, suppressing messages.

...

Additional arguments.

Value

Modified object, of desired coercion type.

bcbioRNASeq to DESeqDataSet

  1. Coerce to RangedSummarizedExperiment.

  2. Round raw counts to ⁠integer matrix⁠.

  3. Subset colData() to include only clean factor columns. See sampleData() for details.

  4. Simplify metadata() to include only relevant information and updates sessionInfo.

Note that gene-level counts are required. Alternatively, tximport::summarizeToGene() can be called to convert transcript-level counts to gene-level. By default, we're using length-scaled TPM, so a corresponding average transcript length matrix isn't necessary. The average transcript length matrix is only necessary when raw counts matrix isn't scaled during tximport call (see countsFromAbundance in tximport::tximport() documentation).

bcbioRNASeq to DESeqTransform

  1. Coerce to DESeqDataSet.

  2. Call DESeq2::DESeq().

  3. Call DESeq2::varianceStabilizingTransformation().

bcbioRNASeq to DGEList

When countsFromAbundance = "lengthScaledTPM" (default):

  1. Call edgeR::DGEList().

When countsFromAbundance = "no":

  1. Call edgeR::DGEList().

  2. Obtain per-observation scaling factors for length, adjusted to avoid changing the magnitude of the counts.

  3. Computing effective library sizes from scaled counts, to account for composition biases between samples.

  4. Combine effective library sizes with the length factors, and calculate offsets for a log-link GLM.

  5. Apply offset matrix using edgeR::scaleOffset().

Note

Updated 2022-03-07.

Author(s)

Michael Steinbaugh

See Also

  • tximport::tximport().

  • DESeq2::DESeqDataSetFromTximport().

  • edgeR::DGEList().

Examples

data(bcb)

## bcbioRNASeq to DESeqDataSet ====
dds <- as.DESeqDataSet(bcb)
class(dds)

## bcbioRNASeq to DESeqTransform ====
dt <- as.DESeqTransform(bcb)
class(dt)

hbc/bcbioRNASeq documentation built on Sept. 17, 2024, 5:47 a.m.