View source: R/relationship_qc.R
| check_replicates | R Documentation |
This function checks the compatibility between sample genotypes in a VCF file by comparing all pairs of samples.
check_replicates(path.vcf, select_samples = NULL, verbose = TRUE)
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. |
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.
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.
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.