isMeta: Tests if an input is the name of a meta.data slot in a target...

View source: R/meta-getters.R

isMetaR Documentation

Tests if an input is the name of a meta.data slot in a target object.

Description

Tests if an input is the name of a meta.data slot in a target object.

Usage

isMeta(test, object, return.values = FALSE)

Arguments

test

String or vector of strings, the "potential.metadata.name"(s) to check for.

object

A Seurat, SingleCellExperiment, or SummarizedExperiment object.

return.values

Logical which sets whether the function returns a logical TRUE/FALSE versus the TRUE test values . Default = FALSE

Details

For Seurat objects, also returns TRUE for the input "ident" because, for all dittoSeq visualiztions, "ident" will retrieve a Seurat objects' clustering slot.

Value

Returns a logical or logical vector indicating whether each instance in test is a meta.data slot within the object. Alternatively, returns the values of test that were indeed metadata slots if return.values = TRUE.

Author(s)

Daniel Bunis

See Also

getMetas for returning all metadata slots of an object

meta for obtaining the contants of metadata slots

Examples

example(importDittoBulk, echo = FALSE)

# To check if something is a metadata slot
isMeta("timepoint", object = myRNA) # FTRUE
isMeta("nCount_RNA", object = myRNA) # FALSE

# To test if many things are metadata of an object
isMeta(c("age","groups"), myRNA) # FALSE, TRUE

# 'return.values' input is especially useful in these cases.
isMeta(c("age","groups"), myRNA,
    return.values = TRUE)

# Alternatively, to see all metadata slots of an object, use getMetas
getMetas(myRNA)


dtm2451/DittoSeq documentation built on May 4, 2024, 7:31 a.m.