startSimulation: Starts and initializes the data structures required for a...

Description Usage Arguments Examples

Description

Starts and initializes the data structures required for a simulation. A VCF file should be read beforehand with the function readVCF.

Usage

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)

sim1000G documentation built on June 10, 2019, 1:01 a.m.