ComputeCarboneRA: Compute Carbone Relative Adaptiveness

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

Description

ComputeCarboneRA calculates RA

Usage

1
2
ComputeCarboneRA(target = 0.05, initfrac = 1, iterfrac = 0.5,
  reverse = FALSE, DB = mylist(whatout = 1))

Arguments

target

nonnegative

initfrac

nonnegative

reverse

For standard anything else for non-standard

DB

Database with working genes of type Entires()

interfrac

nonnegative

Details

Should compute the same RA in Darwin

Value

Named (codons) numerical vector with relative synonymous codon usage for the 64 codons

Original code in Darwin

Compute Carbone Relative Adaptiveness

 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
ComputeCarboneRA := proc( ; t=0.01:nonnegative, initfrac=1:nonnegative, iterfrac=0.5:nonnegative, mode:string)
 global RA;
 if not assigned(DB) then error('DB must be assigned') fi;
 x := 1;  # fraction of the sequences used to compute RA in this iteration
 AllGenes := [seq(i, i=1..DB[TotEntries])]:
 genes := Shuffle(AllGenes)[1..round(initfrac * DB[TotEntries])]:
 bestCorr := 0;
 cai := CreateArray(1..DB[TotEntries]):
 while length(genes) / DB[TotEntries] > t do
   RA := RelativeAdaptiveness(genes);
   for i to DB[TotEntries] do
     dna:=SearchTag('DNA',Entry(i));
     if SearchString('X', dna)<>-1 then next fi;
     cai[i] := ComputeCAI(dna) od;
   x := x * iterfrac;
   res := transpose([AllGenes, cai]):
   if mode='reverse' then
     res := transpose(sort(res, res -> res[2])):
   else
     res := transpose(sort(res, res -> -res[2])):
   fi;
   genes := res[1][1..round(x * DB[TotEntries])]:
 od;
RA
end: 

Author(s)

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

See Also

RelativeAdaptiveness statanacoseq SetupRA Entries

Examples

1
ComputeCarboneRA(DB=mylist(whatout=1))

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