founder.simulation {MoBPS} | R Documentation |
Founder simulation
Description
Function to generate founder genotypes
Usage
founder.simulation(
nindi = 100,
sex.quota = 0.5,
nsnp = 0,
n.gen = 100,
nfinal = NULL,
sex.quota.final = NULL,
big.output = FALSE,
plot = TRUE,
display.progress = TRUE,
depth.pedigree = 7,
dataset = NULL,
vcf = NULL,
chr.nr = NULL,
bp = NULL,
snp.name = NULL,
hom0 = NULL,
hom1 = NULL,
bpcm.conversion = 0,
freq = "beta",
sex.s = "fixed",
chromosome.length = NULL,
length.before = 5,
length.behind = 5,
snps.equidistant = NULL,
change.order = FALSE,
snp.position = NULL,
position.scaling = FALSE,
bit.storing = FALSE,
nbits = 30,
randomSeed = NULL,
miraculix = TRUE,
miraculix.dataset = TRUE,
template.chip = NULL,
beta.shape1 = 1,
beta.shape2 = 1,
map = NULL,
verbose = TRUE,
vcf.maxsnp = Inf
)
Arguments
nindi |
number of inidividuals to generate in a random dataset |
sex.quota |
Share of newly added female individuals (deterministic if sex.s="fixed", alt: sex.s="random") |
nsnp |
number of markers to generate in a random dataset |
n.gen |
Number of generations to simulate (default: 100) |
nfinal |
Number of final individuals to include (default: nindi) |
sex.quota.final |
Share of female individuals in the final generation |
big.output |
Set to TRUE to export map, population list and pedigree relationship |
plot |
Set to FALSE to not generate LD-decay plot and allele frequency spectrum |
display.progress |
Set FALSE to not display progress bars. Setting verbose to FALSE will automatically deactive progress bars |
depth.pedigree |
Depth of the pedigree in generations (default: 7) |
dataset |
SNP dataset, use "random", "allhetero" "all0" when generating a dataset via nsnp,nindi |
vcf |
Path to a vcf-file used as input genotypes (correct haplotype phase is assumed!) |
chr.nr |
Vector containing the assosiated chromosome for each marker (default: all on the same) |
bp |
Vector containing the physical position (bp) for each marker (default: 1,2,3...) |
snp.name |
Vector containing the name of each marker (default ChrXSNPY - XY chosen accordingly) |
hom0 |
Vector containing the first allelic variant in each marker (default: 0) |
hom1 |
Vector containing the second allelic variant in each marker (default: 1) |
bpcm.conversion |
Convert physical position (bp) into a cM position (default: 0 - not done) |
freq |
frequency of allele 1 when randomly generating a dataset |
sex.s |
Specify which newly added individuals are male (1) or female (2) |
chromosome.length |
Length of the newly added chromosome (default: 5) |
length.before |
Length before the first SNP of the dataset (default: 5) |
length.behind |
Length after the last SNP of the dataset (default: 5) |
snps.equidistant |
Use equidistant markers (computationally faster! ; default: TRUE) |
change.order |
If TRUE sort markers according to given marker positions |
snp.position |
Location of each marker on the genetic map |
position.scaling |
Manual scaling of snp.position |
bit.storing |
Set to TRUE if the MoBPS (not-miraculix! bit-storing is used) |
nbits |
Bits available in MoBPS-bit-storing |
randomSeed |
Set random seed of the process |
miraculix |
If TRUE use miraculix package for data storage, computations and dataset generation |
miraculix.dataset |
Set FALSE to deactive miraculix package for dataset generation |
template.chip |
Import genetic map and chip from a species ("cattle", "chicken", "pig") |
beta.shape1 |
First parameter of the beta distribution for simulating allele frequencies |
beta.shape2 |
Second parameter of the beta distribution for simulating allele frequencies |
map |
map-file that contains up to 5 colums (Chromsome, SNP-id, M-position, Bp-position, allele freq - Everything not provides it set to NA). A map can be imported via MoBPSmaps::ensembl.map() |
verbose |
Set to FALSE to not display any prints |
vcf.maxsnp |
Maximum number of SNPs to include in the genotype file (default: Inf) |
Examples
population <- founder.simulation(nindi=100, nsnp=1000, n.gen=5)