knitr::opts_chunk$set(echo = FALSE, results = 'asis')
nHomDiff <- 15 p_orig <- p <- 0.08 p_incr <- 1.2 * p q <- 1-p a <- nHomDiff/2 d <- -1.5 alpha <- a + (q-p)*d alpha_orig <- alpha
We are considering a quantitative trait that depends on a given bi-allelic locus $G$. The frequency of the favorable allele corresponds to $r p
$. Suppose that genotype frequencies follow the Hardy-Weinberg equilibrium. The difference between the homozygous genotypes corresponds to $r nHomDiff
$. The heterozygous genotype has a value of $r d
$.
a) Compute the breeding values and the dominance deviations for the three genotypes.
b) Because of selecting the positive allele the frequency has increased to r p_incr
. How does this increased allele frequency change the breeding values?
Hint: Have a look at the summary table of all values in the course notes.
What is the meaning of the term allele substituion an how big is it in 1a) and 1b)?
siris_url <- "https://charlotte-ngs.github.io/lbgfs2020/misc/iris_ex03.csv"
You can download a file in csv-format from the course website. The URL is r siris_url
. Read the data from that csv-file into R using the function read.csv2()
. Test the consequences of specifying the option stringsAsFactors=TRUE
. The function read_csv2()
from the readr
package is an alterative way to import data from a .csv-file. The result is a little different. While the function read.csv2()
returns an ordinary 'data.frame' as a result, the function read_csv2()
returns a 'tibble' which is a more modern version of a 'data.frame'.
Hints:
?read.csv2
at the R-console.read.csv2()
to a variablestr()
on the result of read.csv2()
to see the difference between the two results of reading the data.read_csv2()
to import the data and inspect the difference between a 'data.frame' and a 'tibble'.\pagebreak
Plot the values in the columns Sepal.Length
and Petal.Length
of the Iris data set. The plot should look like the following figure.
bIsSolution <- FALSE if(!bIsSolution) plot(iris$Sepal.Length, iris$Petal.Length)
The above plot was produced using the standard plotting function of the base-R system. The R-package ggplot2
provides an intersting alternative to the basic plotting function. A plot with ggplot2
looks as follows.
if(!bIsSolution) ggplot2::qplot(`Sepal.Length`, `Petal.Length`, data = iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.