
Last chance! 50% off unlimited learning
Sale ends in
Starts and initializes the data structures required for a simulation. A VCF file should be read beforehand with the function readVCF.
startSimulation(vcf, totalNumberOfIndividuals = 2000, subset = NA,
randomdata = 0, typeOfGeneticMap = "download")
Input vcf file of a region (can be .gz). Must contain phased data.
Maximum Number of individuals to allocate memory for. Set it above the number of individuals you want to simulate.
A subset of individual IDs to use for simulation
If 1, disregards the genotypes in the vcf file and generates independent markers that are not in LD.
Specify whether to download a genetic map for this chromosome
# NOT RUN {
library("sim1000G")
library(gplots)
examples_dir = system.file("examples", package = "sim1000G")
vcf_file = file.path(examples_dir, "region.vcf.gz")
vcf = readVCF( vcf_file, maxNumberOfVariants = 100)
genetic_map_of_region = system.file(
"examples",
"chr4-geneticmap.txt",
package = "sim1000G"
)
readGeneticMapFromFile(genetic_map_of_region)
pdf(file=tempfile())
plotRegionalGeneticMap(vcf$vcf[,2]+1)
dev.off()
startSimulation(vcf, totalNumberOfIndividuals = 200)
# }
Run the code above in your browser using DataLab