Methods in this package operate on log-transformed (multiplicative scale) expression. We attempt to check for this at construction, and then over-ride the assay method to return the "layer" containing such log-transformed data.

magic_assay_names()

assay_idx(x)

# S4 method for SingleCellAssay,missing
assay(x, i, withDimnames = TRUE, ...)

Arguments

x

SingleCellAssay

i

must be missing for this method to apply

withDimnames

A logical(1), indicating whether the dimnames of the SummarizedExperiment object should be applied (i.e. copied) to the extracted assays. More precisely, setting withDimnames=FALSE in the getter returns the assays as-is whereas setting withDimnames=FALSE return them with possibly modified dimnames.

Setting withDimnames=FALSE in the setter (assays<-) is required when the dimnames on the supplied assays are not identical to the dimnames on the SummarizedExperiment object; it does not influence actual assignment of dimnames to assays (they're always stored as-is).

Note that

assays(x, withDimnames=FALSE) <- assays(x, withDimnames=FALSE)

is guaranteed to always work and be a no-op. This is not the case if withDimnames=TRUE is used or if withDimnames is not specified.

...

passed to parent method

Details

By default we return the assay whose names, as given by assayNames(x), matches the first element in the vector c('thresh', 'et', 'Et', 'lCount', 'logTPM', 'logCounts', 'logcounts').

Functions

  • magic_assay_names: list of names assumed to represent log-transformed data, in order of usage preference

  • assay_idx: what index is returned by default by `assay`

Examples

data(vbetaFA)
assay(vbetaFA)[1:3,1:3]
#>         wellKey
#> primerid Sub01 1 A01 Sub01 1 A02 Sub01 1 A03
#>   B3GAT1           0           0           0
#>   BAX              0           0           0
#>   BCL2             0           0           0
assay(vbetaFA, 'thresh', withDimnames = FALSE) = assay(vbetaFA)*0 - 9 
assay(vbetaFA)[1:3, 1:3]
#>         wellKey
#> primerid Sub01 1 A01 Sub01 1 A02 Sub01 1 A03
#>   B3GAT1          -9          -9          -9
#>   BAX             -9          -9          -9
#>   BCL2            -9          -9          -9