Skip to contents

Checks and returns a string indicating the type of data. It checks for the presence of infinite values, negative values, and whether the values are floats or integers.

Usage

CheckDataType(object, ...)

# S3 method for class 'Seurat'
CheckDataType(object, layer = "data", assay = NULL, verbose = TRUE, ...)

# Default S3 method
CheckDataType(object, verbose = TRUE, ...)

Arguments

object

A Seurat object or a matrix.

...

Arguments passed to other functions.

layer

Assay layer to use.

assay

Assay to use. NULL uses the default assay.

verbose

Whether to print the message. Default is TRUE.

Value

A string indicating the type of data. Possible values are: "raw_counts", "log_normalized_counts", "raw_normalized_counts", or "unknown". Disk-backed iterable matrices return "unknown" without materializing their values. Set do_normalization explicitly in preprocessing workflows when retaining externally normalized disk layers.

Examples

data(pancreas_sub)
CheckDataType(pancreas_sub)
#> ! [2026-12-03 11:37:32] Infinite values detected
#> [1] "unknown"