Biol20N02 2016: Difference between revisions
imported>Weigang m (→Course Outline) |
imported>Weigang |
||
Line 61: | Line 61: | ||
===Feb 16. Introduction & tutorials for R/R studio=== | ===Feb 16. Introduction & tutorials for R/R studio=== | ||
# Tutorial 3: Vector (Continued) | # Tutorial 3: Vector (Continued) | ||
<syntaxhighlight lang=R"> | |||
x <- c(1,2,3,4,5) # construct a vector using the c() function | |||
x # show x | |||
2 * x + 1 # arithmetic operations, applied to each element | |||
exp(x) # exponent function (base e) | |||
x <- 1:5 # alternative way to construct a vector, if consecutive | |||
x <- seq(from = -1, to = 14, by = 2) # use the seq() function to create a numeric series | |||
x <- rep(5, times = 10) # use the rep() function to create a vector of same element | |||
x <- rep(NA, times = 10) # pre-define a vector with unknown elements | |||
# Apply vector functions | |||
length(x) | |||
sum(x) | |||
mean(x) | |||
range(x) | |||
# Access vector elements | |||
x[1] | |||
x[1:3] | |||
x[-2] | |||
# Character vectors | |||
</syntaxhighlight> | |||
# Tutorial 4: Matrix | # Tutorial 4: Matrix | ||
# Tutorial 5. Data Frame | # Tutorial 5. Data Frame | ||
Line 72: | Line 92: | ||
# Data Frame | # Data Frame | ||
|} | |} | ||
===Feb 23. Statistics & samples=== | ===Feb 23. Statistics & samples=== | ||
===March 1. Displaying data=== | ===March 1. Displaying data=== |
Revision as of 18:48, 13 February 2016
Course Description
With rapid accumulation of genome sequences and digitalized health data, biomedicine is becoming a data-intensive science. This course is a hands-on, computer-based workshop on how to visualize and analyze large quantities of biological data. The course introduces R, a modern statistical computing language and platform. Students will learn to use R to make scatter plots, bar plots, box plots, and other commonly used data-visualization techniques. The course will review statistical methods including hypothesis testing, analysis of frequencies, and correlation analysis. Student will apply these methods to the analysis of genomic and health data such as whole-genome gene expressions and SNP (single-nucleotide polymorphism) frequencies.
This 3-credit experimental course fulfills elective requirements for Biology Major I. Hunter pre-requisites are BIOL100, BIOL102 and STAT113.
Learning Goals
- Be able to use R as a plotting tool to visualize large-scale biological data sets
- Be able to use R as a statistical tool to summarize data and make biological inferences
- Be able to use R as a programming language to automate data analysis
Textbooks
- R Studio (Required): Learning RStudio for R Statistical Computing
- Digital textbook (Required): Data Analysis for the Life Sciences
Exams & Grading
- Attendance (or a note in case of absence) is required
- In-Class Exercises (50 pts).
- Assignments. All assignments should be handed in as hard copies only. Email submission will not be accepted. Late submissions will receive 10% deduction (of the total grade) per day.
- Three Mid-term Exams (3 X 30 pts each = 90 pts)
- Comprehensive Final Exam (50 pts)
- Bonus for active participation in classroom discussions
Course Outline
Feb 2. Introduction & tutorials for R/R studio
- Course overview
- Install R & RStudio on your home computers (Chapter 1. pg. 9)
- Tutorial 1: First R Session (pg. 12)
- Create a new project by navigating: File | New Project | New Directory. Name it project file "Abalone"
- Import abalone data set: Tools | Import DataSet | From Web URL, copy & paste this address: http://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data
- Assign column names:
colnames(abalone) <- c("Sex", "Length", "Diameter", "Height", "Whole_Weight", "Shucked_weight", "Viscera_weight", "Shell_weight", "Rings")
- Save data into a file:
write.csv(abalone, "abalone.csv", row.names = FALSE)
- Create a new R script: File | New | R script. Type the following commands:
abalone <- read.csv("abalone.csv"); boxplot(Length ~ Sex, data = abalone)
- Save as "abalone.R" using File | Save
- Execute R script:
source("abalone.R")
- Install the notebook package:
install.packages("knitr")
- Compile a Notebook: File | Compile Notebook | HTML | Open in Browser
- Tutorial 2. Writing R Scripts (Chapter 2. pg. 21)
- Tutorial 3. Vector
Assignment #1. Due 2/16, Tuesday (Finalized) |
---|
|
Feb 9. No class (Friday Schedule)
Feb 16. Introduction & tutorials for R/R studio
- Tutorial 3: Vector (Continued)
x <- c(1,2,3,4,5) # construct a vector using the c() function
x # show x
2 * x + 1 # arithmetic operations, applied to each element
exp(x) # exponent function (base e)
x <- 1:5 # alternative way to construct a vector, if consecutive
x <- seq(from = -1, to = 14, by = 2) # use the seq() function to create a numeric series
x <- rep(5, times = 10) # use the rep() function to create a vector of same element
x <- rep(NA, times = 10) # pre-define a vector with unknown elements
# Apply vector functions
length(x)
sum(x)
mean(x)
range(x)
# Access vector elements
x[1]
x[1:3]
x[-2]
# Character vectors
- Tutorial 4: Matrix
- Tutorial 5. Data Frame
Assignment #2. Due 2/23, Tuesday |
---|
|