get_mahalanobis_distance: Calculates the squared Mahalanobis distance from the centroid...

get_mahalanobis_distanceR Documentation

Calculates the squared Mahalanobis distance from the centroid of the barcoded sample

Description

Calculates the squared Mahalanobis distance from the centroid of the barcoded sample

Usage

get_mahalanobis_distance(m, bc.res, sep.threshold)

Arguments

m

The data matrix

bc.res

The debarcoding results

sep.threshold

The minimum separation in the intensity of the barcoding channels. Barcode assignments are performed based on this threshold. Then the function calculates the Mahalanobis distance between each event and the centroid of the debarcoded sample, as assigned using this threshold.

Value

Returns a vector of squared Mahalanobis distances, as calculated by stats::mahalanobis. The distance values are capped at 30. If the distance calculation fails the corresponding vector values will be NA


ParkerICI/premessa documentation built on Sept. 16, 2022, 3:06 p.m.