8.7 Tidying VCF
We’ll first work with just the first SNP in the dataset, using the vcfR2tidy
function to isolate the SNP of interest and extract its genotypes.
## Extracting gt element GT
## # A tibble: 6 × 5
## ChromKey POS Indiv gt_GT gt_GT_alleles
## <int> <int> <chr> <chr> <chr>
## 1 1 558185 1001 0/0 A/A
## 2 1 558185 1002 0/0 A/A
## 3 1 558185 1003 0/0 A/A
## 4 1 558185 1004 0/1 A/G
## 5 1 558185 1005 0/0 A/A
## 6 1 558185 1006 0/1 A/G
Every row in the test_snp_gt
dataframe is a different individual in the VCF.