How it works...
Most of the code in this recipe is setup code. After loading libraries and fixing the random number generator for reproducibility with set.seed(), in the first step, we get the VCF file of useful variants loaded in, and in the second step, we extract some useful information: we get a matrix of genotypes with the geno(vcf)$GT call, which returns a matrix in which a row is a variant, a column is a sample, and the genotype is recorded at the intersection. We then use some accessor functions to pull sample and marker names and the reference sequence (chrom) and position (pos) for each variant. In Step 3, we define a translation function (convert()) to map VCF-style heterozygous and homozygous annotations to that used in GWAS() ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access