calculate_traj_metrics: Calculate Four Metrics to Compare Two Trajectories

View source: R/traj_utils.R

calculate_traj_metricsR Documentation

Calculate Four Metrics to Compare Two Trajectories

Description

Calculate Four Metrics to Compare Two Trajectories

Usage

calculate_traj_metrics(model_ref, model_sim, algorithm)

Arguments

model_ref, model_sim

The object generated by infer_trajectory.

algorithm

Optional. Which algorithm used for matching cells in simulated and real data. Improved_Hungarian (default), Hungarian.

Value

A list containing the results of four metrics.

Examples

# Check the docker status
# dynwrap::test_docker_installation(detailed = TRUE)

# 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)
)
#Generate a simulation data
set.seed(1)
b <- matrix(rpois(n = 2500, lambda = 1.5), nrow = 50)
rownames(b) <- paste0("fcell_", 1:ncol(b))
colnames(b) <- paste0("fgene_", 1:nrow(b))
dataset_sim <- dynwrap::wrap_expression(
  counts = b,
  expression = log2(b+1)
)

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