High level simulation functions

These are functions that are intended for use by the user when preparing inputs for a gscramble simulation and for conducting those simulation.

create_GSP()

Create a GSP from user inputs about what type of hybrids from which populations to create hybrids

segregate()

Segregate segments down genomic simulation pedigrees

segments2markers()

Map alleles from scrambled founders to the sampled segments from a GSP.

renumber_GSP()

Renumber GSP members by adding a constant to each

Functions for summarizing and visualizing simulation results or inputs

These are just a few functions to summarize the results from gscramble simulations or to visualize GSPs.

computeQs_from_segments()

return the admixture fractions of sampled individuals

plot_simulated_chromomsome_segments()

Plot the simulated chromosomes of an individual

gsp2dot()

Write a dot file to represent a genome simulation pedigree

Data input and output functions

These functions help to get data in PLINK format into gscramble, and also converting gscramble objects into PLINK or newhybrids input files.

plink2gscramble()

read plink-formatted .map and .ped files into 'gscramble' format

gscramble2plink()

Write 'gscramble' I_meta, M_meta, and Geno to a plink file

plink_map2rec_rates()

Convert a PLINK map file to 'gscramble' RecRates bins in a tibble

gscramble2newhybrids()

Convert 'gscramble' output to newhybrids format

Functions for checking the formatting and validity of inputs

These functions, some of which are used internally by other functions, can let the user check to see if their inputs are OK.

check_chrom_lengths()

check that the chromosome lengths are acceptable given recombination rates

check_gsp_for_validity_and_saturation()

Check that GSP does not reuse genetic material and yet uses all of it

check_pedigree_for_inbreeding()

Check the a GSP (in prepped list format) for inbreeding loops

check_reppop()

check that the RepPop is formatted correctly

Example data objects

These data objects are provided as examples of the inputs to gscramble. They are used in the vignettes as well.

Geno

Genotype matrix of 78 individuals and 100 SNP markers

I_meta

Metadata for 78 individuals

M_meta

Metadata for 100 molecular markers

RecRates

Recombination rate data for many roughly 1 Mb bins

gsp4

Tibble holding specification for a 7 member genomic permutation pedigree.

GSP

Example Genomic Simulation Pedigree, GSP, with 13 members

RepPop1

A simple example of a reppop table

RepPop4

Another simple example of a reppop table

GSP_opts

A list of tibbles specifying the pedigrees available from createGSP()

example_segments

Example of a segments tibble

gsp3

Tibble holding specification for a 5 member genomic permutation pedigree.

example_chrom_lengths

Lengths of the three chromosomes used in the example data set

Low-level functions

These are functions that are not intended for use by the general user, but they are included in the documentation for the interest of developers and they are exported in the package to help with debugging and development.

drop_segs_down_gsp()

High level function for dropping segments down a GSP

make_subscript_matrix()

makes a two-column matrix for subscripting alleles out of a genotype matrix

mat_scramble()

Scramble a matrix of genotype data

perm_gs_by_pops()

Take the output of rearrange_genos and permute everyone by population

prep_gsp_for_hap_dropping()

Take a gsp in tibble form and make a list suitable for gene dropping

rearrange_genos()

rearrange genotypes into separate columns for each haplotype.

recomb_point()

Randomly sample the positions of recombinations on a chromosome

seg2tib()

Takes a gamete in segment format and returns a tibble with Pop and indiv_index

seg_haps_through_gsp()

Segregate haplotypes through a genome simulation pedigree list

sim_level_founder_haplos()

computes the simulation-level founder haplotype index for each founder haplo

tidy_up_sampled_haplos()

takes the waka_waka table and returns a simple tibble with results for each sampled "hybridized" gamete from each chromosome #' Not yet documented

xover()

internal function to do crossovers and create recombinations