Codon-model based inference of selection pressure. (a very brief review prior to the PAML lab)

Similar documents
types of codon models

part 3: analysis of natural selection pressure

Natural selection on the molecular level

Practical Bioinformatics

Statistics for Biology and Health. Series Editors K. Dietz, M. Gail, K. Krickeberg, A. Tsiatis, J. Samet

SEQUENCE ALIGNMENT BACKGROUND: BIOINFORMATICS. Prokaryotes and Eukaryotes. DNA and RNA

part 4: phenomenological load and biological inference. phenomenological load review types of models. Gαβ = 8π Tαβ. Newton.

Why do more divergent sequences produce smaller nonsynonymous/synonymous

codon substitution models and the analysis of natural selection pressure

Advanced topics in bioinformatics

Sequence Divergence & The Molecular Clock. Sequence Divergence

SUPPORTING INFORMATION FOR. SEquence-Enabled Reassembly of β-lactamase (SEER-LAC): a Sensitive Method for the Detection of Double-Stranded DNA

Introduction to Molecular Phylogeny

Crick s early Hypothesis Revisited

Supplementary Information for

Probabilistic modeling and molecular phylogeny

Supplemental data. Pommerrenig et al. (2011). Plant Cell /tpc

High throughput near infrared screening discovers DNA-templated silver clusters with peak fluorescence beyond 950 nm

Nature Structural & Molecular Biology: doi: /nsmb Supplementary Figure 1

Characterization of Pathogenic Genes through Condensed Matrix Method, Case Study through Bacterial Zeta Toxin

3. Evolution makes sense of homologies. 3. Evolution makes sense of homologies. 3. Evolution makes sense of homologies

NSCI Basic Properties of Life and The Biochemistry of Life on Earth

Clay Carter. Department of Biology. QuickTime and a TIFF (Uncompressed) decompressor are needed to see this picture.

Electronic supplementary material

SSR ( ) Vol. 48 No ( Microsatellite marker) ( Simple sequence repeat,ssr),

Number-controlled spatial arrangement of gold nanoparticles with

SUPPLEMENTARY DATA - 1 -

Protein Threading. Combinatorial optimization approach. Stefan Balev.

Supporting Information for. Initial Biochemical and Functional Evaluation of Murine Calprotectin Reveals Ca(II)-

7. Tests for selection

The Trigram and other Fundamental Philosophies

Modelling and Analysis in Bioinformatics. Lecture 1: Genomic k-mer Statistics

Evolvable Neural Networks for Time Series Prediction with Adaptive Learning Interval

Likelihood Ratio Tests for Detecting Positive Selection and Application to Primate Lysozyme Evolution

Understanding relationship between homologous sequences

Supporting Information

TM1 TM2 TM3 TM4 TM5 TM6 TM bp

Evolutionary Analysis of Viral Genomes

Aoife McLysaght Dept. of Genetics Trinity College Dublin

POPULATION GENETICS Biology 107/207L Winter 2005 Lab 5. Testing for positive Darwinian selection

Supplemental Figure 1.

SUPPLEMENTARY INFORMATION

Building a Multifunctional Aptamer-Based DNA Nanoassembly for Targeted Cancer Therapy

Maximum Likelihood Estimation on Large Phylogenies and Analysis of Adaptive Evolution in Human Influenza Virus A

Table S1. Primers and PCR conditions used in this paper Primers Sequence (5 3 ) Thermal conditions Reference Rhizobacteria 27F 1492R

Regulatory Sequence Analysis. Sequence models (Bernoulli and Markov models)

Using algebraic geometry for phylogenetic reconstruction

6.047 / Computational Biology: Genomes, Networks, Evolution Fall 2008

Codon Distribution in Error-Detecting Circular Codes

Accuracy and Power of the Likelihood Ratio Test in Detecting Adaptive Molecular Evolution

Supplemental Table 1. Primers used for cloning and PCR amplification in this study

"Nothing in biology makes sense except in the light of evolution Theodosius Dobzhansky

SUPPLEMENTARY INFORMATION

SENCA: A codon substitution model to better estimate evolutionary processes

Supplementary Information

Bayes Empirical Bayes Inference of Amino Acid Sites Under Positive Selection

RELATING PHYSICOCHEMMICAL PROPERTIES OF AMINO ACIDS TO VARIABLE NUCLEOTIDE SUBSTITUTION PATTERNS AMONG SITES ZIHENG YANG

Evolutionary dynamics of abundant stop codon readthrough in Anopheles and Drosophila

Lecture Notes: BIOL2007 Molecular Evolution

THE MATHEMATICAL STRUCTURE OF THE GENETIC CODE: A TOOL FOR INQUIRING ON THE ORIGIN OF LIFE

The role of the FliD C-terminal domain in pentamer formation and

Biosynthesis of Bacterial Glycogen: Primary Structure of Salmonella typhimurium ADPglucose Synthetase as Deduced from the

Sex-Linked Inheritance in Macaque Monkeys: Implications for Effective Population Size and Dispersal to Sulawesi

Objective: You will be able to justify the claim that organisms share many conserved core processes and features.

