Description Usage Arguments Details Value Original code in Darwin Author(s) See Also Examples
RelativeAdaptiveness
calculates RA for a List of Entry Numbers
1 | RelativeAdaptiveness(entries = mylist(whatout = 1))
|
entires |
List of Coding sequences or DNA string |
Should compute the same RA as in Darwin and should not have an error higher than (5e-04) the difference of w from seqinr and relative adaptiveness (w) from codonW (by John Peden).
Named (codons) numerical vector with relative adaptiveness for the 64 codons
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | RelativeAdaptiveness := proc(entries:list(posint))
CodonCounts := CreateArray(1..64);
for i in entries do
dna := SearchTag('DNA', Entry(i));
for j to length(dna) by 3 do
cod := CodonToCInt(dna[j..j+2]);
if cod=0 then next fi; # to avoid XXX
CodonCounts[cod] := CodonCounts[cod]+1;
od;
od;
RA := CreateArray(1..64);
aa := 1;
for aa to 20 do
codons := IntToCInt(aa);
counts := [seq(CodonCounts[i], i=codons)];
freqs := counts / sum(counts);
for i to length(codons) do
cod := codons[i];
RA[cod] := freqs[i] / max(freqs);
od;
od;
for i to length(RA) do # set minimum RA value to 0.01
if RA[i] = 0 then
RA[i] := 0.01 fi od;
for i in AToCInt('$') do # set RA value of stop codons to 1
RA[i] := 1; od;
RA
end:
|
Roth, A.; Friberg, M.; Siegrist, F. and Cannarozzi, G. M. gina@cannarozzi.com
seqinr
ComputeCarboneRA
statanacoseq
SetupRA
1 2 | RelativeAdaptiveness('ATGTGGTACTCCGACTACGGAGGATAA')
RelativeAdaptiveness(mylist(whatout=1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.