80 likes | 91 Views
353 - Bioinformatics Fall 2008. PEDNA Notes Mon, Oct 27, 2008 Marc L. Smith. PEDNA Ch. 13 Understanding Randomness. Don’t be fooled by what appears to be random Random-looking sequences may not be Seeming nonrandom sequences might be Computers don’t do random Really pseudorandom
E N D
353 - BioinformaticsFall 2008 PEDNA Notes Mon, Oct 27, 2008 Marc L. Smith
PEDNA Ch. 13Understanding Randomness • Don’t be fooled by what appears to be random • Random-looking sequences may not be • Seeming nonrandom sequences might be • Computers don’t do random • Really pseudorandom • Random enough (most of the time) • Eventually random numbers will cycle
rand() • Built-in perl function (convenient!) • Two forms • Without parameter • rand() returns fractional value: 0 <= val <= 1 • With parameter • rand(n) returns integer value: 0 <= val <= n
Simulations • Use rand() to write simulations • programs that simulate nondeterministic systems • nondeterministic doesn’t imply random • still pseudorandom • but nondeterminism lays the foundation for running Computational Experiments! • different runs of program may produce different outputs
Examples • Roll dice • Shuffle a sequence to randomize • Generate sequence of nucleotides • Mutate (evolve) a DNA sequence to simulate evolutionary process • Phylogeny reconstruction: heuristic search of tree space
PEDNA Code • Let’s look at the code from Ch. 13 • Code walks • Run / experiment / repeat
Hidden Markov Models (HMMs) • Alternative approach to aligning sequences • Essentially a Finite State Machine (FSM) • Set of states, including start state, end state, • State transitions occur probabilistically-- can use rand() to implement • Some transitions emit residues • Paths through FSM yield sequences • These sequences represent alignments
Hidden Markov Models • How would we use rand() to implement probabilistic FSM transitions? • When Jodi returns, we will discuss more about BLAST and HMMs • Read Ch. 6 in UB (especially sec. 6.2)