--- title: "Homework 3, CROPS 545, Spring 2020" author: "Your Name" date: "March 3, 2020" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## Professor: Zhiwu Zhang ## **Due on March 6, 2020, Friday, 3:10PM, PST** **Hand in:** Email your report (Rmarkdown and knitted .html file) with subject of "CROPS545_HW2" to Zhiwu.Zhang@WSU.edu. Written portions are limited to 500 words or less for each problem. Name your files with the following format: Homework2_firstname_lastname.Rmd and Homework2_firstname_lastname.html **Objectives:** 1) Simulate phenotypes from genotypes 2) GWAS by correlation 3) Evalueate true and false positives **Grading Criteria:** * Problem is adequately addressed * All code should be bug-free and well commented * Plots should be properly labeled * Written portions should be in sentence form and easy to read. **Remember:** You can use the echo=FALSE chunk option to hide your code in the .html file. Feel free to add extra sub-problem code chunks as necessary. ### **Problem 1 (20 Pts)** Sample 10 SNPs as QTNs out of the available SNPs. Simulate QTN effects from a standard normal distribution. Assign genetic effects for each of the 281 individuals. Simulate normal distributed residual effects with appropriate variance to have a heritability of 0.75. Add residual effects to genetic effects to create phenotypes. You can either use the G2P R function or your own custom function. Describe the distribution of genetic effects, residual effects, and phenotypes. Explore the relationships among them. ```{r problem1, echo=FALSE} # Your code goes here print('Hello World') ``` THIS IS AN EXAMLE OF WHERE YOUR WRITTEN ANSWERS WILL SHOW UP. ### **Problem, 2 (20 Pts)** Perform GWAS by using the correlation method. You can either use the GWASbyCor R function or code everything by yourself. Create a Manhattan plot and label the positions of the QTNs. ```{r problem2} # Your code goes here ``` ### **Problem 3 (20 Pts)** Determine how many QTNs are among the top ten associated SNPs. ```{r problem3} # Your code goes here ``` ### **Problem 4 (20 Pts)** Count the number of SNPs with P-values smaller than the P-value of the seventh significant QTN. ```{r problem4} # Your code goes here ``` ### **Problem 5 (20 Pts)** Redo problems 3-4 for 100 replicates. Report the averages and standard deviations. ```{r problem5} # Your code goes here ``` ### **Problem 6 (Extra Credit 20 Pts)** Simulate phenotypes from genotypes so that the phenotypes have a skewed normal distribution due to genetic effect with a long tail on the right. ```{r problem6} # Your code goes here ```