simulate_coexpression: Simulate co-expression patterns on an already-simulated...

View source: R/coexpr_simulation.R

simulate_coexpressionR Documentation

Simulate co-expression patterns on an already-simulated scRNA-seq matrix

Description

Using a existing simulated scRNA-seq matrix, this function creates co-expression relationships between the features, following the cell type-specific patterns of high/low expression supplied by the user. In particular, the output of the SymSim simulator is expected as input (see SymSim package documentation for details).

Usage

simulate_coexpression(sim_data, feature_no, patterns, cluster_size)

Arguments

sim_data

A SingleCellExperiment object containing an already-simulated scRNA-seq matrix.

feature_no

An integer indicating the number of high expression ("top") and low expression ("bottom") features to be selected for co-expression simulation. Note that feature_no*2 features will be used in total.

patterns

A data.frame or tibble containing cell types as columns (ordered as in the colData slot in sim_data) and co-expression clusters as rows. For each co-expression cluster, a logical vector indicating the desired expression pattern must be provided, in a row-wise manner. Insert TRUE if high expression in that cell type is desired, FALSE if the opposite.

cluster_size

An integer indicating the number of features to include per cluster.

Value

A list, containing two objects:

  1. sim_matrix: a tibble containing the same number of cells as in sim_data in the columns and feature_no*2 in the rows. Feature IDs are defined in the feature column

  2. sim_clusters: a list with as many elements as simulated clusters, where each element contains all feature IDs that were simulated to follow the same co-expression pattern (that is, the clusters).


ConesaLab/acorde documentation built on Feb. 25, 2024, 4:16 a.m.