Using spip and summarizing its output

Functions for running a spip simulation, reading its output back into R, and processing the output into pairs of related samples

install_spip()

Download the spip binary and install it where CKMRpop expects it

run_spip()

Run spip in a user-specified directory

slurp_spip()

Read in the pedigree, census, and sampling information from the spip run

compile_related_pairs()

compile pairwise relationships from the samples

spip_exists()

return TRUE if spip exists where it should be installed.

spip_help()

print the abbreviated usage information from spip

spip_help_full()

print the full usage information from spip

downsample_pairs()

downsample the number of individuals sampled

Designing spip parameters

Functions for obtaining spip parameters desired for simulating given situations

leslie_from_spip()

Return a Leslie-like matrix from the spip parameters

Visualizing simulation results

High-level functions for visualizing the results of spip simulations

count_and_plot_ancestry_matrices()

Count up the number of different kinds of related pairs and make a plot

count_and_plot_mate_distribution()

Count and plot the number of mates each individuals has produced offspring with

ggplot_census_by_year_age_sex()

Just a simple plot function

plot_conn_comps()

plot the graph showing the connected components

summarize_offspring_and_mate_numbers()

Summarize the distribution of number of offspring and number of mates

summarize_survival_from_census()

Summarize annual sex-and-age-specific survival rates from the census information

uncooked_spaghetti()

Summarise kin-pair information and use it to create uncooked spaghetti plots

Helper functions

Low-level functions used in some of the above functions. Most users will typically not interact with these functions directly.

plot_amm_from_matrix()

plot an ancestry matrix (or multiple such matrices) from its (their) matrix form

amm2tibble()

convert an ancestry-matching matrix to a ggplot-able tibble

relationship_zone_perimeters()

Return the perimeters of all the relationship zones

Example package data

Package data sets that are used in the examples: either parameter values or examples of spip output.

species_1_life_history

a list of life-history / life-table data for a hypothetical species

species_2_life_history

a list of life-history / life-table data for another hypothetical species

species_1_slurped_results

The result of running spip in the species_1_simulation vignette.

species_1_slurped_results_100_loci

The result of running spip in the species_1_simulation vignette with 100 loci.

species_1_slurped_results_1gen

The result of running spip in the species_1_simulation vignette and slurping out with num_generations = 1.

three_pops_no_mig_slurped_results

The result of running spip and slurping the output in the three population case with no migration

three_pops_with_mig_slurped_results

The result of running spip and slurping the output in the three population case with migration

growth_0.01_results

The result of running spip with growth 0.01 in the population-growth-with-spip vignette

growth_n0.005_results

The result of running spip with growth -0.005 in the population-growth-with-spip vignette

Helper package data

Package data sets that define values used primarily internally in functions or for some external examples

empty_crp

A tibble like that produced by compile_related_pairs(), but with zero rows

example_amms

a list of examples of ancestry-match matrices

half_first_cousin_amm

A half-first cousin ancestry match matrix

necessary_generations

Minimum number of generations for the ancestry match matrix to include relationship types

relationship_zone_names

relationship zone names

relatives_from_ancestry_vectors()

Find relatives amongst samples from their ancestor vectors