CalcLD: Calculate LD

Description Usage Arguments Value

View source: R/funcivar.R

Description

Calculate the Linkage Disequilibrium between an index SNP and the rest of the SNPs in the VCF

Usage

1
CalcLD(vcf, index, population, return = "valid", force = TRUE)

Arguments

vcf

An object of class VCF, optionally processed with SetPopulation() to allow for calculating LD with a specific population.

index

A character vector that contains a SNP that is present in the vcf

population

An optional character vector specifying the population upon which to filter the samples in the vcf

return

A character vector, either 'valid' or 'all'. 'valid' returns valid SNPs from the vcf only, 'all' attempts to return all variants, including indels. In the case of 'all', still, only SNPs are used for calculating LD.

force

Logical indicating that even though LD has already been calculated upon this VCF, you wish to overwrite that information with the LD calculation of a new index.

Value

returns the vcf that was passed as an argument with it's rowRanges() modified to include the information relative to the index. Including ref, and alt alleles, allele frequencies (in the population queried), distance to the index, D prime and R squared.


Simon-Coetzee/funcivar documentation built on Aug. 2, 2021, 9:55 a.m.