Learn R Programming

BIGr (version 0.6.2)

check_replicates: 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)

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.

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.

Examples

Run this code

#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)


Run the code above in your browser using DataLab