Skip to contents

Extract genes by row and samples by column.

Usage

# S4 method for DESeqAnalysis,ANY,ANY,ANY
[(x, i, j, 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")

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.

Value

DESeqAnalysis.

Note

Updated 2020-10-28.

References

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

Examples

data(deseq)
object <- deseq
dim(object)
#> [1] 500  12

genes <- head(rownames(object), 50L)
head(genes)
#> [1] "gene1" "gene2" "gene3" "gene4" "gene5" "gene6"
samples <- head(colnames(object), 2L)
head(samples)
#> [1] "sample1" "sample2"

x <- object[genes, samples]
print(x)
#> DESeqAnalysis 0.7.1; DESeq2 1.41.12
#> data:
#>   dim: 50 2 
#>   metadata(1): version
#>   assays(4): counts mu H cooks
#>   rownames(50): gene1 gene2 ... gene49 gene50
#>   rowData names(40): broadClass description ... deviance maxCooks
#>   colnames(2): sample1 sample2
#>   colData names(3): condition treatment sizeFactor
#> transformType: varianceStabilizingTransformation
#> resultsNames(2): condition_B_vs_A treatment_D_vs_C
#> alphaThreshold: 0.01
#> lfcShrinkType: apeglm