Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Allele frequency comparisons with PLINK
- # Comparisons between multiple groups using --within
- # Clear workspace
- rm(list = ls())
- # Set working directory
- setwd("d:/analysis/2020_GenomicsBootCamp_Demo/")
- library(tidyverse)
- # Read in the data - ADAPTmap
- goats <- read_tsv("ADAPTmap_genotypeTOP_20160222_full.fam", col_names = F)
- # select goats from target countries and apply country label
- countryLabels <- goats %>%
- mutate(country = case_when(
- substr(X2,1,2) == "ET" ~ "Ethiopia",
- substr(X2,1,2) == "IT" ~ "Italy",
- substr(X2,1,2) == "PK" ~ "Pakistan"
- )) %>%
- drop_na() %>%
- select(X1, X2, country) %>%
- write_delim("countryComparisonSnpFreq.txt")
- # Keep only these animals for a PLINK run and perform alle frequency analysis
- system(str_c("plink --bfile ADAPTmap_genotypeTOP_20160222_full --chr-set 29 --autosome ",
- "--keep countryComparisonSnpFreq.txt --nonfounders ",
- "--freq --within countryComparisonSnpFreq.txt ",
- "--out countrySnpFrequencies"))
Advertisement
RAW Paste Data
Copied
Advertisement