10/4/2013
MATLAB Function Files
A MATLAB function file (called an M-file) is a text (plain ASCII) file that
contains a MATLAB function and, optionally, comments.
The file is saved with the function na
R
Platform for statistical computing
- Powerful for manipulating/cleaning/visualising/making up
data
- Repeated actions via scripting
- Vast number of add-on utility packages
- Free under Gnu General
R
Platform for statistical computing
- Powerful for manipulating/cleaning/visualising/making up
data
- Repeated actions via scripting
- Vast number of add-on utility packages
- Free under Gnu General
9/26/2013
Variables and Arrays
Variables are named locations in memory where
numbers, strings and other elements of data may be
stored while the program is working.
Variable names are combinations of
10/10/2013
Scalar arithmetic
Assigment statements are of the form
variable_name = expression
Scalar operators:
Addition, subtraction:
Multiplication, division:
Exponentiation:
a+b
a*b
a^b
a-b
a/b
When
3/11/14
Markov chains part 2
Genetic Information
Gene basic unit of genetic
information. Genes determine the
inherited characters.
Genome the collection of
genetic information.
Chromosomes s
10/17/2013
Data files using load/save
Probably the easiest way to import data into a Matlab
program is from a tab delimited file. Excel can export
tables in tab-delimited format. These can be read usi
Gene regulation
TF1
Gene expression
TF2
TF3
TF4
At any given moment genes may or may not be producing protein
Proteins called transcription factors (TFs) control the level of activation
(or expression
3/6/14
Markov chains
Probability distribu9ons
1
3/6/14
Exercise
1. Use the Matlab func9on nchoosek(n,k) to implement a
generic func9on BinomialPMF(k,n,p) for calcula9ng the
Control of Gene
Expression
Neuron and lymphocyte
Different morphology, same genome
Genomes contain in the DNA sequence the information to make many thousands of
different RNA and protein molecules
A c
Ordinary Differential Equations 1
Single variable systems
Simplest ODE (linear, single variable) is the
model for exponential decay:
which has an analytical solution x(t) = Cekt
where C is a constant
Difference equations 2
Selection in diploid organisms
The Fisher-Wright model was a model of a
finite size population with no selection.
We will now incorporate selection into the
model.
Asexual
Re
Difference equations
Difference equations
A single-variable discrete dynamical system can
be defined as:
x(t + 1) = f(x(t)
For example:
x(t + 1) = x(t)2
Complex numbers
Complex variables are created
Markov chains part 2
Genetic Information
Gene basic unit of genetic
information. Genes determine the
inherited characters.
Genome the collection of
genetic information.
Chromosomes storage units of
Markov chains
Probability distributions
n choose k
Exercise
1. Use the Matlab function nchoosek(n,k) to implement a
generic function BinomialPMF(k,n,p) for calculating the
Binomial PMF with k successe
Low-level Input/Output
The load command does not always succeed in
reading an input file. It only works when all lines
in the file have the same ASCII format. Files with
header material do not qualif
Linear algebra and regression
Solving linear equations
The simplest system of linear equations has
two equations and two variables, for example:
This system can be represented using matrices
and vec
Review
Basic plotting command is plot(x,y)
To plot a function we often use x=a:b:n, then y = f(x)
Can customize using line specifiers: plot(x,y,-g*)
Use subplot(m,n,i) for mxn array of plots.
Can use
ODEs part 3
Network model example
Model considers positive feedback
loops involving signalling pathways
and/or gene regulation.
Multiple interlinked loops that
combine fast and slow kinetics
Yeast cel
Control of Gene
Expression
Neuron and lymphocyte
Different morphology, same genome
Genomes contain in the DNA sequence the information to make many thousands
of different RNA and protein molecules
A c
Ordinary Differential
Equations 1
Single variable systems
Simplest ODE (linear, single variable) is the
model for exponential decay:
which has an analytical solution x(t) = Cekt
where C is a constant
Markov chains part 2
Genetic Information
Geneb a s ic u nito fg e ne tic
info rm a tio n.G e n e s d e te rm in e th e
inh e rite d c h a ra c te rs .
Genometh e c o lle c tio no fg e n e tic
info
2) Markov property: only current state determines next state.
-Consider simple Markov chain with transition probability matrix
P =[1 0 0; a b g;0 0 1] , , >0
States 0 and 2 are absorbing
State 1 is tr
Difference equations 2
Selection in diploid organisms
The Fisher-Wright model was a model of a
finite size population with no selection.
We will now incorporate selection into the
model.
Reproduction