The 3 Genomic Numbers Discovery: How Our Genome Single-Stranded DNA Sequence Is Self-Designed as a Numerical Whole

Re- engineering cellular physiology by rewiring high- level global regulatory genes

Phylogenetic Tree Reconstruction

POPULATION GENETICS Winter 2005 Lecture 17 Molecular phylogenetics

Encoding of Amino Acids and Proteins from a Communications and Information Theoretic Perspective

PAML 4: Phylogenetic Analysis by Maximum Likelihood

Dr. Amira A. AL-Hosary

evoglow - express N kit distributed by Cat.#: FP product information broad host range vectors - gram negative bacteria

It is the author's version of the article accepted for publication in the journal "Biosystems" on 03/10/2015.

Amira A. AL-Hosary PhD of infectious diseases Department of Animal Medicine (Infectious Diseases) Faculty of Veterinary Medicine Assiut

Supplementary information. Porphyrin-Assisted Docking of a Thermophage Portal Protein into Lipid Bilayers: Nanopore Engineering and Characterization.

ChemiScreen CaS Calcium Sensor Receptor Stable Cell Line

Edward Susko Department of Mathematics and Statistics, Dalhousie University. Introduction. Installation

evoglow - express N kit Cat. No.: product information broad host range vectors - gram negative bacteria

AtTIL-P91V. AtTIL-P92V. AtTIL-P95V. AtTIL-P98V YFP-HPR

Evolutionary Change in Nucleotide Sequences. Lecture 3

An Evaluation of Different Partitioning Strategies for Bayesian Estimation of Species Divergence Times

Constructing Evolutionary/Phylogenetic Trees

Near-instant surface-selective fluorogenic protein quantification using sulfonated

Massachusetts Institute of Technology Computational Evolutionary Biology, Fall, 2005 Notes for November 7: Molecular evolution

Molecular phylogeny - Using molecular sequences to infer evolutionary relationships. Tore Samuelsson Feb 2016

Using phylogenetics to estimate species divergence times... Basics and basic issues for Bayesian inference of divergence times (plus some digression)

Maximum-Likelihood Analysis of Molecular Adaptation in Abalone Sperm Lysin Reveals Variable Selective Pressures Among Lineages and Sites

Molecular Evolution, course # Final Exam, May 3, 2006

(2017) Comparison of Two Possible Evolutionary. Mechanisms of the 62 trna Codon Sequences

Drosophila melanogaster and D. simulans, two fruit fly species that are nearly

Supplementary Information

Comparative genomics. Ovidiu Paun

Supplementary Information for Hurst et al.: Causes of trends of amino acid gain and loss

How DNA barcoding can be more effective in microalgae. identification: a case of cryptic diversity revelation in Scenedesmus

Diversity of Chlamydia trachomatis Major Outer Membrane

Supplemental Figure 1. Differences in amino acid composition between the paralogous copies Os MADS17 and Os MADS6.

Bio 1B Lecture Outline (please print and bring along) Fall, 2007

An Analytical Model of Gene Evolution with 9 Mutation Parameters: An Application to the Amino Acids Coded by the Common Circular Code

Timing molecular motion and production with a synthetic transcriptional clock

Supplementary Figure 1. Schematic of split-merger microfluidic device used to add transposase to template drops for fragmentation.

Transcription:

Codon-model based inference of selection pressure (a very brief review prior to the PAML lab)

an index of selection pressure rate ratio mode example dn/ds < 1 purifying (negative) selection histones dn/ds =1 Neutral Evolution pseudogenes dn/ds > 1 Diversifying (positive) selection MHC, Lysin

