cal_cor_dist: Calculate the Correlation Between Geodesic Distances

View source: R/traj_utils.R

cal_cor_distR Documentation

Calculate the Correlation Between Geodesic Distances

Description

This function calculate the correlation between geodesic distances which refer to the relative distance of one cell to all other cell in the trajectory. The result is obtained from the mean values of choosing 0.05, 0.1, 0.15, 0.2, 0.3, 0.35, 0.4, 0.45, 0.5 percent cells as waypoints.

Usage

cal_cor_dist(model_ref, model_sim, match_result)

Arguments

model_ref, model_sim

A matrix.

match_result

The result generated by match_cells function.

Value

A value ranged from 0 to 1

Examples

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

# Open Terminal and execute the command
# docker pull dynverse/ti_slingshot:v1.0.3

# 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

#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)
)
# Trajectory inference

# Match cells
match_result <- match_cells(ref_data = dataset_ref,
                            sim_data = dataset_sim)

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