Package: simfam 1.1.13.9000

Alejandro Ochoa

simfam: Simulate and Model Family Pedigrees with Structured Founders

The focus is on simulating and modeling families with founders drawn from a structured population (for example, with different ancestries or other potentially non-family relatedness), in contrast to traditional pedigree analysis that treats all founders as equally unrelated. Main function simulates a random pedigree for many generations, avoiding close relatives, pairing closest individuals according to a 1D geography and their randomly-drawn sex, and with variable children sizes to result in a target population size per generation. Auxiliary functions calculate kinship matrices, admixture matrices, and draw random genotypes across arbitrary pedigree structures starting from the corresponding founder values. The code is built around the plink FAM table format for pedigrees. There are functions that simulate independent loci and also functions that use an explicit recombination model to simulate linkage disequilibrium (LD) in the pedigree, as well as population analogs resembling the Li-Stephens model. Described in Yao and Ochoa (2023) <doi:10.7554/eLife.79238>.

Authors:Alejandro Ochoa [aut, cre]

simfam_1.1.13.9000.tar.gz
simfam_1.1.13.9000.zip(r-4.5)simfam_1.1.13.9000.zip(r-4.4)simfam_1.1.13.9000.zip(r-4.3)
simfam_1.1.13.9000.tgz(r-4.4-x86_64)simfam_1.1.13.9000.tgz(r-4.4-arm64)simfam_1.1.13.9000.tgz(r-4.3-x86_64)simfam_1.1.13.9000.tgz(r-4.3-arm64)
simfam_1.1.13.9000.tar.gz(r-4.5-noble)simfam_1.1.13.9000.tar.gz(r-4.4-noble)
simfam_1.1.13.9000.tgz(r-4.4-emscripten)simfam_1.1.13.9000.tgz(r-4.3-emscripten)
simfam.pdf |simfam.html
simfam/json (API)
NEWS

# Install 'simfam' in R:
install.packages('simfam', repos = c('https://ochoalab.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/ochoalab/simfam/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

4.89 score 2 stars 11 scripts 148 downloads 25 exports 19 dependencies

Last updated 2 days agofrom:9ee848a8c8. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 19 2024
R-4.5-win-x86_64OKNov 19 2024
R-4.5-linux-x86_64OKNov 19 2024
R-4.4-win-x86_64OKNov 19 2024
R-4.4-mac-x86_64OKNov 19 2024
R-4.4-mac-aarch64OKNov 19 2024
R-4.3-win-x86_64OKNov 19 2024
R-4.3-mac-x86_64OKNov 19 2024
R-4.3-mac-aarch64OKNov 19 2024

Exports:admix_famadmix_last_genbim_add_posgdraw_sexfam_ancestorsgeno_famgeno_last_gengeno_last_gen_admix_recombindexes_chrkinship_famkinship_last_genpop_recombprune_famrecomb_admix_indsrecomb_famrecomb_founder_blocks_inheritedrecomb_geno_indsrecomb_haplo_indsrecomb_init_foundersrecomb_last_genrecomb_map_fix_ends_chrrecomb_map_indsrecomb_map_simplify_chrsim_pedigreetidy_recomb_map_inds

Dependencies:clidplyrfansigenericsgluelatticelifecyclemagrittrMatrixpillarpkgconfigR6Rcpprlangtibbletidyselectutf8vctrswithr

simfam: simulate and model family pedigrees with structured founders

Rendered fromsimfam.Rmdusingknitr::rmarkdownon Nov 19 2024.

Last update: 2022-06-27
Started: 2021-08-04

Readme and manuals

Help Manual

Help pageTopics
Calculate admixture matrix of a pedigree with known admixture of foundersadmix_fam
Calculate admixture matrix for last generation of a pedigree with admixture of foundersadmix_last_gen
Calculate genetic positions from base pair positions and a genetic mapbim_add_posg
Draw sex values randomly for a list of individualsdraw_sex
Construct an ancestors-only pedigree for one person 'G'-generations deepfam_ancestors
Draw random genotypes on a pedigree with known founder genotypesgeno_fam
Draw random genotypes for last generation of a pedigree with known founder genotypesgeno_last_gen
Simulate an admixed family efficiently with founders with LDgeno_last_gen_admix_recomb
Extract last index of every chromosome in a vector of chromosomesindexes_chr
Calculate kinship matrix of a pedigree with structured founderskinship_fam
Calculate kinship matrix for last generation of a pedigree with structured founderskinship_last_gen
Simulate genotypes with linkage disequilibrium (LD) given a population of haplotypes, using a Li-Stephens-like model of haplotype copyingpop_recomb
Remove non-ancestors of a set of individuals from pedigreeprune_fam
Reduce haplotype ancestry data to population ancestry dosage matricesrecomb_admix_inds
Draw recombination breaks for autosomes from a pedigreerecomb_fam
Identify IBD blocks of founders that were inherited by at least one individual in this datarecomb_founder_blocks_inherited
Reduce haplotype data to genotype matrixrecomb_geno_inds
Construct haplotypes of individuals given their ancestral blocks and the ancestral haplotype variantsrecomb_haplo_inds
Initialize chromosome structures for foundersrecomb_init_founders
Draw recombination breaks for autosomes for last generation of a pedigreerecomb_last_gen
Extrapolate and shift recombination map of one chromosome to endsrecomb_map_fix_ends_chr
Simplified recombination maps for human genomesrecomb_map_hg recomb_map_hg37 recomb_map_hg38
Map recombination breaks from genetic positions to base pair coordinatesrecomb_map_inds
Simplify recombination map of one chromosome to a desired numerical precisionrecomb_map_simplify_chr
Construct a random pedigreesim_pedigree
Tidy recombination block data inherited in individuals from founderstidy_recomb_map_inds