This function identifies the valley that tends to be outliers compared to other valley locations and tries to find the closest samples that have similar density distribution to input the valley. If no neighbor sample is detected, the valley will remain as original.
get_neighbors(
target_sample,
adt_marker_select,
cell_x_adt,
cell_x_feature,
nearest_neighbor_n = 3,
nearest_neighbor_threshold = NULL
)
The target sample whose valley needs to be imputed. Find the neighbor samples whose density distribution is close to the target sample.
The marker whose valley needs to be imputed. Find the neighbor samples whose density distribution is close to the target sample of the same ADT marker.
Matrix of ADT raw counts in cells (rows) by ADT markers (columns) format.
Matrix of cells (rows) by cell features (columns) such as cell type, sample, and batch-related information.
Number of top nearest neighbor samples to detect.
Threshold to call neighbor samples.
if (FALSE) {
get_neighbors(target_sample, adt_marker_select, cell_x_adt, cell_x_feature)
}