Problem 1: Genotype and Allele Frequencies

Given the dataset available from:

https://charlotte-ngs.github.io/lbgfs2023/data/lbgfs2023_lbg_ex03.csv 

The dataset can be read using the following command

readr::read_delim("https://charlotte-ngs.github.io/lbgfs2023/data/lbgfs2023_lbg_ex03.csv", 
delim = ",") 

In the above dataset, genotypes are encoded as follows

LocusG LocusH Code
\(G_2G_2\) \(H_2H_2\) 0
\(G_1G_2\) \(H_1H_2\) 1
\(G_1G_1\) \(H_1H_1\) 2

Your Tasks

  • compute genotype frequencies
  • compute allele frequencies

Your Solution

  • Read the dataset and assign it to a tibble or dataframe
  • Compute genotype frequencies using either the function table() or a dplyr pipeline
  • From genotype frequencies compute allele frequencies

Problem 2: Check for Hardy-Weinberg Equilibrium

Use the dataset from Problem 1 and check for Hardy-Weinberg equilibrium at both loci using a \(\chi^2\) test.

Your Solution

  • Read the data
  • Compute genotype frequencies according to what would be expected following the Hary-Weinberg equilibrium
  • Use the function chisq.test() for the doing the test.

Latest Changes: 2023-09-29 07:27:15 (pvr)

LS0tCnRpdGxlOiBMaXZlc3RvY2sgQnJlZWRpbmcgYW5kIEdlbm9taWNzIC0gTm90ZWJvb2sgMwphdXRob3I6IFBldGVyIHZvbiBSb2hyCmRhdGU6ICcyMDIzLTA5LTI4JwpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKcGFyYW1zOgogIGRvY3R5cGU6CiAgICBsYWJlbDogRG9jdW1lbnQgVHlwZQogICAgdmFsdWU6IHNvbHV0aW9uCiAgICBjaG9pY2VzOgogICAgLSBleGVyY2lzZQogICAgLSBzb2x1dGlvbgogICAgLSBub3RlYm9vawogIGlzb25saW5lOgogICAgbGFiZWw6IE9ubGluZSAoeS9uKQogICAgdmFsdWU6IHRydWUKICAgIGNob2ljZXM6CiAgICAtIHRydWUKICAgIC0gZmFsc2UKLS0tCgoKCmBgYHtyIHNldHVwLCBpbmNsdWRlPUZBTFNFfQprbml0cjo6b3B0c19jaHVuayRzZXQoZWNobyA9IFRSVUUpCmBg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