Description Usage Arguments Details Value Original code in Darwin Author(s) See Also Examples
ComputeCAIVector
Computes Codon Adaptation Index
1 | ComputeCAIVector(cds, RA)
|
cds |
Coding sequence in reading frame |
Should compute the same ComputeCAI or ComputeCAIVector as in Darwin and the cai of seqinr package.
Vector of all 65 codon values
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ComputeCAIVector := proc(e:Entry)
if not assigned(RA) then
error('Error in ComputeCAI: RA not assigned, use e.g. SetupRA(yeast);') fi;
dna := SearchTag('DNA', e);
wa := CreateArray(1..20);
na := CreateArray(1..20);
for j to length(dna) by 3 do
cint := CodonToCInt(dna[j..j+2]);
a := CIntToInt(cint);
if a <= 20 then
wa[a] := wa[a] + ln(RA[cint]);
na[a] := na[a]+1;
fi;
od;
res := CreateArray(1..21);
for i to 20 do
res[i] := If(na[i]=0, 'NA', exp(1/na[i] * wa[i])) od;
res[21] := exp(1/sum(na) * sum(wa));
res
end:
|
Roth, A.; Friberg, M.; Siegrist, F. and Cannarozzi, G. M. gina@cannarozzi.com
seqinr
cai
statanacoseq
checkCDS
1 2 | ComputeCAIVector('ATGTGGTACTCCGACTACGGAGGATAA', RA=SetupRA("yeast"))
ComputeCAIVector(c2s(mylist(whatout=1)[[1]]), RA=ComputeCarboneRA(DB=mylist(whatout=1)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.