Single marker GWAS

Gota Morota

March 25, 2020

This example illustrates how to perform single-marker GWAS using the rrBLUP R package.

Data

We will use the maize data available in the synbreedData R package.

rm(list = ls())
library(synbreedData)
data(maize)
`?`(maize)
names(maize)
y <- data.frame(ID = rownames(maize$pheno), pheno = maize$pheno[, 1, 1])
W <- maize$geno
W[W == 0] = -1  # convert 0 to -1
map <- maize$map

Single-marker GWAS

# install.packages('rrBLUP')
library(rrBLUP)
my.geno <- data.frame(marker = rownames(map), chrom = map[, 1], pos = map[, 
    2], t(W), check.names = FALSE)
my.geno[1:5, 1:10]  # display the frist 5 rows and 10 columns 
`?`(GWAS)
fit <- GWAS(y, my.geno, min.MAF = 0.05, P3D = TRUE, plot = FALSE)
head(fit)

Manhattan plot

# install.packages('qqman')
library(qqman)
manhattan(x = fit, chr = "chrom", bp = "pos", p = "pheno", snp = "marker", col = c("blue4", 
    "orange3"), logp = FALSE)