Extract genes by row and samples by column.
# S4 method for bcbioRNASeq,ANY,ANY,ANY [(x, i, j, drop = FALSE, recalculate = TRUE)
| 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
For When indexing arrays by An index value of |
| j | indices specifying elements to extract or replace. Indices are
For When indexing arrays by An index value of |
| drop | For matrices and arrays. If |
| recalculate |
|
bcbioRNASeq.
Internal count transformations are rescaled automatically, if defined. DESeq2
transformations will only be updated when recalculate = TRUE.
Updated 2019-08-20.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
data(bcb) object <- bcb ## Minimum of 100 genes, 2 samples. genes <- head(rownames(object), 100L) head(genes)#> [1] "ENSMUSG00000000001" "ENSMUSG00000000003" "ENSMUSG00000000028" #> [4] "ENSMUSG00000000049" "ENSMUSG00000000058" "ENSMUSG00000000078"#> [1] "control_rep1" "control_rep2"## Extract by sample name. object[, samples]#>#>#>#>#>#>#>#>#>#> bcbioRNASeq 0.3.27 #> uploadDir: /data00/draco/acidbase/packages/bcbioRNASeq/inst/extdata/bcbio #> dates(2): [bcbio] 2018-03-18; [R] 2019-09-16 #> level: genes #> caller: salmon #> organism: Mus musculus #> interestingGroups(2): treatment day #> class: RangedSummarizedExperiment #> dim: 100 2 #> metadata(28): allSamples bcbioCommandsLog ... yaml subset #> assays(7): counts aligned ... vst fpkm #> rownames(100): ENSMUSG00000000001 ENSMUSG00000000003 ... #> ENSMUSG00000062661 ENSMUSG00000074340 #> rowData names(8): broadClass description ... geneName seqCoordSystem #> colnames(2): control_rep1 control_rep2 #> colData names(26): averageInsertSize averageReadLength ... treatment #> x5x3Bias## Extract by gene list. object[genes, ]#> bcbioRNASeq 0.3.27 #> uploadDir: /data00/draco/acidbase/packages/bcbioRNASeq/inst/extdata/bcbio #> dates(2): [bcbio] 2018-03-18; [R] 2019-09-16 #> level: genes #> caller: salmon #> organism: Mus musculus #> interestingGroups(2): treatment day #> class: RangedSummarizedExperiment #> dim: 100 6 #> metadata(27): allSamples bcbioCommandsLog ... wd yaml #> assays(7): counts aligned ... vst fpkm #> rownames(100): ENSMUSG00000000001 ENSMUSG00000000003 ... #> ENSMUSG00000062661 ENSMUSG00000074340 #> rowData names(8): broadClass description ... geneName seqCoordSystem #> colnames(6): control_rep1 control_rep2 ... fa_day7_rep2 fa_day7_rep3 #> colData names(26): averageInsertSize averageReadLength ... treatment #> x5x3Bias## Extract by both genes and samples. x <- object[genes, samples]#>#>#>#>#>#>#>#>#>print(x)#> bcbioRNASeq 0.3.27 #> uploadDir: /data00/draco/acidbase/packages/bcbioRNASeq/inst/extdata/bcbio #> dates(2): [bcbio] 2018-03-18; [R] 2019-09-16 #> level: genes #> caller: salmon #> organism: Mus musculus #> interestingGroups(2): treatment day #> class: RangedSummarizedExperiment #> dim: 100 2 #> metadata(28): allSamples bcbioCommandsLog ... yaml subset #> assays(7): counts aligned ... vst fpkm #> rownames(100): ENSMUSG00000000001 ENSMUSG00000000003 ... #> ENSMUSG00000062661 ENSMUSG00000074340 #> rowData names(8): broadClass description ... geneName seqCoordSystem #> colnames(2): control_rep1 control_rep2 #> colData names(26): averageInsertSize averageReadLength ... treatment #> x5x3BiasassayNames(x)#> [1] "counts" "aligned" "avgTxLength" "tpm" "normalized" #> [6] "vst" "fpkm"## Fast subsetting, by skipping DESeq2 recalculations. ## Note that `normalized`, `rlog`, and `vst` assays will be removed. x <- object[, samples, recalculate = FALSE]#>print(x)#> bcbioRNASeq 0.3.27 #> uploadDir: /data00/draco/acidbase/packages/bcbioRNASeq/inst/extdata/bcbio #> dates(2): [bcbio] 2018-03-18; [R] 2019-09-16 #> level: genes #> caller: salmon #> organism: Mus musculus #> interestingGroups(2): treatment day #> class: RangedSummarizedExperiment #> dim: 100 2 #> metadata(28): allSamples bcbioCommandsLog ... yaml subset #> assays(4): counts aligned avgTxLength tpm #> rownames(100): ENSMUSG00000000001 ENSMUSG00000000003 ... #> ENSMUSG00000062661 ENSMUSG00000074340 #> rowData names(8): broadClass description ... geneName seqCoordSystem #> colnames(2): control_rep1 control_rep2 #> colData names(26): averageInsertSize averageReadLength ... treatment #> x5x3Bias#> [1] "counts" "aligned" "avgTxLength" "tpm"