<p>Hi all again,</p>

<p>I've noticed that most programs used to predict the effect of non-synonymous amino acids substitutions simply don't analyze the action of selection of any kind. Given that conservation in alignment does not mean necessarily purifying selection, I'm wondering about the true relation between conservation and selection. In order to test this idea, I really need some guidelines to calculate Ka/Ks in close and distantly related species. Any software able to deal with such situation is much welcome too!</p>

<p>-- Edit -- </p>

<p>I know a lot of programs able to calculate Ka/Ks. What I really want is an expert opinion of what to do and which one to use. </p>

<p>Conclusions one may draw from dN/dS ratios (aka. ~Ka/Ks):</p>

<p><strong><em>Neutral Evolution (drift):</em></strong> dN/dS ratio = 1 implies there has been equal numbers of synonymous (dna substitutions that do not affect the protein sequence) and non-synonymous changes (dna substitutions that do affect the protein sequence) during the time between ancestral to the modern versions of the protein.</p>

<p><strong><em>Positive Selection (adaptive evolution):</em></strong> dN/dS ratio &gt; 1 implies there has been more non-synonymous changes than synonymous changes. There has been evolutionary pressure to escape from the ancestral state - i.e. positive selection pressure. This can occur for example in paralogues that are required to serve a novel function, or in proteins of parasites that need to escape host immune recognition (e.g. changes to avoid MHC-1 binding to evade T-cell attack).</p>

<p><strong><em>Negative Selection (conservation):</em></strong> dN/dS ratio &lt; 1 implies there has been more synonymous changes than non-synonymous changes. There has been evolutionary pressure to conserve the ancestral state - i.e. negative selection pressure. This can occur for example in orthologues that are required to maintain (conserve) some function encoded in the protein sequence, since changes from this state would lead to disruption of function.</p>

<p><strong>Useful Tips:</strong></p>

<ul>
	<li>Algorithms can either run on multiple sequences, or just a pair of sequences. In either case the input sequences used to derive a dN/dS ratio must share ancestry - too divergent and there is a problem with multiple substitutions, too recent and you will not have sufficient enough observed changes to draw conclusions from.</li>
	<li>dN/dS can be used to compare whole proteins or regions within proteins (a sliding dN/dS value across the protein.)</li>
	<li>A dN/dS ratio calculated for a whole protein is often an underestimate (lower than it should be) due to the variety of domains that constitute each protein, for instance a alpha-helix structure may always be required in a set of proteins that perform a variety of different functions.</li>
	<li>The only sequence changes considered are substitutions (not duplications, or inversions etc.)</li>
	<li>Significance of a given dN/dS ratio can be assessed using Fishers exact test: <a href="https://code.google.com/p/kaks-calculator/wiki/FAQ">read this</a>.</li>
</ul>

<p><strong>Software:</strong></p>

<p>Here are my recommendations for software ordered by how flexible they are:</p>

<ul>
	<li><a href="http://www.mathworks.co.uk/help/bioinfo/ref/dnds.html">MATLAB&#39;s Bioinformatics Toolbox:</a> Here you have the greatest variety of alternative algorithms, operating system compatibility, sliding vs. whole protein analysis, API to Genbank, etc (<a href="http://www.mathworks.co.uk/products/bioinfo/code-examples.html?file=/products/demos/shipping/bioinfo/dndsdemo.html">Here&#39;s</a> a great tutorial for using their dN/dS tool). Just remember MATLAB is <strong>not free.</strong></li>
	<li><a href="https://code.google.com/archive/p/kaks-calculator/">KaKs Calculator:</a> If you only care about <strong>whole protein</strong> dN/dS, many options are available with the Ka/Ks calculator - they also compute statistical significance using Fisher&#39;s exact test. Here's an <a href="https://github.com/a1ultima/kaks_error_bars">R script</a> I made to help you out, it plots a bar chart (with error bars), from the KaKs Calculator output files.
	<li><a href="http://abacus.gene.ucl.ac.uk/software/paml.html">PAML:</a> If you have &gt;2 sequences per protein that you wish to get a dN/dS value for, then many options are available with PAML. This is <strong>often used in published papers</strong>, but it&#39;s not recommended if you only have a pair of sequences per protein.</li>
	<li><a href="https://github.com/a1ultima/hpcleap_dnds">VectorBase dN/dS app.: </a> If you you just want to quickly visualize a sliding window dN/dS curve, <strong>without installing anything</strong>, me and a friend have finished a website, for you to do just that. It allows for simple pairwise, sliding window dN/dS analysis using the <a href="https://www.ncbi.nlm.nih.gov/pubmed/3444411">Nei-Gojobori method</a>. Accuracy is comparable to  MATLAB&#39;s Bioinformatics Toolbox, and performance is optimized for phone. So far the GUI can only accept VectorBase gene ids, but the <a href="https://github.co/a1ultima/hpcleap_dnds/blob/master/py/scripts/dnds.py">dnds.py</a> script itself can take any input pair of proteins. Performance is heavily optimized, e.g. a pair of 3000bp long proteins in <1s. When the site is finally hosted I'll post a link, code: https://github.com/a1ultima/hpcleap_dnds</li>
</ul>

![enter image description here][1]


  [1]: https://github.com/a1ultima/hpcleap_dnds/raw/master/py/data/webapp_demo_dnds-and-domains.PNG