README.md

EVE102 Package: R Course Materials for Population Genetics

| | | |--------------------|---------------------------------------------------------------| |Time | Monday, Wednesday, Friday 10am-10:50am | |Location | Hart Hall 1150 | |Instructor | Graham Coop, 3342A Storer Hall, gmcoop [at] ucdavis [dot] edu | |Instructor Office Hour | 11am-12pm Wednesday, 3342A Storer Hall | |Teaching assistant | Vince Buffalo, vsbuffalo [at] ucdavis [dot] edu | |TA Office Hour | Thursday 10-11am, 2342 Storer Hall |

This R package contains data, functions, and documentation for EVE102, Population Genetics. The documentation is available in the R package itself (see below), or at the R package website: https://vsbuffalo.github.io/eve102/

Installing This R Package

To install this package, copy and paste the following into R:

install.packages("devtools", dependencies=TRUE)
library(devtools)
install_github("vsbuffalo/eve102", build_vignettes=TRUE)

Then, try the following:

library(eve102)
tutorials()

which should open up a list of tutorials in your browser.

Updating this Package

Throughout the course, we will make updates to this package and documentation. You can always check if your eve102 course package is up to date with:

eve102_status()

If your package is out of date, update it with:

eve102_update()

Accessing the R Tutorials

The R tutorials for this course are contained in this package. These will open the R tutorials in your default browser. To browse all tutorials, use:

library(eve102)
tutorials()

Then, click the "HTML" link for the tutorial you wish to read.

Specific tutorials can be accessed by providing a tutorial number. For example, to access the first tutorial, use:

tutorials(1)

Working with the EVE102 Datasets

This package contains all of the data you will need for the exercises in this course. Since learning to load data into R is a valuable skill you should learn, the data is stored in tab-separated value (TSV) files within the package. Depending on your system (Mac, Windows, or Linux), this data may live in different places, so to find the file path to the data, use the function eve102_data(). Calling this function without arguments returns all datasets:

> library(eve102)
> eve102_data()
  id                 file                                     description
1  1     CEU_10000.txt.gz             10,000 HapMap SNPs, CEU individuals
2  2 CEU_YRI_10000.txt.gz     10,000 HapMap SNPs, CEU and YRI individuals
3  3     YRI_10000.txt.gz             10,000 HapMap SNPs, YRI individuals
>

Then, you can get the file path for one of these files by calling the eve102_data() function, providing the filename you wish to get the path to:

> eve102_data("CEU_10000.txt.gz")
[1] "/usr/local/lib/R/3.3/site-library/eve102/extdata/CEU_10000.txt.gz"

This can then be used to load data in with R's read.table() function (since this is in tab-separated value format).

> d <- read.table(eve102_data("CEU_10000.txt.gz"), header=TRUE)
> head(d)
  chr           snp allele_A allele_a AA Aa aa  freq total
1   1 SNP_A-1909444        T        C 40 19  1 0.825    60
2   1 SNP_A-2237149        0        G  0  0 60 0.000    60
3   1 SNP_A-4303947        A        G 45 15  0 0.875    60
4   1 SNP_A-1886933        T        C  0 15 45 0.125    60
5   1 SNP_A-2236359        A        0 60  0  0 1.000    60
6   1 SNP_A-2205441        0        C  0  0 60 0.000    60


vsbuffalo/eve102 documentation built on May 3, 2019, 7:07 p.m.