shuffle_group_matrix: Reorder cell type-specific expression matrix during...

View source: R/coexpr_simulation.R

shuffle_group_matrixR Documentation

Reorder cell type-specific expression matrix during co-expression simulation

Description

This function is used internally by acorde to perform the shuffling of simulated features for an individual cell type, as part of the co-expression simulation process. The function is called recursively by simulate_coexpression() to perform the simulation on a full scRNA-seq matrix.

Usage

shuffle_group_matrix(sim_data, feature_ids, group_pattern, ngroups)

Arguments

sim_data

A count matrix with features as rows and cells as columns. Feature IDs must be included in an additional column named feature.

feature_ids

A two-column tibble containing top and bottom columns, each including the feature IDs of features to be used as highly or lowly expressed when shuffling by the indicated expression pattern.

group_pattern

A logical vector, containing TRUE to indicate that high expression in that cell type is desired and FALSE if the opposite. The vector must be ordered as the cell types in sim_data.

ngroups

An integer indicating the number of groups that top and bottom features should be divided into. It is computed by dividing the number of features selected as highly/lowly expressed by the size of the clusters that are to be generated.

Value

An expression matrix, with the same characteristics as sim_data, and a number of features defined as the total amount of top/bottom features selected divided by the number of clusters for which co-expression patterns where supplied.


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