.fit_preprocessing {decoupleR} | R Documentation

## Pre-processing for methods that fit networks.

### Description

- If `center` is true, then the expression values are centered by the mean of expression across the samples.

### Usage

    .fit_preprocessing(network, mat, center, na.rm, sparse)

### Arguments

`network` | Tibble or dataframe with edges and it's associated metadata.
`mat` | Matrix to evaluate (e.g. expression matrix). Target nodes in rows and conditions in columns. `rownames(mat)` must have at least one intersection with the elements in `network` `.target` column.
`center` | Logical value indicating if `mat` must be centered by `base::rowMeans()`.
`na.rm` | Should missing values (including NaN) be omitted from the calculations of `base::rowMeans()`?
`sparse` | Deprecated parameter.

### Value

A named list of matrices to evaluate in methods that fit models, like `.mlm_analysis()`.

- mat: Features as rows and samples as columns.

- mor_mat: Features as rows and columns as source.

### Examples

    inputs_dir <- system.file("testdata", "inputs", package = "decoupleR")
    mat <- readRDS(file.path(inputs_dir, "input-expr_matrix.rds"))
    network <- readRDS(file.path(inputs_dir, "input-dorothea_genesets.rds"))
    network <- rename_net(network, tf, target, mor, likelihood)
    .fit_preprocessing(network, mat, center = FALSE, na.rm = FALSE, sparse = FALSE)

[Package decoupleR version 2.0.1 Index]