Package: BGmisc 1.3.2

S. Mason Garrison

BGmisc: An R Package for Extended Behavior Genetics Analysis

The BGmisc R package offers a comprehensive suite of functions tailored for extended behavior genetics analysis, including model identification, calculating relatedness, pedigree conversion, pedigree simulation, and more.

Authors:S. Mason Garrison [aut, cre], Michael D. Hunter [aut], Xuanyu Lyu [aut], Rachel N. Good [ctb], Jonathan D. Trattner [aut], S. Alexandra Burt [aut]

BGmisc_1.3.2.tar.gz
BGmisc_1.3.2.zip(r-4.5)BGmisc_1.3.2.zip(r-4.4)BGmisc_1.3.2.zip(r-4.3)
BGmisc_1.3.2.tgz(r-4.4-any)BGmisc_1.3.2.tgz(r-4.3-any)
BGmisc_1.3.2.tar.gz(r-4.5-noble)BGmisc_1.3.2.tar.gz(r-4.4-noble)
BGmisc_1.3.2.tgz(r-4.4-emscripten)BGmisc_1.3.2.tgz(r-4.3-emscripten)
BGmisc.pdf |BGmisc.html
BGmisc/json (API)
NEWS

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

Peer review:

Bug tracker:https://github.com/r-computing-lab/bgmisc/issues

Datasets:
  • hazard - Simulated pedigree with two extended families and an age-related hazard
  • inbreeding - Artificial pedigree data on eight families with inbreeding
  • potter - Fictional pedigree data on a wizarding family

On CRAN:

behavior-genetics

37 exports 1 stars 2.31 score 21 dependencies 34 scripts 1.2k downloads

Last updated 3 months agofrom:0c3a7b39a8. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 16 2024
R-4.5-winOKSep 16 2024
R-4.5-linuxOKSep 16 2024
R-4.4-winOKSep 16 2024
R-4.4-macOKSep 16 2024
R-4.3-winOKSep 16 2024
R-4.3-macOKSep 16 2024

Exports:allGenscalculateRelatednesscheckIDscheckSexcomp2vechcreateGenDataFramedropLinkevenInsertfamSizeCalfitComponentModelidentifyComponentModelinferRelatednessmakeInbreedingmakeTwinsped2addped2ceped2cnped2comped2famped2graphped2maternalped2mitped2paternalplotPedigreereadGedcomrecodeSexrelated_coefrelatednessrepairSexresampleSimPedsimulatePedigreesummarizeFamiliessummarizeMatrilinessummarizePatrilinessummarizePedigreesvech

Dependencies:clicpp11data.tableevaluategluehighrigraphkinship2knitrlatticelifecyclemagrittrMatrixpkgconfigquadprogrlangstringistringrvctrsxfunyaml

Modeling and Relatedness

Rendered frommodelingrelatedness.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2024-02-26
Started: 2023-09-10

Network tools for finding extended pedigrees and path tracing

Rendered fromnetwork.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2024-06-10
Started: 2023-09-10

Pedigree Simulation and Visualization with BGmisc

Rendered frompedigree.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2024-06-10
Started: 2023-09-10

Calculating and Inferring Relatedness Coefficients with BGmisc

Rendered fromanalyticrelatedness.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2024-06-16
Started: 2023-09-11

Validation tools for identifying and repairing errors in pedigrees

Rendered fromvalidation.Rmdusingknitr::rmarkdownon Sep 16 2024.

Last update: 2024-06-16
Started: 2024-06-10

Readme and manuals

Help Manual

Help pageTopics
Generate or Adjust Number of Kids per Couple Based on Mating RateadjustKidsPerCouple
allGens A function to calculate the number of individuals in each generation. This is a supporting function for 'simulatePedigree'.allGens
Assign Couple IDsassignCoupleIds
Process Generation ConnectionsbuildBetweenGenerations
Process Generations for Pedigree SimulationbuildWithinGenerations
Falconer's FormulacalculateH
Calculate Relatedness CoefficientcalculateRelatedness
Validates and Optionally Repairs Unique IDs in a Pedigree DataframecheckIDs
Validates and Optionally Repairs Sex Coding in a Pedigree DataframecheckSex
comp2vech Turn a variance component relatedness matrix into its half-vectorizationcomp2vech
Create Data Frame for GenerationcreateGenDataFrame
Determine Sex of OffspringdetermineSex
dropLink A function to drop a person from his/her parents in the simulated pedigree 'data.frame'. The person can be dropped by specifying his/her ID or by specifying the generation which the randomly to-be-dropped person is in. The function can separate one pedigree into two pedigrees. Separating into small pieces should be done by running the function multiple times. This is a supplementary function for 'simulatePedigree'.dropLink
evenInsert A function to insert m elements evenly into a length n vector.evenInsert
famSizeCal A function to calculate the total number of individuals in a pedigree given parameters. This is a supporting function for function 'simulatePedigree'famSizeCal
fitComponentModel Fit the estimated variance components of a model to covariance datafitComponentModel
Simulated pedigree with two extended families and an age-related hazardhazard
identifyComponentModel Determine if a variance components model is identifiedidentifyComponentModel
Artificial pedigree data on eight families with inbreedinginbreeding
Infer Relatedness CoefficientinferRelatedness
makeInbreeding A function to create inbred mates in the simulated pedigree 'data.frame'. Inbred mates can be created by specifying their IDs or the generation the inbred mate should be created. When specifying the generation, inbreeding between siblings or 1st cousin needs to be specified. This is a supplementary function for 'simulatePedigree'.makeInbreeding
makeTwins A function to impute twins in the simulated pedigree 'data.frame'. Twins can be imputed by specifying their IDs or by specifying the generation the twin should be imputed. This is a supplementary function for 'simulatePedigree'.makeTwins
Mark and Assign childrenmarkPotentialChildren
Take a pedigree and turn it into an additive genetics relatedness matrixped2add
Take a pedigree and turn it into an extended environmental relatedness matrixped2ce
Take a pedigree and turn it into a common nuclear environmental relatedness matrixped2cn
Take a pedigree and turn it into a relatedness matrixped2com
Segment Pedigree into Extended Familiesped2fam
Turn a pedigree into a graphped2graph
Add a maternal line ID variable to a pedigreeped2maternal
Take a pedigree and turn it into a mitochondrial relatedness matrixped2mit ped2mt
Add a paternal line ID variable to a pedigreeped2paternal
plotPedigree A wrapped function to plot simulated pedigree from function 'simulatePedigree'. This function require the installation of package 'kinship2'.plotPedigree
Fictional pedigree data on a wizarding familypotter
Read a GEDCOM FilereadGedcom
Recodes Sex Variable in a Pedigree DataframerecodeSex
related_coef (Deprecated)related_coef
relatedness (Deprecated)relatedness
Repair Missing IDsrepairIDs
Repairs Sex Coding in a Pedigree DataframerepairSex
Resample Elements of a Vectorresample
SimPed (Deprecated)SimPed
Simulate Pedigrees This function simulates "balanced" pedigrees based on a group of parameters: 1) k - Kids per couple; 2) G - Number of generations; 3) p - Proportion of males in offspring; 4) r - Mating rate.simulatePedigree
sizeAllGens An internal supporting function for 'simulatePedigree'.sizeAllGens
Summarize the families in a pedigreesummarizeFamilies
Summarize the maternal lines in a pedigreesummarizeMatrilines
Summarize the paternal lines in a pedigreesummarizePatrilines
Summarize Pedigree DatasummarizePedigrees
vech Create the half-vectorization of a matrixvech