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

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/meta-getters.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)

dittoSeq documentation built on April 17, 2021, 6:01 p.m.