Set counts >1 to 1 in a count matrix

BinarizeCounts(object, ...)

# S3 method for default
BinarizeCounts(object, assay = NULL, verbose = TRUE, ...)

# S3 method for Assay
BinarizeCounts(object, assay = NULL, verbose = TRUE, ...)

# S3 method for Seurat
BinarizeCounts(object, assay = NULL, verbose = TRUE, ...)

Arguments

object

A 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 Seurat object

Examples

x <- matrix(data = sample(0:3, size = 25, replace = TRUE), ncol = 5)
BinarizeCounts(x)
#>      [,1] [,2] [,3] [,4] [,5]
#> [1,]    0    1    1    1    1
#> [2,]    1    1    0    1    1
#> [3,]    1    1    0    0    1
#> [4,]    1    1    0    1    1
#> [5,]    0    1    1    1    0
BinarizeCounts(atac_small[['peaks']])
#> ChromatinAssay data with 323 features for 100 cells
#> Variable features: 323 
#> Genome: hg19 
#> Annotation present: TRUE 
#> Motifs present: TRUE 
#> Fragment files: 0 
BinarizeCounts(atac_small)
#> An object of class Seurat 
#> 1323 features across 100 samples within 3 assays 
#> Active assay: peaks (323 features, 323 variable features)
#>  2 layers present: counts, data
#>  2 other assays present: bins, RNA
#>  2 dimensional reductions calculated: lsi, umap