You are on page 1of 27

Conversation 1

Tuesday April 7, 2020


Every week in the course

• Read the textbook, watch videos

• Work through the R tutorial

• Tune into class (here!) with questions

• Join your weekly “lab session” with your TA

• Drop-in to office hours (2 hours every day except


Thursday)
How to reach out for help

• Go through the reading and the tutorial, write down


questions

• Check on Piazza if the questions has been asked already

• Post your own question, engage in discussion

• Answer other people’s questions

• Contact your TA if you have a personal question; contact


the instructor if there is a general course question
Register for iClicker account

https://www.iclicker.com/students/

• Download the app for a phone or laptop

• Register for an account, select Biological Sciences,


University of Chicago as your institution

• Try polling!
How is the session going so far?

A. Legendary

B. Swell

C. I can’t see you

D. I can’t see you but it’s better this way


Did you receive a message from your TA about
your lab section and when it meets?

A. Yes

B. No

C. There are lab sections?


Have you installed R and R Studio and opened
R_week1 tutorial?

A. Yes to both

B. Yes only to installation

C. Wait, I have to install something?

D. I tried but it didn’t work


What is your intended major?

A. biology

B. neuroscience

C. physical science

D. not science
What would you like to do with your biology
education?

A. private industry

B. academic research

C. medicine/health

D. Other
Why quantitative modeling
• Much of biology is now based
on quantitative
measurements of complex
systems

• Make predictions based on


assumptions: mathematical
skills

• Run computational
simulations of predictive
models: R programming skills

• Work with data: describe,


analyze, test hypotheses:
statistical skills
How many letters (nucleotide pairs) are in the
human genome?

A. millions

B. Billions

C. Tens of billions

D. Trillions
How many new mutations does each human
inherit?

A. Tens

B. Hundreds

C. Thousands

D. Tens of thousands
de novo mutations
CLE • whole genome sequencing
of 2 parents and offspring

sequencing (see section on validation), a total of Proband autistic


tions, or an average of 63.2 per trio, were called. Proband schizophrenic

Number of de novo mutations called


tions •arecan Proband parent of autistic case
identify
listed mutations
individually in Supplementary 100
Other
specific to the offspring

and father’s age 80


which a child of the proband was also sequenced,
of each•demodeling
novo mutationquestion: what is as
called was determined
the relationship
nal haplotype of the proband was between
transmitted to 60
e child also carries the mutation, then the muta-
each parent’s age and the
to be paternal in origin. If the child carrying the
number
f the parent does notof new
have mutations?
the mutation, then it is 40
utation is on the maternal chromosome of the
ogic was applied when the child inherited the 15 20 25 30 35 40 45
of the proband. In the five trios, the average Age of father at conception of child (years)
and maternal mutations is 55.4 and 14.2, respect-
Figure 2 | Father’s age and number of de novo mutations. The number of de
utations were purely random with no systematic
rios, their number should be Poisson distributed Kong,
novo mutationset al. Nature
called is plotted2012
againstdoi:10.1038/nature11396
father’s age at conception of child for
the 78 trios. The solid black line denotes the linear fit. The dashed red curve is
ual to the mean. The data, however, show over- based on an exponential model fitted to the combined mutation counts. The
). This is much more notable for the paternal dashed blue curve corresponds to a model in which maternal mutations are
e 5 428.8, P 5 1.2 3 1025) than the maternal assumed to have a constant rate of 14.2 and paternal mutations are assumed to
the dimensionless number of cell divisions.

Math exercises:
Work through exercises
For each biological model belowin section
determine 2.1 of the
the dimensions
parameters, based on the given dimensions of the variables.

Exercise 2.1.1. Model of number of mutations M as a function of


time t:
M (t) = M0 + µt

Exercise 2.1.2. Model of molecular concentration C as a function


of time t:
C(t) = C0 e kt

Exercise 2.1.3. Model of tree height H (length) as a function of


age a (time):
ba
H(a) =
c+a
Exercise 2.1.4. Model of cooperative binding of ligands, with frac-
tion of bound receptors ✓ as a function of ligand concentration L:
Ln
✓(L) = n
L + Kd

32
What is the dimension of μ in question 2.1.1?

A.1/time

B.time

C.mutations/time

D.dimensionless
Work through exercises in section 2.1

Exercise 2.1.5. Model of concentration of a gene product G (con-


centration) as a function of time t:
↵t
G(t) = Gm (1 e )

Exercise 2.1.6. Michaelis-Menten model of enzyme kinetics, v is


reaction rate (1/time) and S is substrate concentration:

vmax S
v(S) =
Km + S

Exercise 2.1.7. Logistic model of population growth, P is popu-


lation size and time t:

Aekt
P (t) =
1 + B(ekt 1)

2.2 Functions and their graphs


A relationship between two variables addresses the basic question:
when one variable changes, how does this a↵ect the other? An
equation, like the examples in the last section, allows one to cal-
culate the value of one variable based on the other variable and
What is the dimension of Vmax in question 2.1.6?

A.1/time

B.concentration

C.time

D.dimensionless
What is the dimension of A in question 2.1.7?

A.population

B.time

C.population/time

D.dimensionless
First steps in R
concepts

• numbers and arithmetic in R

• variables and variable assignment

• Vector variables

