Line 638: | Line 638: | ||
− | + | <div class="container-fluid" style="margin-top: 10px;" id="container1"> | |
<h2>Diff tool</h2> | <h2>Diff tool</h2> | ||
<p>Marks differences in two strings, ignores newlines. | <p>Marks differences in two strings, ignores newlines. | ||
Line 661: | Line 661: | ||
</label> | </label> | ||
</li> | </li> | ||
− | + | <li> | |
+ | <input type="checkbox" Name="Case sensitive" id="case_sensitive" value="True" checked> | ||
+ | <label for="case_sensitive">Case sensitive</label> | ||
+ | </li> | ||
<li> | <li> | ||
<div style="padding-top: 30px;"> | <div style="padding-top: 30px;"> | ||
Line 829: | Line 832: | ||
var str1 = document.getElementById('str1').value; | var str1 = document.getElementById('str1').value; | ||
var str2 = document.getElementById('str2').value; | var str2 = document.getElementById('str2').value; | ||
− | str1 = str1.replace(/(\r\n|\n|\r)/gm,""); | + | str1 = str1.replace(/(\r\n|\n|\r)/gm,""); |
− | str2 = str2.replace(/(\r\n|\n|\r)/gm,""); | + | str2 = str2.replace(/(\r\n|\n|\r)/gm,""); |
//initialise variables | //initialise variables | ||
Line 840: | Line 843: | ||
var sharedlen = 0; | var sharedlen = 0; | ||
var diffinfo = ""; | var diffinfo = ""; | ||
+ | var str1_comp = str1; | ||
+ | var str2_comp = str2; | ||
+ | |||
//calculate | //calculate | ||
+ | |||
+ | if(document.getElementById("case_sensitive").checked == false){ | ||
+ | str1_comp = str1.toLowerCase(); | ||
+ | str2_comp = str2.toLowerCase(); | ||
+ | } | ||
+ | |||
var i = 0; | var i = 0; | ||
while(i < str1.length){ | while(i < str1.length){ | ||
Line 846: | Line 858: | ||
break; | break; | ||
} | } | ||
− | if( | + | if(str1_comp[i]==str2_comp[i]){ |
outstr1 += str1[i]; | outstr1 += str1[i]; | ||
outstr2 += str2[i]; | outstr2 += str2[i]; | ||
Line 878: | Line 890: | ||
return false; | return false; | ||
} | } | ||
− | |||
</script> | </script> |
Revision as of 18:41, 27 September 2017
WikitemplateA home
From 2014.igem.org
Internal Tools
Number of mutations and mutated sequences
Expected number of mutations in a single sequence: $$p_{m} = \frac{N_{mutations}}{L_{Sequence}} = N_{generations} \cdot r_{mutation} = t_{total} \cdot \Phi \cdot r_{mutation}$$
The expected share of sequences that shows at least one mutation in \(L_{Sequence}\) bp is the probability that \(L_{sequence}\) basepairs stay unchanged when \(\frac{N_{mutations}}{L_{Sequence}}\) mutations are expected: $$p_{M} = \frac{N_{mutated}}{N_{Sequences}} = 1 - p(N_{mutations}=0) = 1 - (1-p_{m})^{L_{Sequence}} $$
With this equation we can also calculate the number of sequences \(N_{Sequences}\) that have to be sequenced in order to find a mutated one with a probability of \(p(N_{mutated} > 0)\). $$ N_{Sequences} = \frac{p(N_{mutated} > 0)}{p_{M}} $$
The probability to find at least one mutated sequence under the given conditions is $$p(N_{mutated}>0) = 1 - (1-p_{M})^{N_{sequences}}$$ which gives $$N_{Sequences} = \frac{ln(1-p(N_{mutated}>0))}{ln(1-p_{M})}$$
Set \(\Phi\) to zero to use the number of generations for the calculation. If \(\Phi\) and the number of generations are given, \(\Phi\) is used.
Consider \(L_{Sequence}\) as the number of basepairs that is expected to be mutated. If half of the sequence you are interested in, is highly conserved choose a lower \(L_{Sequence}\).
\(p_{m} =\) %(bp/bp).
\(N_{mutations} =\) bp per sequence.
The share of sequences that shows at least one mutation in \(L_{Sequence}\) bp is \(p_{M}=\) % of sequences
Diff tool
Marks differences in two strings, ignores newlines.
Comparison: