PoisUMICalcWeightedDistances: Calculate Weighted Distances

Description Usage Arguments Details Value Examples

Description

Calculates a weighted distance between all pairs of cells.

Usage

1
PoisUMI_Calc_Weighted_Distances(norm_mat, weight_mat, exponent=2)

Arguments

norm_mat

a numeric matrix of normalized counts, columns = samples, rows = genes, see Details.

weight_mat

a numeric matrix of weights of equal dimension to norm_mat.

exponent

exponent or norm (p) of the distance, 2 = Euclidean.

Details

This function calculates the pair-wise weighted distance between all columns of norm_mat (cells) as the p-th root of the sum of absolute difference of expression for each gene take to the p-th power. Where p is the exponent or norm of the distance, and exponent = 1 corresponds to Manhattan distance and exponent = 2 corresponds to Euclidean distance.

D = ( sum(|x_A - x_B|^p) )^1/p

Value

A matrix of pair-wise distances between samples.

Examples

1
2
3
4
5
  library(M3DExampleData)
  fit <- PoisUMI_Fit_Full_Poisson(Mmus_example_list$data)
  weights <- PoisUMI_Calc_Weighted_Distances(Mmus_example_list$data, fit$lambdas, fit$alpha)
  norm <- PoisUMI_Normalize_Data(Mmus_example_list$data, fit)
  dist <- PoisUMI_Calc_Weighted_Distances(norm, weights, 1)

tallulandrews/PoissonUMIs documentation built on May 31, 2019, 2:56 a.m.