check_replicates: Compatibility Between Samples Genotypes

View source: R/relationship_qc.R

check_replicatesR Documentation

Compatibility Between Samples Genotypes

Description

This function checks the compatibility between sample genotypes in a VCF file by comparing all pairs of samples.

Usage

check_replicates(path.vcf, select_samples = NULL, verbose = TRUE)

Arguments

path.vcf

A string specifying the path to the VCF file containing genotype data.

select_samples

An optional character vector of sample names to be selected for comparison. If NULL (default), all samples in the VCF file are used.

verbose

A logical value indicating whether to print the number of combinations tested. Default is TRUE.

Details

The function removes reciprocal comparisons (e.g., A vs. B and B vs. A) and self-comparisons (e.g., A vs. A) to avoid redundancy. Compatibility is calculated as the percentage of matching genotypes between two samples, excluding missing values. The percentage of missing genotypes is also reported for each pair.

Value

A data frame with four columns:

  • sample1: The name of the first sample in the pair.

  • sample2: The name of the second sample in the pair.

  • %_matching_genotypes: The percentage of compatible genotypes between the two samples.

  • %_missing_genotypes: The percentage of missing genotypes in the comparison.

Examples


#Example VCF
example_vcf <- system.file("iris_DArT_VCF.vcf.gz", package = "BIGr")

# Checking for replicates
check_tab <- check_replicates(path.vcf = example_vcf, select_samples = NULL)



BIGr documentation built on Nov. 5, 2025, 6:03 p.m.