## crop 545 lab 5 ## beagle, hapmap, imputation black = "C:/Users/yuanh/Documents/Dropbox/COURSE/CROP_545/2018/lab5" usb = "T:/lab5" setwd(black) list.files() ## 1. Get data ready ---- # 1.1 loading ---- # since the data set is too large, I have already loaded it. # you should try and load the data # to avoid crashing, don't "View" your full data fulldata = read.table("./F1-Hybrids_(Seymour_et_al_2016__PNAS)_/genotype.ped", header=T) fulldata[1:3, 1:10] source("hapmap2df.txt") # 1.2 subsampling ---- myHapmap = fulldata[1:100, 1000:6001] myGen = hapmap2df(myHapmap) # save the data write.csv2(myHapmap, "myHapmap.csv", row.names = F) myHapmap = read.csv2("myHapmap.csv", header = T) # 2. Explore the data ---- assigning missing value ---- ?? # 1.