Set counts >1 to 1 in a count matrix
Usage
BinarizeCounts(object, ...)
# Default S3 method
BinarizeCounts(object, assay = NULL, verbose = TRUE, ...)
# S3 method for class 'Assay'
BinarizeCounts(object, assay = NULL, verbose = TRUE, ...)
# S3 method for class 'StdAssay'
BinarizeCounts(object, assay = NULL, verbose = TRUE, ...)
# S3 method for class 'Seurat'
BinarizeCounts(object, assay = NULL, verbose = TRUE, ...)Arguments
- object
A SeuratObject::Seurat object
- ...
Arguments passed to other methods
- assay
Name of assay to use. Can be a list of assays, and binarization will be applied to each.
- verbose
Display messages
Value
Returns a SeuratObject::Seurat object
Examples
x <- matrix(data = sample(0:3, size = 25, replace = TRUE), ncol = 5)
BinarizeCounts(x)
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 1 1 1 0 1
#> [2,] 0 1 1 1 1
#> [3,] 0 0 1 0 1
#> [4,] 0 1 1 1 1
#> [5,] 1 1 0 1 1
BinarizeCounts(atac_small[["peaks"]])
#> GRangesAssay data with 100 features for 100 cells
#> Variable features: 0
#> Annotation present: TRUE
#> Fragment files: 0
#> Motifs present: TRUE
#> Links present: 0
#> Region aggregation matrices: 0
BinarizeCounts(atac_small)
#> An object of class Seurat
#> 150 features across 100 samples within 2 assays
#> Active assay: peaks (100 features, 0 variable features)
#> 2 layers present: counts, data
#> 1 other assay present: RNA
#> 2 dimensional reductions calculated: lsi, umap