• plotting
The first number in square bracket
The first
contains manynumber
numbersin square
and hasbracto b
contains
of the many numbers and has
calculation.
of thesymbols
calculation.
arithmetic The used for arithmetic
Theoperations,
symbols used
standard and for
^ isarithm
the s
standard
command operations,
prompt, and you andshould
^ is ths
• usual operations apply
command prompt, and you shoul
> 2^3
[1]> 82^3
• scientific notation is used
[1] 8
For numbers that are either very
For numbers that are either
digits, so R, like most computationa v
• some numbers are too large to
wantdigits, so R, like
to represent 1.4most computat
billion, you ty
store (overflow)

want to represent 1.4 billion, you


> 1.4*10^9
• some numbers are too small to [1]> 1.4e+09
1.4*10^9
store (underflow)
[1] 1.4e+09
You see that 10 to the ninth power i
You see thatsign.
multiplication 10 to the ninth pow
• error is present in any multiplication sign.
numerical computation
Tasks for Part 1
Tasks for Part 1
1. Find the value of pi raised to t
1. Find the value of pi raised
be used
After this in command
R too. How a
>after
x <-
like this: 5 been initia
it has
> x <- 6
variable assignment >> xx <-
While
<- 55
> x <-seemingly
6 contra
After
the valuethis5 command
and then ia
afteroperations
While
any itseemingly
has been initia
contra
that us
• variables are a symbolic means of referring to some the Entire
value 5expressions
and then c
information stored in computer memory
> x <- 5
any can
one operations
use that us
arithmetic
> x <- 6
For Entire
example, expressions
the follow c
• variable names cannot contain some symbols (like + While
one canseemingly contr
use arithmetic
or spaces) and cannot begin with a number
>Forx example,
the <- 5 5 and
value the then
follow
>anyy <- x+1
operations that u
> x <- 5
• that information can be a number, a bunch of Entiremore expressions
> y <- x+1 mind-b
Even
numbers, a string of letters, etc.
one can use
operator! Thearithmeti
R interp
ForEven
assigns example,
themore the follo
mind-b
result to th
operator!
of x by 1, The
you R inter
just hav
• variables in R are assigned values using ‘=’ or ‘<-’ > x <- 5
assigns the result to th
operators
> xy <-<- x+1x+1
>of x by 1, you just hav
Or Even
you canmore
do mind-b
a more
• a variable can be assigned different values at > x <- x+1
operator! The R inter
different times >Or yyou<- can
assigns y*x^3
the result
do to t
a more
of xWe byhave
1, you just
seen ha
exam
Name and
Name and
Address
Address
vector variables of
of Recipient
Recipient
• contain a bunch of numbers, called
elements

MyVec <- seq(0,1,0.1)


• can be assigned using a colon :
MyVec <- 1:20
MyVec <- c(-pi,45,0,10^5)
• can be assigned using
seq(start,stop,step)
MyVec <- seq(0,1,0.1)
MyVec <- seq(0,1,0.1)
• can be assigned using c(x,y,z)
MyVec <- 1:20
MyVec <- c(-pi,45,0,10^5)
Vector indexing
my.vec<-c(pi,45,912.8, 0)
print(my.vec)
## [1] 3.141593 45.000000 912.800000 0.000000

• Each element of a vector has an index (position in the


vector), referenced inside square brackets:
print(my.vec[2])
## [1] 45

• A vector of indices can be used to access multiple


elements
print(my.vec[2:4])
## [1] 45.0 912.8 0.0
The greatest power of vectors

• Vectors can be used to do


time <- 0:10
calculations on all elements quad <- (time - 5)^2
at once: print(time)
print(quad)

• Can even calculate with two my.vec1<-1:2


vectors at the same time my.vec2<-0:4

• But they must be the same


sum.vec<-my.vec1+my.vec2
length!
You can use the plot command in R to create two dimensional graphs
4 Plotting in R
variables of the same length, e.g. plot(x,y). The first variable (e.g. x) c
independent variable, which is plotted on the x-axis,
You cananduse
thethe
second
plotvariab
com
plotting in R variable (e.g. y) which is plottedvariables
the dependent on the y-axis. Here lengt
of the same is an
> x<-1:10 independent variable, which
> y<-2*x the dependent variable (e.g
• basic plotting requires two vector
> plot(x,y)
variables (unless you want to plot > x<-1:10
one If
vector against
you type index)
line, or paste in a> script
itscommand
this into y<-2*xand hit Source, you
> plot(x,y)
in the lower right window, which should look like 10 circles. This is the d
change it, you need to specify it. The following produces
If you a continuous
type this into comma li
• plot the
command has a bunch of
data points. in the lower right window,
options
change it, you need to spec
> plot(x,y,type=’l’)
the data points.
The plot command has options which you can change to determine the co
• can attributes
choose type of plot, thickness of > plot(x,y,type=’l’)
of the plot. The plot options are entered into the plot function,
line, plotted.
color, labels, etc.full list of options, type help(plot) in the command li
To see the The plot command has opt
is labeling your axes, which is done like this: attributes of the plot. The
plotted.time’)
> plot(x,y,type=’l’,xlab=’time’,ylab=’double To see the full list
is labeling your axes, which
Tasks for Part 4 > plot(x,y,type=’l’,xla
1. Create a vector of 5 di↵erent heart rates, using the second option
other plotting functions

• use lines() to overlay a plot on top of an existing one

• use curve() to make a function plot (like a graphing calculator!)

You might also like