Aligns ancestry clusters with a Hungarian assignment using a nonnegative combination of column-wise Pearson correlation and cosine similarity. Both inputs must have identical sample order and dimensions.
Usage
align_ancestry_replicate(target, reference, tolerance = 1e-06)
Arguments
- target
Numeric Q matrix or PopgenVCFAncestryReplicate to align.
- reference
Numeric Q matrix or replicate defining the desired cluster order.
- tolerance
Numerical tolerance for ancestry replicate validation.
Value
A PopgenVCFAncestryAlignment containing the aligned Q matrix, aligned replicate when applicable, permutation vector and matrix, correlation, cosine and combined similarity matrices, RMSD, and alignment scores.