################################################### ### chunk number 1: ################################################### #line 69 "vignettes/GeneGA/inst/doc/GeneGA.Rnw" library(GeneGA) seqfile=system.file("sequence", "EGFP.fasta", package="GeneGA") aa=read.fasta(seqfile) rscu=uco(unlist(aa), index="rscu") w_value=rscu # w_value is the w table we need computing names(w_value)=names(rscu) names=sapply(names(rscu), function(x) translate(s2c(x))) amino=hash() for(i in unique(names)){ amino[[i]]=max(rscu[which(names==i)]) } for(i in 1:length(names)){ w_value[i]=rscu[[names(rscu)[i]]]/amino[[translate(s2c(names(rscu)[i]))]] } ################################################### ### chunk number 2: ################################################### #line 89 "vignettes/GeneGA/inst/doc/GeneGA.Rnw" seqfile=system.file("sequence", "EGFP.fasta", package="GeneGA") seq=unlist(getSequence(read.fasta(seqfile), as.string=TRUE)) ################################################### ### chunk number 3: ################################################### #line 94 "vignettes/GeneGA/inst/doc/GeneGA.Rnw" GeneGA.result=GeneGA(sequence=seq, popSize=40, iters=150, crossoverRate=0.3, mutationChance=0.05, region=c(1,60), organism="ec", showGeneration=FALSE) ################################################### ### chunk number 4: ################################################### #line 98 "vignettes/GeneGA/inst/doc/GeneGA.Rnw" show(GeneGA.result) ################################################### ### chunk number 5: ################################################### #line 102 "vignettes/GeneGA/inst/doc/GeneGA.Rnw" plotGeneGA(GeneGA.result, type=1) ################################################### ### chunk number 6: ################################################### #line 108 "vignettes/GeneGA/inst/doc/GeneGA.Rnw" plotGeneGA(GeneGA.result, type=2) ################################################### ### chunk number 7: ################################################### #line 114 "vignettes/GeneGA/inst/doc/GeneGA.Rnw" plotGeneGA(GeneGA.result, type=3)