View source: R/get_closepairs_fixednumber.R
get_closepairs_fixednumber | R Documentation |
This function takes a distance matrix and finds all pairs of samples that are within a distance cutoff determined by a specified number of close pairs. If there are too many close pairs that could be below this threshold, then a random sample of these close pairs is returned. User must specify a seed. 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.
get_closepairs_fixednumber(
distance_matrix,
number_close_pairs,
seed,
show_hist,
verbose
)
distance_matrix |
A distance matrix |
number_close_pairs |
The number of close pairs to be returned |
seed |
Random seed for down-sampling if necessary |
show_hist |
Boolean indicator for whether or not to plot a histogram of the distances and cutoff. Uses ggplot defaults for bins. |
verbose |
TRUE for returning distance cutoff used, FALSE for not |
get_closepairs_fixednumber(distance_matrix, 5000, 1, T) # This will yield the 5000 closest pairs, with random seed 1.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.