Learn R Programming

SimRVPedigree

Simulate Pedigrees Ascertained for Rare Disease

Under Construction

Please note: this version of SimRVPedigree may be under construction. For the latest stable version of SimRVPedigree please visit https://CRAN.R-project.org/package=SimRVPedigree.

Installation

You can install SimRVPedigree from github with:

# install.packages("devtools")
devtools::install_github("cnieuwoudt/SimRVPedigree")

Overview

SimRVPedigree provides routines to simulate and manipulate pedigrees ascertained to contain multiple family members affected by a rare disease.

To simulate pedigrees or to simulate life events for an individual we provide: * sim_RVped() to simulate pedigrees ascertained for multiple disease-affected relatives, * sim_ped() to simulate pedigrees, and * sim_life() to simulate life events until a specified stop-year.

To manipulate pedigrees we provide: * plot.ped() to plot pedigrees, * summary.ped() to obtain summary information for a pedigree or a collection of pedigrees, * censor_ped() to censor a pedigree after a specified year, and * reassign_gen() to reassign generation number based on the most recent common ancestor of all disease-affected relatives.

Example

library(SimRVPedigree)

#Load example age-specific hazard rates data.
data(AgeSpecific_Hazards)

#Create an object of class hazard.
HRates <- hazard(hazardDF = AgeSpecific_Hazards)

#Simulate a pedigree ascertained for multiple disease-affected relatives
set.seed(5444)
ex_ped <- sim_RVped(hazard_rates = HRates,
                    GRR = 20,
                    RVfounder = TRUE,
                    FamID = 1,
                    founder_byears = c(1900, 1950),
                    ascertain_span = c(1995, 2015),
                    num_affected = 2,
                    stop_year = 2017,
                    recall_probs = c(1, 1, 0.25, 0))

# Plot the ascertained pedigree
plot(ex_ped[[2]], ref_year = 2017, cex = 0.75)


# Obtain summary information for the ascertained pedigree.
summary(ex_ped[[2]])
#> $family_info
#>   FamID totalRelatives numAffected aveOnsetAge aveIBD ascertainYear segRV
#> 1     1             15           2          56    0.5          2015  TRUE
#> 
#> $affected_info
#>   FamID ID birthYr onsetYr deathYr proband RVstatus
#> 1     1  4    1936    1996    1998   FALSE        1
#> 2     1  7    1963    2015      NA    TRUE        1

Copy Link

Version

Install

install.packages('SimRVPedigree')

Monthly Downloads

29

Version

0.4.4

License

GNU General Public License

Maintainer

Christina Nieuwoudt

Last Published

February 9th, 2020

Functions in SimRVPedigree (0.4.4)

create_founder

Create a new seed founder
ped2pedigree

Create a kinship2 pedigree structure from an object of class ped
get_nextEvent

Simulate the next life event
is.hazard

Check to see if object is of class hazard
get_wait_prob

Obtain the cumulative probability of the waiting time to the next event
create_pedFile

Create an empty pedigree
create_mate

Create a new mate
get_wait_time

obtain the waiting time to the next event
get_onsetHazard

Calculate the onset hazard for an individual
is.ped

Check to see if object is of class ped
pedigreeLabels

Create pedigree labels
disqualify_ped

Initial checks to disqualify a pedigree from ascertainment.
sim_ped

Simulate a pedigree
check_ped

Checks ped_file for expected information, used before converting to ped object.
choose_proband

Choose a proband from the disease-affected relatives in a pedigree
find_mrca

Find the most recent common ancestor of two pedigree members
events

Constructor function for an object of class events
get_ind_data

Get individual data for sim_pop function
find_missing_parent

Find parents that have been removed but are required for plotting.
get_kinship

Compute kinship matrix for the affected relatives
sim_pop

Simulate survival data for a population sample
find_available_parent

Find available parent
get_affectedInfo

Gather information for the affected relatives
reassign_gen

Reassign generation number based on affected status
plot.ped

Plot pedigree
hazard

Create an object of class hazard.
summary.ped

Summarize a sample of pedigrees
trim_ped

Trim pedigree based on proband recall
sim_RVped

Simulate a pedigree ascertained to contain multiple disease-affected relatives
new.ped

Create an object of class ped.
get_famInfo

Obtain summary information
is.events

Check to see if object is of class ped
sim_life

Simulate all life events
get_gen_labs

Get generation lables
sim_founderRVstatus

Determine founder genotype at the disease locus and determime their relative-risk of disease
sim_nFam

Simulate a nuclear family from a single founder
ped

Constructor function for an object of class ped
censor_ped

Censor pedigree data
SimRVPedigree

Simulate pedigrees ascertained for disease status
SubtypeHazards

Age-specific hazard rate dataset with subtypes
AgeSpecific_Hazards

Age-specific hazard rate dataset
ascertain_ped

Determine if a pedigree is ascertained
ascertainTrim_ped

Check to see if a trimmed pedigree is ascertained.
EgPeds

Example pedigrees
assign_gen

Assign generation number based on oldest founder
create_offspring

Create a new offspring