Learn R Programming

RaceID (version 0.3.9)

cleanNN: Function for pruning k-nearest neighborhoods based on neighborhood overlap

Description

This function compares the neighborhood of a cell with the neighorhoods of all of its k nearest neighors and prunes links to neighbors that do not co-occur in a defined minimum number of neighborhoods by setting their link p-value (entry in pvM data.frame of res input object) to 0.

Usage

cleanNN(res, minN = 2, no_cores = NULL)

Value

A res object with update pvalue entries (pvM element).

Arguments

res

List object with k nearest neighbour information returned by pruneKnn function.

minN

Positive integer number. Minimum of neighborhoods across the k nearest neighbours of a cell expected to share a neighbor with the cell. Default is 2.

no_cores

Positive integer number. Number of cores for multithreading. If set to NULL then the number of available cores minus two is used. Default is NULL.