Extract genes by row and samples by column from a bcbioRNASeq object. The internal DESeqDataSet and count transformations are rescaled automatically.

# S4 method for bcbioRNASeq,ANY,ANY,ANY
[(x, i, j, ..., drop = FALSE)

Arguments

x

object from which to extract element(s) or in which to replace element(s).

i

indices specifying elements to extract or replace. Indices are numeric or character vectors or empty (missing) or NULL. Numeric values are coerced to integer as by as.integer (and hence truncated towards zero). Character vectors will be matched to the names of the object (or for matrices/arrays, the dimnames): see ‘Character indices’ below for further details.

For [-indexing only: i, j, can be logical vectors, indicating elements/slices to select. Such vectors are recycled if necessary to match the corresponding extent. i, j, can also be negative integers, indicating elements/slices to leave out of the selection.

When indexing arrays by [ a single argument i can be a matrix with as many columns as there are dimensions of x; the result is then a vector with elements corresponding to the sets of indices in each row of i.

An index value of NULL is treated as if it were integer(0).

j

indices specifying elements to extract or replace. Indices are numeric or character vectors or empty (missing) or NULL. Numeric values are coerced to integer as by as.integer (and hence truncated towards zero). Character vectors will be matched to the names of the object (or for matrices/arrays, the dimnames): see ‘Character indices’ below for further details.

For [-indexing only: i, j, can be logical vectors, indicating elements/slices to select. Such vectors are recycled if necessary to match the corresponding extent. i, j, can also be negative integers, indicating elements/slices to leave out of the selection.

When indexing arrays by [ a single argument i can be a matrix with as many columns as there are dimensions of x; the result is then a vector with elements corresponding to the sets of indices in each row of i.

An index value of NULL is treated as if it were integer(0).

...

Additional arguments.

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

bcbioRNASeq.

See also

help("[", "base").

Examples

data(bcb) genes <- 1:50 samples <- c("group1_1", "group1_2") # Subset by sample name bcb[, samples]
#> using just counts from tximport
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing
#> Performing rlog transformation
#> Performing variance stabilizing transformation
#> class: bcbioRNASeq #> dim: 505 2 #> metadata(27): version uploadDir ... devtoolsSessionInfo #> unannotatedGenes #> assays(6): raw normalized ... rlog vst #> rownames(505): ENSMUSG00000002459 ENSMUSG00000004768 ... #> ENSMUSG00000105982 ENSMUSG00000109048 #> rowData names(10): ensgene symbol ... seqStrand seqCoordSystem #> colnames(2): group1_1 group1_2 #> colData names(4): sampleID sampleName description group
# Subset by gene list bcb[genes, ]
#> using just counts from tximport
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing
#> Performing rlog transformation
#> Performing variance stabilizing transformation
#> class: bcbioRNASeq #> dim: 50 4 #> metadata(27): version uploadDir ... devtoolsSessionInfo #> unannotatedGenes #> assays(6): raw normalized ... rlog vst #> rownames(50): ENSMUSG00000002459 ENSMUSG00000004768 ... #> ENSMUSG00000026154 ENSMUSG00000026155 #> rowData names(10): ensgene symbol ... seqStrand seqCoordSystem #> colnames(4): group1_1 group1_2 group2_1 group2_2 #> colData names(4): sampleID sampleName description group
# Subset by both genes and samples
# NOT RUN { bcb[genes, samples] # }
# Skip normalization
# NOT RUN { bcb[genes, samples, skipNorm = TRUE] # }