Skip to contents

[Stable]

These methods access and set the counts assay in a AnyHermesData object.

Usage

# S4 method for class 'AnyHermesData'
counts(object, ...)

# S4 method for class 'AnyHermesData,matrix'
counts(object, ..., withDimnames = TRUE) <- value

Arguments

object

(AnyHermesData)
object to access the counts from.

...

not used.

withDimnames

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

value

(matrix)
what should the counts assay be replaced with.

Value

The counts assay.

Methods (by class)

  • counts(object = AnyHermesData) <- value:

Examples

a <- hermes_data
result <- counts(a)
class(result)
#> [1] "matrix" "array" 
head(result)
#>                  06520011B0023R 06520067C0018R 06520063C0043R 06520105C0017R
#> GeneID:11185                  3             66             35             10
#> GeneID:10677               1668            236             95           1945
#> GeneID:101928428              0              0              0              0
#> GeneID:100422835              0              0              0              0
#> GeneID:102466731              0              0              0              0
#> GeneID:64881                113             11            153             22
#>                  06520092C0017R 06520103C0017R 06520001B0023R 06520022C0017R
#> GeneID:11185                 68            123             65             10
#> GeneID:10677                570            149            216            182
#> GeneID:101928428              0              0              0              0
#> GeneID:100422835              0              0              0              0
#> GeneID:102466731              0              0              0              0
#> GeneID:64881                  0             20              1              5
#>                  06520062C0017R 06520046C0018R 06520101B0017R 06520047C0017R
#> GeneID:11185                106             23             72              4
#> GeneID:10677                138            748            314            189
#> GeneID:101928428              0              0              0              0
#> GeneID:100422835              0              0              0              0
#> GeneID:102466731              0              0              0              0
#> GeneID:64881                131            586              0            119
#>                  06520024B0014R 06520080B0023R 06520093C0017R 06520070C0018R
#> GeneID:11185                 36              0             50            479
#> GeneID:10677                176            213            313            345
#> GeneID:101928428              0              0              0              0
#> GeneID:100422835              0              0              0              0
#> GeneID:102466731              0              0              0              0
#> GeneID:64881                  9             62              0            482
#>                  06520023C0018R 06520099B0017R 06520015C0016R 06520019C0023R
#> GeneID:11185                235             35             75             47
#> GeneID:10677               1922            269            385            687
#> GeneID:101928428              0              0              0              0
#> GeneID:100422835              0              0              0              0
#> GeneID:102466731              0              0              0              0
#> GeneID:64881               1315              0           3047            135
counts(a) <- counts(a) + 100L
head(counts(a))
#>                  06520011B0023R 06520067C0018R 06520063C0043R 06520105C0017R
#> GeneID:11185                103            166            135            110
#> GeneID:10677               1768            336            195           2045
#> GeneID:101928428            100            100            100            100
#> GeneID:100422835            100            100            100            100
#> GeneID:102466731            100            100            100            100
#> GeneID:64881                213            111            253            122
#>                  06520092C0017R 06520103C0017R 06520001B0023R 06520022C0017R
#> GeneID:11185                168            223            165            110
#> GeneID:10677                670            249            316            282
#> GeneID:101928428            100            100            100            100
#> GeneID:100422835            100            100            100            100
#> GeneID:102466731            100            100            100            100
#> GeneID:64881                100            120            101            105
#>                  06520062C0017R 06520046C0018R 06520101B0017R 06520047C0017R
#> GeneID:11185                206            123            172            104
#> GeneID:10677                238            848            414            289
#> GeneID:101928428            100            100            100            100
#> GeneID:100422835            100            100            100            100
#> GeneID:102466731            100            100            100            100
#> GeneID:64881                231            686            100            219
#>                  06520024B0014R 06520080B0023R 06520093C0017R 06520070C0018R
#> GeneID:11185                136            100            150            579
#> GeneID:10677                276            313            413            445
#> GeneID:101928428            100            100            100            100
#> GeneID:100422835            100            100            100            100
#> GeneID:102466731            100            100            100            100
#> GeneID:64881                109            162            100            582
#>                  06520023C0018R 06520099B0017R 06520015C0016R 06520019C0023R
#> GeneID:11185                335            135            175            147
#> GeneID:10677               2022            369            485            787
#> GeneID:101928428            100            100            100            100
#> GeneID:100422835            100            100            100            100
#> GeneID:102466731            100            100            100            100
#> GeneID:64881               1415            100           3147            235