removeMissingObs: Remove cells/genes with no expression across any genes/cells

View source: R/rliger.R

removeMissingObsR Documentation

Remove cells/genes with no expression across any genes/cells

Description

Removes cells/genes from chosen slot with no expression in any genes or cells respectively.

Usage

removeMissingObs(
  object,
  slot.use = "raw.data",
  use.cols = TRUE,
  verbose = TRUE
)

Arguments

object

liger object (scale.data or norm.data must be set).

slot.use

The data slot to filter (takes "raw.data" and "scale.data") (default "raw.data").

use.cols

Treat each column as a cell (default TRUE).

verbose

Print messages (TRUE by default)

Value

liger object with modified raw.data (or chosen slot) (dataset names preserved).

Examples

ligerex <- createLiger(list(ctrl = ctrl, stim = stim))
if (any(rowSums(ctrl) == 0) || any(rowSums(stim) == 0)) {
    # example datasets do not have missing data, thus put in a condition
    # Though the function will return unchanged object if no missing found
    ligerex <- removeMissingObs(ligerex)
}

rliger documentation built on Nov. 9, 2023, 1:07 a.m.