get_closepairs_fraction: get_closepairs_fraction

View source: R/get_closepairs_fraction.R

get_closepairs_fractionR Documentation

get_closepairs_fraction

Description

This function takes a distance matrix and finds all pairs of samples that are within a distance cutoff determined by a specified fraction of distances. The pairs are returned as an nx2 matrix, where n is the number of close pairs, and the elements of the matrix are the indices of the samples in that close pair in the distance matrix. Plotting the histogram with the cutoff is optional.

Usage

get_closepairs_fraction(distance_matrix, distance_fraction, show_hist, verbose)

Arguments

distance_matrix

A distance matrix

distance_fraction

The fraction of distances to be included in the close pairs.

show_hist

Boolean indicator for whether or not to plot a histogram of the distances and cutoff. Uses ggplot defaults for bins.

verbose

TRUE to show distance cutoff, FALSE to not

Examples

get_closepairs_fraction(distance_matrix, 0.1) # This will yield all pairs that are in the smallest 10% for pairwise distance.

weissmanlab/decotur documentation built on Sept. 4, 2024, 6:49 a.m.