phenomenological models macroevolutioanry time-scale population time-scale omega models! Q ij = 0 if i and j differ by > 1 π j κπ j ωπ j ωκπ j for synonymous tv. for synonymous ts. for non-synonymous tv. for non-synonymous ts. Goldman(and(Yang((1994)( Muse(and(Gaut((1994)( phenomenological parameters ts/tv ratio: κ codon frequencies: π j ω = dn/ds parameter estimation via ML stationary process

model based inference 3 analytical tasks task 1. parameter estimation (e.g., ω) task 2. hypothesis testing task 3. make predictions (e.g., sites having ω > 1 )

phenomenological models macroevolutioanry time-scale population time-scale omega models! Q ij = 0 if i and j differ by > 1 π j κπ j ωπ j ωκπ j for synonymous tv. for synonymous ts. for non-synonymous tv. for non-synonymous ts. Goldman(and(Yang((1994)( Muse(and(Gaut((1994)( phenomenological parameters ts/tv ratio: κ codon frequencies: π j ω = dn/ds parameter estimation via ML stationary process

task 1: parameter estimation How to model codon frequencies? example: A C AAA CAA AAA ACA AAA AAC Δ at codon position 1 st 2 nd 3 rd GY π CAA π ACA π AAC Either way, these are empirically estimated. MG π c 1 π c 2 π c 3

phenomenological models macroevolutioanry time-scale population time-scale omega models! Q ij = 0 if i and j differ by > 1 π j κπ j ωπ j ωκπ j for synonymous tv. for synonymous ts. for non-synonymous tv. for non-synonymous ts. Goldman(and(Yang((1994)( Muse(and(Gaut((1994)( phenomenological parameters ts/tv ratio: κ codon frequencies: π j ω = dn/ds parameter estimation via ML stationary process

Sooner or later you ll get it task 1: parameter estimation Parameters: t and ω Gene: acetylcholine α receptor common ancestor Sooner or later you ll get it lnl = -2399

Sooner or later you ll get it Exercise 1: ML estimation of the d N /d S ( ) ratio by hand for GstD1-750 -755-760 0.05 0.1 0.2-765 0.01 0.4-770 0.005 0.8-775 1.6-780 2.0-785 -790 0.001-795 0.001 0.01 0.1 1 10 Sooner or later you ll get it

task 1: parameter estimation transitions vs. transversions: A G ts/tv = 2.71 C T preferred vs. un-preferred codons: partial codon usage table for the GstD gene of Drosophila ------------------------------------------------------------------------------ Phe F TTT 0 Ser S TCT 0 Tyr Y TAT 1 Cys C TGT 0 TTC 27 TCC 15 TAC 22 TGC 6 Leu L TTA 0 TCA 0 *** * TAA 0 *** * TGA 0 TTG 1 TCG 1 TAG 0 Trp W TGG 8 ------------------------------------------------------------------------------ Leu L CTT 2 Pro P CCT 1 His H CAT 0 Arg R CGT 1 CTC 2 CCC 15 CAC 4 CGC 7 CTA 0 CCA 3 Gln Q CAA 0 CGA 0 CTG 29 CCG 1 CAG 14 CGG 0 ------------------------------------------------------------------------------

uncorrected evolutionary bias leads to estimation bias 4 3 low codon bias 4 3 med codon bias true simple model d S 2 d S 2 ts/tv + codon bias 1 1 0 5 0 0.4 0.8 1.2 1.6 2 2.4 2.8 t high codon bias 0 5 0 0.4 0.8 1.2 1.6 2 2.4 2.8 t extreme codon bias 4 4 d S 3 2 d S 3 2 1 1 0 0 0.4 0.8 1.2 1.6 2 2.4 2.8 t 0 0 0.4 0.8 1.2 1.6 2 2.4 2.8 t data from: Dunn, Bielawski, and Yang (2001) Genetics, 157: 295-305

task 1: parameter estimation ds and dn must be corrected for BOTH the structure of genetic code and the underlying mutational process of the DNA but, this can differ among lineages and genes! correcting ds and dn for underlying mutational process of the DNA makes them sensitive to assumptions about the process of evolution!

Exercise 2: investigate sensitivity of d N /d S ( ) to assumptions transitions vs. transversions A G C T preferred vs. un-preferred codons partial codon usage table for the GstD gene of Drosophila ------------------------------------------------------------------------------ Phe F TTT 0 Ser S TCT 0 Tyr Y TAT 1 Cys C TGT 0 TTC 27 TCC 15 TAC 22 TGC 6 Leu L TTA 0 TCA 0 *** * TAA 0 *** * TGA 0 TTG 1 TCG 1 TAG 0 Trp W TGG 8 ------------------------------------------------------------------------------ Leu L CTT 2 Pro P CCT 1 His H CAT 0 Arg R CGT 1 CTC 2 CCC 15 CAC 4 CGC 7 CTA 0 CCA 3 Gln Q CAA 0 CGA 0 CTG 29 CCG 1 CAG 14 CGG 0 ------------------------------------------------------------------------------

model based inference 3 analytical tasks task 1. parameter estimation (e.g., ω) task 2. hypothesis testing task 3. make predictions (e.g., sites having ω > 1 )

task 2: likelihood ratio test for varied selection among sites H 0 : uniform selective pressure among sites (M0) H 1 : variable selective pressure among sites (M3) Compare 2Δl = 2(l 1 - l 0 ) with a χ 2 distribution Model 0 Model 3 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 ωˆ = 0.65 ωˆ ωˆ ωˆ = 0.01 = 0.90 = 5.55

task 2: likelihood ratio test for positive selection H 0 : variable selective pressure but NO positive selection (M1) H 1 : variable selective pressure with positive selection (M2) Compare 2Δl = 2(l 1 - l 0 ) with a χ 2 distribution Model 1a Model 2a 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 ωˆ = 0.5 (ω = 1) ωˆ = 0.5 (ω = 1) ωˆ = 3.25

task 2: likelihood ratio test for positive selection H 0 : Beta distributed variable selective pressure (M7) H 1 : Beta plus positive selection (M8) Compare 2Δl = 2(l 1 - l 0 ) with a χ 2 distribution M7: beta M8: beta & ω sites sites 0 0.2 0.4 0.6 0.8 1 ω ratio 0 0.2 0.4 0.6 0.8 1 ω ratio >1

Exercise 3: Test hypotheses about molecular evolution of Ldh x 1 x 2! x 3 x 4 t 1 :ω 0 t 2 :ω 0 t 3 :ω 0 t 4 :ω 0 j t 4 :ω 1 k branch models (ω varies among branches) Exercise 4: Testing for adaptive evolution in the nef gene of HIV-2 Model 1a Model 2a 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 ωˆ = 0.5 (ω = 1) 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 ωˆ = 0.5 (ω = 1) ωˆ = 3.25 site models (ω varies among sites)

model based inference 3 analytical tasks task 1. parameter estimation (e.g., ω) task 2. hypothesis testing task 3. make predictions (e.g., sites having ω > 1 )

task 3: which sites have dn/ds > 1 model: 9% have ω > 1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 Bayes rule: site 4, 12 & 13 GTG CTG TCT CCT GCC GAC AAG ACC AAC GTC AAG GCC GCC TGG GGC AAG GTT GGC GCG CAC......... G.C......... T....T............................GC A.............C..T............ A..... A.T.......AA... A.C... AGC........C... G.A.AT.....A...... A..... AA. TG......G... A....T.GC..T.....C..G GA...T........T C....G..A... AT......T.....G..A.GC... structure: sites are in contact

task 3: Bayes rule for which sites have dn/ds > 1 Bayes rule empirical Bayes bootstrap NEB Naive Empirical Bayes Nielsen and Yang, 1998 assumes no MLE errors BEB Bayes Empirical Bayes Yang et al., 2005 accommodate MLE errors for some model parameters via uniform priors SBA Smoothed bootstrap aggregation Mingrone et al., MBE, 33:2976-2989 accommodate MLE errors via bootstrapping ameliorates biases and MLE instabilities with kernel smoothing and aggregation

Exercise 4: identify adaptive sites in the nef gene of HIV-2 model: 9% have ω > 1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 Bayes rule: site 4, 12 & 13 GTG CTG TCT CCT GCC GAC AAG ACC AAC GTC AAG GCC GCC TGG GGC AAG GTT GGC GCG CAC......... G.C......... T....T............................GC A.............C..T............ A..... A.T.......AA... A.C... AGC........C... G.A.AT.....A...... A..... AA. TG......G... A....T.GC..T.....C..G GA...T........T C....G..A... AT......T.....G..A.GC...

Software: both PAML and HyPhy are great choices https://veg.github.io/hyphy-site/ http://abacus.gene.ucl.ac.uk/software/paml.html http://www.datamonkey.org/

Part 1: PAML Introduction PAML (Phylogenetic Analysis by Maximum Likelihood) A program package by Ziheng Yang (Demonstration by Joseph Bielawski)

Part 1: PAML Introduction What does PAML do? Features include: estimating synonymous and nonsynonymous rates testing hypotheses concerning d N /d S rate ratios various amino acid-based likelihood analysis ancestral sequence reconstruction (DNA, codon, or AAs) various clock models simulating nucleotide, codon, or AA sequence data sets and more

Part 1: PAML Introduction Programs in the package baseml basemlg codeml evolver yn00 chi2 pamp mcmctree for bases continuous-gamma for bases aaml (for amino acids) & codonml (for codons) simulation, tree distances d N and d S by YN00 chi square table parsimony (Yang and Kumar 1996) Bayes MCMC tree (Yang & Rannala 1997). Slow

Part 1: PAML Introduction Running PAML programs 1. Sequence data file 2. Tree file 3. Control file (*.ctl)

Part 1: PAML Introduction Running PAML programs: the sequence file 4 20 sequence_1 TCATT CTATC TATCG TGATG sequence_2 TCATT CTATC TATCG TGATG sequence_3 TCATT CTATC TATCG TGATG sequence_4 TCATT CTATC TATCG TGATG 4 20 sequence_1tcattctatctatcgtgatg sequence_2tcattctatctatcgtgatg sequence_3tcattctatctatcgtgatg sequence_4tcattctatctatcgtgatg Format = plain text in PHYLIP format

Part 1: PAML Introduction Running PAML programs: the tree file Format = parenthetical notation ((((1, 2), 3), 4), 5) This is a rooted tree (root is degree = 2)

Part 1: PAML Introduction Running PAML programs: the tree file Format = parenthetical notation (((1, 2), 3), 4, 5) This is an unrooted tree (basal node is degree = 3)

Part 1: PAML Introduction Running PAML programs: the *.ctl file codeml.ctl

Part 1: PAML Introduction seqfile = seqfile.txt * sequence data filename treefile = tree.txt * tree structure file name outfile = results.txt * main result file name noisy = 9 verbose = 1 runmode = 0 * 0,1,2,3,9: how much rubbish on the screen * 1:detailed output * 0:user defined tree seqtype = 1 * 1:codons CodonFreq = 2 * 0:equal, 1:F1X4, 2:F3X4, 3:F61 model = 0 * 0:one omega ratio for all branches NSsites = 0 * 0:one omega ratio (M0 in Tables 2 and 4) * 1:neutral (M1 in Tables 2 and 4) * 2:selection (M2 in Tables 2 and 4) * 3:discrete (M3 in Tables 2 and 4) * 7:beta (M7 in Tables 2 and 4) * 8:beta&w; (M8 in Tables 2 and 4) icode = 0 fix_kappa = 0 kappa = 2 fix_omega = 0 omega = 5 * 0:universal code * 1:kappa fixed, 0:kappa to be estimated * initial or fixed kappa * 1:omega fixed, 0:omega to be estimated * initial omega *set ncatg for models M3, M7, and M8!!! *ncatg = 3 * # of site categories for M3 in Table 4 *ncatg = 10 * # of site categories for M7 and M8 in Table 4

Exercises: Part 2: Real data exercises Rasmus Nielsen Editor Statistical Methods in Molecular Evolution 5 Maximum Likelihood Methods for Detecting Adaptive Protein Evolution Joseph P. Bielawski 1 and Ziheng Yang 2 1 Department of Biology, Dalhousie University, Halifax, Nova Scotia B3H 4J1, Canada, j.bielawski@dal.ca 2 Department of Biology, University College London, Gower Street, London WC1E 6BT, United Kingdom, z.yang@ucl.ac.uk 5.1 Introduction Proteins evolve; the genes encoding them undergo mutation, and the evolutionary fate of the new mutation is determined by random genetic drift as well as purifying or positive (Darwinian) selection. The ability to analyze this process was realized in the late 1970s when techniques to measure genetic variation at the sequence level were developed. The arrival of molecular sequence data also intensified the debate concerning the relative importance of neutral drift and positive selection to the process of molecular evolution [17]. Ever since, there has been considerable interest in documenting cases of molecular adaptation. Despite a spectacular increase in the amount of available nucleotide sequence data since the 1970s, the number of such well-established cases is still relatively small [9, 38]. This is largely due to the difficulty in developing powerful statistical tests for adaptive molecular evolution. Although several powerful tests for nonneutral evolution have been developed [33], significant results under such tests do not necessarily indicate evolution by positive selection. A powerful approach to detecting molecular evolution by positive selection derives from comparison of the relative rates of synonymous and nonsynonymous substitutions [22]. Synonymous mutations do not change the amino acid sequence; hence their substitution rate (d S)isneutralwithrespecttoselective pressure on the protein product of a gene. Nonsynonymous mutations do change the amino acid sequence, so their substitution rate (d N)isafunction of selective pressure on the protein. The ratio of these rates (ω = d N/d S) is a measure of selective pressure. For example, if nonsynonymous mutations are deleterious, purifying selection will reduce their fixation rate and d N/d S will be less than 1, whereas if nonsynonymous mutations are advantageous, they will be fixed at a higher rate than synonymous mutations, and d N/d S will be greater than 1. A d N/d S ratio equal to one is consistent with neutral evolution.

Part 2: Real data exercises Exercises: Method/model program dataset 1 Pair-wise ML method codeml Drosophila GstD1 2 Pair-wise ML method codeml Drosophila GstD1 3 M0 and branch models codeml Ldh gene family 4 M0 and site models codeml HIV-2 nef genes

Part 2: Real data exercises Exercise 1: ML estimation of the d N /d S (ω) ratio by hand for GstD1 Dataset: GstD1 genes of Drosophila melanogaster and D. simulans (600 codons). Objective: Use codeml to evaluate the likelihood the GstD1 sequences for a variety of fixed ω values. 1- Plot log-likelihood scores against the values of ω and determine the maximum likelihood estimate of ω. 2- Check your finding by running codeml s hill-climbing algorithm.

Exercise 1 Part 2: Real data exercises seqfile = seqfile.txt * sequence data filename outfile = results.txt * main result file name noisy = 9 verbose = 1 runmode = -2 * 0,1,2,3,9: how much rubbish on the screen * 1:detailed output * -2:pairwise seqtype = 1 * 1:codons CodonFreq = 3 * 0:equal, 1:F1X4, 2:F3X4, 3:F61 model = 0 * NSsites = 0 * icode = 0 * 0:universal code fix_kappa = 0 kappa = 2 * 1:kappa fixed, 0:kappa to be estimated * initial or fixed kappa fix_omega = 1 * 1:omega fixed, 0:omega to be estimated omega = 0.001 * 1 st fixed omega value [CHANGE THIS] *alternate fixed omega values *omega = 0.005 * 2 nd fixed value *omega = 0.01 * 3 rd fixed value *omega = 0.05 * 4 th fixed value *omega = 0.10 * 5 th fixed value *omega = 0.20 * 6 th fixed value *omega = 0.40 * 7 th fixed value *omega = 0.80 * 8 th fixed value *omega = 1.60 * 9 th fixed value *omega = 2.00 * 10 th fixed value

Exercise 1 Part 2: Real data exercises Plot results: likelihood score vs. omega (log scale) Likelihood score -750-755 -760-765 -770-775 -780-785 -790-795 0.001 0.005 0.05 0.1 0.2 0.01 0.4 0.8 1.6 2.0 0.001 0.01 0.1 1 10 Fixed value of ω

Exercise 1 Part 2: Real data exercises Exercise 1 If you forget what to do, there is a step-by-step guide on the course web site. There is also a HelpFile to help you to get what you need from the output of codeml

Part 2: Real data exercises Exercise 2: Investigating the sensitivity of the d N /d S ratio to assumptions Dataset: GstD1 genes of Drosophila melanogaster and D. simulans (600 codons). Objective: 1- Test effect of transition / transversion ratio (κ ) 2- Test effect of codon frequencies (π I s ) 3- Determine which assumptions yield the largest and smallest values of S, and what is the effect on ω

Exercise 2 Part 2: Real data exercises CodonFreq= is used to specify the equilibrium codon frequencies Fequal: - 1/61 each for the standard genetic code - CodonFreq = 0 - number of parameters in the model = 0 F3x4: - calculated from the average nucleotide frequencies at the three codon positions - CodonFreq = 2 - number of parameters in the model = 9 F61 - also called ftable ; empirical estimate of each codon frequency - CodonFreq = 3 - number of parameters in the model = 61

Exercise 2 Part 2: Real data exercises Example: A C AAA CAA AAA ACA AAA AAC Target codon (nucleotide) CAA ACA AAC NP No bias 1/61 1/61 1/61 0 MG π 1 c π 2 c π 3 c 9 π C1 π A2 π A 3 π A1 π C2 π A 3 π A1 π A2 π C 3 F3 4 (GY) 9 F61 (GY) π CAA π ACA π AAC 61 NOTE: There are even more ways to model frequencies; but these are the only one we will deal with in this lab.

Exercise 2 Part 2: Real data exercises seqfile = seqfile.txt * sequence data filename outfile = results.txt * main result file name noisy = 9 verbose = 1 runmode = -2 * 0,1,2,3,9: how much rubbish on the screen * 1:detailed output * -2:pairwise seqtype = 1 * 1:codons CodonFreq = 0 * 0:equal, 1:F1X4, 2:F3X4, 3:F61 [CHANGE THIS] model = 0 * NSsites = 0 * icode = 0 * 0:universal code fix_kappa = 1 kappa = 1 * 1:kappa fixed, 0:kappa to be estimated [CHANGE THIS] * fixed or initial value fix_omega = 0 omega = 0.5 * 1:omega fixed, 0:omega to be estimated * initial omega value

Exercise 2 Part 2: Real data exercises Further details for about the assumptions tested in ACTIVITY 2 Assumption set 1: (Codon bias = none; Ts/Tv bias = none) CodonFreq=0; kappa=1; fix_kappa=1 Assumption set 2: (Codon bias = none; Ts/Tv bias = Yes) CodonFreq=0; kappa=1; fix_kappa=0 Assumption set 3: (Codon bias = yes [F3x4]; Ts/Tv bias = none) CodonFreq=2; kappa=1; fix_kappa=1 Assumption set 4: (Codon bias = yes [F3x4]; Ts/Tv bias = Yes) CodonFreq=2; kappa=1; fix_kappa=0 Assumption set 5: (Codon bias = yes [F61]; Ts/Tv bias = none) CodonFreq=3; kappa=1; fix_kappa=1 Assumption set 6: (Codon bias = yes [F61]; Ts/Tv bias = Yes) CodonFreq=3; kappa=1; fix_kappa=0

Exercise 2 Part 2: Real data exercises Complete this table (If you forget what to do, there is a step-bystep guide on the course web-site.) Table E2: Estimation of d S and d N between Drosophila melanogaster and D. simulans GstD1 genes Assumptions κ S N d S d N ω l Fequal + κ = 1 1.0?????? Fequal + κ = estimated??????? F3 4 + κ = 1 1.0?????? F3 4 + κ = estimated??????? F61 + κ = 1 1.0?????? F61 + κ = estimated??????? κ = transition/transversion rate ratio S = number of synonymous sites N = number of nonsynonymous sites ω = d N /d S l = log likelihood score

Part 2: Real data exercises Exercise 3: Test hypotheses about molecular evolution of Ldh Dataset: The Ldh gene family is an important model system for molecular evolution of isozyme multigene families. The rate of evolution is known to have increased in Ldh-C following the gene duplication event Objective: Use LRTs to evaluate the following hypotheses: 1- The mutation rate of Ldh-C has increased relative to Ldh-A, 2- A burst of positive selection for functional divergence occurred following the duplication event that gave rise to Ldh-C 3- There was a long term shift in selective constraints following the duplication event that gave rise to Ldh-C

Exercise 3 Part 2: Real data exercises Gene duplication event C1 C1 C1 C1 Mus Rattus C0 C1 Cricetinae Ldh-C C1 C1 C1 Sus Homo A0 A1 A1 A1 A1 Sus A1 A1 A1 A1 A1 Rabbit Mus Rattus Ldh-A A0 A0 A0 Gallus Sceloporus H 0 : ω A0 = ω A1 = ω C1 = ω C0 H 1 : ω A0 = ω A1 = ω C1 ω C0 H 2 : ω A0 = ω A1 ω C1 = ω C0 H 3 : ω A0 ω A1 ω C1 = ω C0

Exercise 3 Part 2: Real data exercises seqfile = seqfile.txt * sequence data filename treefile = tree.h0.txt * tree structure file name [CHANGE THIS] outfile = results.txt * main result file name noisy = 9 verbose = 1 runmode = 0 * 0,1,2,3,9: how much rubbish on the screen * 1:detailed output * 0:user defined tree seqtype = 1 * 1:codons CodonFreq = 2 * 0:equal, 1:F1X4, 2:F3X4, 3:F61 model = 0 * 0:one omega ratio for all branches [FOR MODEL H0] * 1:separate omega for each branch * 2:user specified dn/ds ratios for branches [FOR MODELS H1-H3] NSsites = 0 * icode = 0 fix_kappa = 0 kappa = 2 fix_omega = 0 omega = 0.2 * 0:universal code * 1:kappa fixed, 0:kappa to be estimated * initial or fixed kappa * 1:omega fixed, 0:omega to be estimated * initial omega *H 0 in Table 3: *model = 0 *(X02152Hom,U07178Sus,(M22585rab,((NM017025Rat,U13687Mus), *(((AF070995C,(X04752Mus,U07177Rat)),(U95378Sus,U13680Hom)),(X53828OG1, * U28410OG2))))); *H 1 in Table 3: *model = 2 *(X02152Hom,U07178Sus,(M22585rab,((NM017025Rat,U13687Mus),(((AF070995C, *(X04752Mus,U07177Rat)),(U95378Sus,U13680Hom))#1,(X53828OG1,U28410OG2)) * ))); *H 2 in Table 3: *model = 2 * (X02152Hom,U07178Sus,(M22585rab,((NM017025Rat,U13687Mus),(((AF070995C * #1,(X04752Mus #1,U07177Rat #1)#1)#1,(U95378Sus #1,U13680Hom #1) * #1)#1,(X53828OG1,U28410OG2))))); *H 3 in Table 3: *model = 2 * (X02152Hom,U07178Sus,(M22585rab,((NM017025Rat,U13687Mus),(((AF070995C * #1,(X04752Mus #1,U07177Rat #1)#1)#1,(U95378Sus #1,U13680Hom #1) * #1)#1,(X53828OG1 #2,U28410OG2 #2)#2))));

Exercise 3 Part 2: Real data exercises Complete this table (If you forget what to do, there is a step-by-step guide on the course web-site.) Table E3: Parameter estimates under models of variable ω ratios among lineages and LRTs of their fit to the Ldh-A and Ldh-C gene family. Models ω A0 ω A1 ω C1 ω C0 l LRT H 0 : ω A0 = ω A1 = ω C1 = ω C0? = ω A.0 = ω A.0 = ω A.0?? H 1 : ω A0 = ω A1 = ω C1 ω C0? = ω A.0 = ω A.0??? H 2 : ω A0 = ω A1 ω C1 = ω C0? = ω A.0? = ω C.1?? H 3 : ω A0 ω A1 ω C1 = ω C0??? = ω C.1?? The topology and branch specific ω ratios are presented in Figure 5. H 0 v H 1 : df = 1 H 0 v H 2 : df = 1 H 2 v H 3 : df = 1 2 χ df =1, α= 0.05 = 3.841

Part 2: Real data exercises Exercise 4: Testing for adaptive evolution in the nef gene of human HIV-2 (Start tonight, but finish as homework) Dataset: 44 nef sequences from a study population of 37 HIV-2 infected people living in Lisbon, Portugal. The nef gene in HIV-2 has received less attention than HIV-1, presumably because HIV-2 is associated with reduced virulence and pathogenicity relative to HIV-1 Objectives: 1- Learn to use LRTs to test for sites evolving under positive selection in the nef gene. 2- If you find significant evidence for positive selection, then identify the involved sites by using empirical Bayes methods.

Exercise 4 Part 2: Real data exercises M0# M1a# M7# H 0 # Proportion of sites 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 ˆω = 0.55 ˆω = 0.2 ω =1 [ ] Sites 0 0.2 0.4 0.6 0.8 1 ω#ra/o## ω ratio (depends#on#parameters#p#and#q)## M3# M2a# M8# H a # Proportion of sites 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 ˆω = 0.01 ˆω = 0.85 ˆω = 5.5 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 ˆω = 0.2 [ ω =1] ˆω = 3.5 Sites 0 0.2 0.4 0.6 0.8 1 >1 ˆω >1 ω ratio ω#ra/o## (depends#on#parameters#p#and#q)## LRT# 1: M0 vs. M3 test for variable selection pressure among sites 2: M1a vs. M2a tests for sites subject to positive selection 3: M7 vs. M8 tests for sites subject to positive selection

Exercise 4 Part 2: Real data exercises seqfile = seqfile.txt * sequence data filename * treefile = treefile_m0.txt * SET THIS for tree file with ML branch lengths under M0 * treefile = treefile_m1.txt * SET THIS for tree file with ML branch lengths under M1 * treefile = treefile_m2.txt * SET THIS for tree file with ML branch lengths under M2 * treefile = treefile_m3.txt * SET THIS for tree file with ML branch lengths under M3 * treefile = treefile_m7.txt * SET THIS for tree file with ML branch lengths under M7 * treefile = treefile_m8.txt * SET THIS for tree file with ML branch lengths under M8 outfile = results.txt noisy = 9 verbose = 1 runmode = 0 seqtype = 1 CodonFreq = 2 model = 0 * main result file name * lots of rubbish on the screen * detailed output * user defined tree * codons * F3X4 for codon ferquencies * one omega ratio for all branches * NSsites = 0 * SET THIS for M0 * NSsites = 1 * SET THIS for M1 * NSsites = 2 * SET THIS for M2 * NSsites = 3 * SET THIS for M3 * NSsites = 7 * SET THIS for M7 * NSsites = 8 * SET THIS for M8 These trees contain precomputed MLEs for branch lengths to speed the analyses. You will want to estimate all the branch lengths via ML when you analyze your own data! icode = 0 * universal code fix_kappa = 1 * kappa fixed * kappa = 4.43491 * SET THIS to fix kappa at MLE under M0 * kappa = 4.39117 * SET THIS to fix kappa at MLE under M1 * kappa = 5.08964 * SET THIS to fix kappa at MLE under M2 * kappa = 4.89033 * SET THIS to fix kappa at MLE under M3 * kappa = 4.22750 * SET THIS to fix kappa at MLE under M7 * kappa = 4.87827 * SET THIS to fix kappa at MLE under M8 fix_omega = 0 omega = 5 * omega to be estimated * initial omega * ncatg = 3 * SET THIS for 3 site categories under M3 * ncatg = 10 * SET THIS for 10 of site categories under M7 and M8 fix_blength = 2 * fixed branch lengths from tree file

Complete this table (If you forget what to do, there is a step-by-step guide on the course web-site.) Table E4: Parameter estimates and likelihood scores under models of variable ω ratios among sites for HIV-2 nef genes. Nested model pairs d N /d b S Parameter estimates c PSS d l M0: one-ratio (1) a? ω =? N.A.? M3: discrete (5)? p 0, =?, p 1, =?, (p 2 =?) ω 0 =?, ω 1 =?, ω 2 =?? (?)? M1: neutral (1)? p 0 =?, (p 1 =?) ω 0 =?, (ω 1 = 1) M2: selection (3)? p 0 =?, p 1 =?, (p 2 =?) ω 0 =?, (ω 1 = 1), ω 2 =? N.A.?? (?)? M7: beta (2)? p =?, q =? N.A.? M8: beta&ω (4)? p 0 =? (p 1 =?)? (?)? p =?, q =?, ω =? a The number after the model code, in parentheses, is the number of free parameters in the ω distribution. b This d N /d S ratio is an average over all sites in the HIV-2 nef gene alignment. c Parameters in parentheses are not free parameters. d PSS is the number of positive selection sites (NEB). The first number is the PSS with posterior probabilities > 50%. The second number (in parentheses) is the PSS with posterior probabilities > 95%. NOTE: Codeml now implements models M1a and M2a!

Exercise 4 Part 2: Real data exercises Reproduce this plot (use the rst file generated by M3) ω 0 = 0.034 ω 1 = 0.74 ω 2 = 2.50 1 0.8 0.6 0.4 0.2 0 1 11 21 31 41 51 61 71 81 91 101 111 121 131 141 151 161 171 181 191 201 211 221 231 241 251 Amino acid sites in the HIV-2 nef gene

Rasmus Nielsen Editor Statistical Methods in Molecular Evolution 5 Maximum Likelihood Methods for Detecting Adaptive Protein Evolution Joseph P. Bielawski 1 and Ziheng Yang 2 1 Department of Biology, Dalhousie University, Halifax, Nova Scotia B3H 4J1, Canada, j.bielawski@dal.ca 2 Department of Biology, University College London, Gower Street, London WC1E 6BT, United Kingdom, z.yang@ucl.ac.uk 5.1 Introduction Proteins evolve; the genes encoding them undergo mutation, and the evolutionary fate of the new mutation is determined by random genetic drift as well as purifying or positive (Darwinian) selection. The ability to analyze this process was realized in the late 1970s when techniques to measure genetic variation at the sequence level were developed. The arrival of molecular sequence data also intensified the debate concerning the relative importance of neutral drift and positive selection to the process of molecular evolution [17]. Ever since, there has been considerable interest in documenting cases of molecular adaptation. Despite a spectacular increase in the amount of available nucleotide sequence data since the 1970s, the number of such well-established cases is still relatively small [9, 38]. This is largely due to the difficulty in developing powerful statistical tests for adaptive molecular evolution. Although several powerful tests for nonneutral evolution have been developed [33], significant results under such tests do not necessarily indicate evolution by positive selection. A powerful approach to detecting molecular evolution by positive selection derives from comparison of the relative rates of synonymous and nonsynonymous substitutions [22]. Synonymous mutations do not change the amino acid sequence; hence their substitution rate (d S)isneutralwithrespecttoselective pressure on the protein product of a gene. Nonsynonymous mutations do change the amino acid sequence, so their substitution rate (d N)isafunction of selective pressure on the protein. The ratio of these rates (ω = d N/d S) is a measure of selective pressure. For example, if nonsynonymous mutations are deleterious, purifying selection will reduce their fixation rate and d N/d S will be less than 1, whereas if nonsynonymous mutations are advantageous, they will be fixed at a higher rate than synonymous mutations, and d N/d S will be greater than 1. A d N/d S ratio equal to one is consistent with neutral evolution.