bugfixes
This commit is contained in:
parent
553b042f20
commit
373da689df
@ -3,12 +3,13 @@
|
||||
# Purpose: A Bioinformatics Course:
|
||||
# R code accompanying the RPR-Genetic_code_optimality unit.
|
||||
#
|
||||
# Version: 1.0
|
||||
# Version: 1.0.1
|
||||
#
|
||||
# Date: 2017 10 16
|
||||
# Author: Boris Steipe (boris.steipe@utoronto.ca)
|
||||
#
|
||||
# Versions:
|
||||
# 1.0.1 Fixed two bugs discovered by Suan Chin Yeo.
|
||||
# 1.0 New material.
|
||||
#
|
||||
#
|
||||
@ -119,7 +120,7 @@ swappedGC <- function(GC) {
|
||||
# amino acids have been swapped.
|
||||
|
||||
aaOrig <- unique(GC) # the amino acids in the input code
|
||||
aaSwap <- sample(aa, length(aa)) # shuffled
|
||||
aaSwap <- sample(aaOrig, length(aaOrig)) # shuffled
|
||||
names(aaSwap) <- aaOrig # name them after the original
|
||||
GC[1:64] <- aaSwap[GC] # replace original with shuffled
|
||||
|
||||
@ -291,7 +292,7 @@ hist(valUGC,
|
||||
|
||||
# This looks like a normal distribution. Let's assume the effect of mutations
|
||||
# under the universal genetic code is the mean of this distribution:
|
||||
effectUGC <- mean(val) # 178.1
|
||||
effectUGC <- mean(valUGC) # 178.1
|
||||
|
||||
# Now we can look at the effects of alternate genetic codes:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user