extract: Extract or replace parts of an object

extractR Documentation

Extract or replace parts of an object

Description

Extract genes by row and samples by column.

Usage

## S4 method for signature 'bcbioRNASeq,ANY,ANY,ANY'
x[i, j, recalculate = TRUE, drop = FALSE]

Arguments

x

Object.

i

Indices specifying elements to extract or replace. Indices are numeric or character vectors, empty (missing), or NULL.

For more information:

help(topic = "Extract", package = "base")
j

Indices specifying elements to extract or replace. Indices are numeric or character vectors, empty (missing), or NULL.

For more information:

help(topic = "Extract", package = "base")
recalculate

logical(1). Recalculate DESeq2 normalized counts and variance-stabilizing transformations defined in assays.
Recommended by default, but can take a long time for large datasets.
\ If FALSE, these assays will be removed automatically: normalized, rlog, vst.

drop

For matrices and arrays. If TRUE the result is coerced to the lowest possible dimension (see the examples). This only works for extracting elements, not for the replacement. See drop for further details.

Details

Internal count transformations are rescaled automatically, if defined. DESeq2 transformations will only be updated when recalculate = TRUE.

Value

bcbioRNASeq.

Note

Updated 2024-03-27.

Author(s)

Michael Steinbaugh, Lorena Pantano

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.

Examples

## bcbioRNASeq ====
data(bcb)
object <- bcb

## Minimum of 100 genes, 2 samples.
genes <- head(rownames(object), 100L)
head(genes)
samples <- head(colnames(object), 2L)
head(samples)

## Extract by sample name.
object[, samples]

## Extract by gene list.
object[genes, ]

## Extract by both genes and samples.
x <- object[genes, samples]
print(x)

## Fast subsetting, by skipping DESeq2 recalculations.
## Note that `normalized`, `rlog`, and `vst` assays will be removed.
x <- object[, samples, recalculate = FALSE]
print(x)

hbc/bcbioRnaseq documentation built on Sept. 15, 2024, 9:10 a.m.