# NOT RUN {
#' # three demes with optional names
demes <- fscSettingsDemes(
Large = fscDeme(10000, 10),
Small = fscDeme(2500, 10),
Medium = fscDeme(5000, 3, 1500)
)
# four historic events
events <- fscSettingsEvents(
fscEvent(event.time = 2000, source = 1, sink = 2, prop.migrants = 0.05),
fscEvent(2980, 1, 1, 0, 0.04),
fscEvent(3000, 1, 0),
fscEvent(15000, 0, 2, new.size = 3)
)
# four genetic blocks of different types on three chromosomes.
genetics <- fscSettingsGenetics(
fscBlock_snp(10, 1e-6, chromosome = 1),
fscBlock_dna(10, 1e-5, chromosome = 1),
fscBlock_microsat(3, 1e-4, chromosome = 2),
fscBlock_standard(5, 1e-3, chromosome = 3)
)
params <- fscWrite(demes = demes, events = events, genetics = genetics)
# runs 100 replicates, converting all DNA sequences to 0/1 SNPs
# will also output the MAF site frequency spectra (SFS) for all SNP loci.
params <- fscRun(params, num.sim = 100, dna.to.snp = TRUE, num.cores = 3)
# extracting only microsattelite loci from simulation replicate 1
msats <- fscReadArp(params, marker = "microsat")
# read SNPs from simulation replicate 5 with genotypes coded as 0/1
snp.5 <- fscReadArp(params, sim = 1, marker = "snp", coded.snps = TRUE
# read SFS for simulation 20
sfs.20 <- fscReadSFS(params, sim = 20)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab