RelativeAdaptiveness: Compute Relative Adaptiveness

Description Usage Arguments Details Value Original code in Darwin Author(s) See Also Examples

Description

RelativeAdaptiveness calculates RA for a List of Entry Numbers

Usage

1
RelativeAdaptiveness(entries = mylist(whatout = 1))

Arguments

entires

List of Coding sequences or DNA string

Details

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).

Value

Named (codons) numerical vector with relative adaptiveness for the 64 codons

Original code in Darwin

Compute Relative Adaptiveness as codonW (by John Peden)

 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: 

Author(s)

Roth, A.; Friberg, M.; Siegrist, F. and Cannarozzi, G. M. gina@cannarozzi.com

See Also

seqinr ComputeCarboneRA statanacoseq SetupRA

Examples

1
2
RelativeAdaptiveness('ATGTGGTACTCCGACTACGGAGGATAA')
RelativeAdaptiveness(mylist(whatout=1))

fredysiegrist/statanacoseq documentation built on May 16, 2019, 2:44 p.m.