Nearest-Neighbor Identification¶
Identifies the top-N nearest neighbors per individual in normalized depth space using Euclidean distance (scikit-learn). Neighbors serve as an ancestry-matched reference panel for diploid copy number normalization.
- grid.utils.find_neighbors.find_neighbors(config, console=None)¶
Find nearest neighbors by calling the precompiled C++ executable, which matches Mukamel’s pipeline exactly.
- C++ argument order:
arg1: batch number (always 0 — single pass) arg2: total batches (always 1 — single pass) arg3: zMax arg4: ID_scale_zdepths input file arg5: output prefix (C++ appends .zMax<val>.txt.gz)
- Parameters:
config (dict) – Configuration data loaded from the config file.
console – Rich console object for logging.