Identifies sample pairs that stay identical (within threshold) across every SNP block, scanning the markers in blocks of blcsize. Each block only re-checks the samples still in a confirmed pair, and pairs that separate in any block are dropped, so the result is the intersection of the per-block identical pairs.

check.identical.samples.by.block(genotypes, blcsize, threshold = 0)

Arguments

genotypes

Genotype matrix (samples x SNPs) or SnpMatrix with sample names as rownames.

blcsize

Block size (number of SNPs).

threshold

Distance threshold. Default 0.

Value

A data.frame of identical sample pairs (columns Sample1, Sample2, Distance); Distance is taken from the first block. Empty data.frame if none.

Examples

set.seed(1)
mat <- matrix(sample(1:3, 40, TRUE), nrow = 4)
rownames(mat) <- paste0("S", 1:4)
check.identical.samples.by.block(mat, blcsize = 5, threshold = 0)
#> Analyzing block 1-5
#> [1] Sample1  Sample2  Distance
#> <0 rows> (or 0-length row.names)