startSimulation {sim1000G} | R Documentation |
Starts and initializes the data structures required for a simulation. A VCF file should be read beforehand with the function readVCF.
Description
Starts and initializes the data structures required for a simulation. A VCF file should be read beforehand with the function readVCF.
Usage
startSimulation(vcf, totalNumberOfIndividuals = 2000, subset = NA,
randomdata = 0, typeOfGeneticMap = "download")
Arguments
vcf |
Input vcf file of a region (can be .gz). Must contain phased data. |
totalNumberOfIndividuals |
Maximum Number of individuals to allocate memory for. Set it above the number of individuals you want to simulate. |
subset |
A subset of individual IDs to use for simulation |
randomdata |
If 1, disregards the genotypes in the vcf file and generates independent markers that are not in LD. |
typeOfGeneticMap |
Specify whether to download a genetic map for this chromosome |
Examples
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)
[Package sim1000G version 1.40 Index]