GSImulate: Simulate baseline and mixture files into the current working...

Description Usage Arguments Examples

Description

This is a wrapper around ms2geno that should make it much easier to use

Usage

1
2
3
GSImulate(refsizes, mixsizes, num_loci, num_sets, variability_string,
  marker_pars, M_num = NULL, M_matrix = NULL, repunits = character(0),
  ploidy = 2, write_012 = FALSE)

Arguments

refsizes

integer vector of sample sizes for the reference samples from each collection (population)

mixsizes

integer vector of samples sizes of individuals that go into the mixture data set.

num_loci

the number of loci to simulate

num_sets

desired number of data sets.

variability_string

the command to pass to ms to influence the number of segregating sites. Either something like "-s 20" for fixed number of segsites, or "-t 8" to set the value of theta to 8.

marker_pars

a string that gives all the command line arguments needed for either microsatellites or SNPs (but not both!) to be simulated. See the documentation for ms2geno.

M_num

a number for 4Nem to be passed to ms to make a symmetrical island model. Gets overridden by M_matrix if M_matrix is present (i.e. non-NULL). Set this to NA if you want to simulate a single panmictic population that is masquerading as multiple populations using ms2geno's –ms-pop-override option.

M_matrix

a full migration matrix if you want to pass one in. Will override M_num if present. By default it will be NULL.

repunits

optional vector that must be the same length as refsizes and which gives the reporting units to which each collection belongs (NOT IMPLEMENTED)

ploidy

the ploidy of the organisms to be simulated.

write_012

logical. If TRUE, writes Basefile and Mixfile as sets of 012 files to be read by, for example, genoscapeRtools::read_012. Default is FALSE

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# microsatellites
GSImulate(
   refsizes = c(200, 200, 150, 100),
   mixsizes = c(25, 25, 10, 30),
   num_loci = 20,
   num_sets = 5,
   variability_string = "-t 2.4",
   marker_pars = "-u .15 3",
   M_num = 5)

# microsatellites using --ms-pop-override
GSImulate(
   refsizes = c(200, 200, 150, 100),
   mixsizes = c(25, 25, 10, 30),
   num_loci = 20,
   num_sets = 5,
   variability_string = "-t 2.4",
   marker_pars = "-u .15 3",
   M_num = NA)

# SNPs ascertained from 8 individuals from each population
# and taken if all three genotypes are seen
GSImulate(
   refsizes = c(200, 200, 150, 100),
   mixsizes = c(25, 25, 10, 30),
   num_loci = 20,
   num_sets = 5,
   variability_string = "-t 2.4",
   marker_pars = "-s 1 8 -2 -s 2 8 -2 -s 3 8 -2 -s 4 8 -2 --all-pops-geno-asc",
   M_num = 5)

eriqande/GSImulator documentation built on May 16, 2019, 8:44 a.m.