carrier_probabilities: Calculate carrier probabilities for the most heritable...

Description Usage Arguments Value References Examples

View source: R/carrier_probabilities.R

Description

For each person in dat and each methylation site in top_probes, this function calculates the probability that the person carries a rare mutation at a hypothetical genetic locus that affects methylation at the methylation site.

Usage

1
carrier_probabilities(dat, M_values, top_probes, ncores = 1)

Arguments

dat

A data frame with rows corresponding to people and columns corresponding to (at least) the following variables, which will be coerced to character type:

  • family (family ID), an identifier for each person's family, constant within families

  • indiv (individual ID), an identifier for each person, with no duplicates across the dataset

  • mother (mother ID), the individual ID of each person's mother, or missing (NA) for founders

  • father (father ID), the individual ID of each person's father, or missing (NA) for founders

  • typed (epi-genotyped), equal to 1 for people with methylation data and 0 for all others

M_values

A matrix of M-values, with rows corresponding to methylation sites and columns corresponding to people.

top_probes

A data frame, usually the output of ML_estimates restricted to the most heritable methylation sites (those with the highest values of Δl). See ML_estimates and the example below for more details.

ncores

The number of cores to be used, with ncores = 1 (the default) corresponding to non-parallel computing. When ncores > 1, the parallel package is used to parallelize the calculation.

Value

A data frame containing the carrier probabilities described in (Joo et al., 2018), with rows of the data frame corresponding to the people in dat and columns corresponding to the methylation sites in top_probes. This calculation is based on the Mendelian model of (Joo et al., 2018) with parameter values taken from top_probes.

References

Joo JE, Dowty JG, Milne RL, Wong EM, Dugué PA, English D, Hopper JL, Goldgar DE, Giles GG, Southey MC, kConFab. Heritable DNA methylation marks associated with susceptibility to breast cancer. Nat Commun. 2018 Feb 28;9(1):867. https://doi.org/10.1038/s41467-018-03058-6

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
str(ped)
str(M_values)

# Calculate genotype probabilities
typed_genos <- genotype_combinations(ped)
str(typed_genos)


# Compute Delta l
MLEs <- ML_estimates(typed_genos, M_values, ncores = 4)

# Select top probes
top_probes <- MLEs[MLEs$delta.l > 10, ]

# Calculate carrier probabilities
CP <- carrier_probabilities(ped, M_values, top_probes, ncores = 2)
str(CP)

heritEWAS documentation built on July 1, 2020, 6:02 p.m.