Skip to content

Commit

Permalink
setup: fix default params, add AFs plot's beta distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
juliendiot42 committed Jul 30, 2024
1 parent fe8a2f2 commit 45b92f3
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions src/plantbreedgame_setup.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ params:
cost.geno.single: 0.02
cost.register: 4
initialBudget: 3900
t1_mu: 20
t1_min: 100
t1_mu: 100
t1_min: 20
t1_cv_g: 0.1
t1_h2: 0.3
t2_mu: 15
Expand Down Expand Up @@ -310,25 +310,21 @@ progressBar$set(
)
f <- paste0(truth.dir, "/g0.RData")
if (!file.exists(f)) {
g0 <- simulCoalescent(
nb.inds = I,
ind.ids = ind.ids,
nb.reps = nb.chrs,
pop.mut.rate = theta,
pop.recomb.rate = rho,
chrom.len = L,
other = cmd,
nb.pops = 1,
get.trees = FALSE,
get.tmrca = FALSE,
permute.alleles = TRUE,
verbose = 1
)
save(g0, file = f)
} else {
load(f)
}
g0 <- simulCoalescent(
nb.inds = I,
ind.ids = ind.ids,
nb.reps = nb.chrs,
pop.mut.rate = theta,
pop.recomb.rate = rho,
chrom.len = L,
other = cmd,
nb.pops = 1,
get.trees = FALSE,
get.tmrca = FALSE,
permute.alleles = TRUE,
verbose = 1
)
save(g0, file = f)
tools::md5sum(path.expand(f))
file.info(f)$mtime
head(g0$snp.coords)
Expand All @@ -348,7 +344,8 @@ afs <- estimSnpAf(X = g0$genos, allow.updating = TRUE)
summary(afs)
plotHistAllelFreq(
afs = afs,
main = paste0(length(afs), " SNPs")
main = paste0(length(afs), " SNPs"),
add.ml.beta = T
)
mafs <- estimSnpMaf(afs = afs)
summary(mafs)
Expand Down

0 comments on commit 45b92f3

Please sign in to comment.