add_data_to_model: Add Gene Expression Data to Model

View source: R/traj_utils.R

add_data_to_modelR Documentation

Add Gene Expression Data to Model

Description

This function is used to add the gene expression data into the result of trajectory inference generated by infer_trajectory function.

Usage

add_data_to_model(model, dataset)

Arguments

model

A dynwrap::with_trajectory object generated by infer_trajectory. function.

dataset

A dynwrap::data_wrapper object generated by infer_trajectory. function.

Value

A new dynwrap::with_trajectory object.

Examples

# Generate a reference data
set.seed(1)
a <- matrix(rpois(n = 2500, lambda = 2), nrow = 50)
rownames(a) <- paste0("cell", 1:ncol(a))
colnames(a) <- paste0("gene", 1:nrow(a))
dataset_ref <- dynwrap::wrap_expression(
  counts = a,
  expression = log2(a+1)
)
# Trajectory inference

duohongrui/simutils documentation built on March 12, 2024, 8:40 p.m.