Learn R Programming

LTFGRS

LTFGRS is an R package that provides a unified interface to perform several phenotype-based family genetic risk scores (FGRS) as well as functions to perform the required data preparation and management steps.

The implemented methods are LT-FH++, PA-FGRS, and Kendler's FGRS. The primary focus of the package is LT-FH++ and PA-FGRS. They share many similarities in their models, since they are both based on the same underlying liability threshold model with modifications. This package allows users to pick and chose which elements of those methods they want to use. Notable properties of the package are:

  • Automatic identification of family members up to n'th degree.
  • personalised thresholds for each included family that can account for:
    • age of diagnosis
    • censoring
    • cohort effects
    • sex
    • family-wise censoring
  • mixture distribution to handle partially observed controls.

Installation

You can install the development version of LTFGRS from GitHub with:

remotes::install_github("EmilMiP/LTFGRS")

You can install the LTFGRS from CRAN with:

install.packages("LTFGRS")

Documentation and Tutorials

Documentation and tutorials for the package can be found in the pkgdown site.

Copy Link

Version

Install

install.packages('LTFGRS')

Version

1.0.0

License

GPL (>= 3)

Maintainer

Emil Michael Pedersen

Last Published

July 7th, 2025

Functions in LTFGRS (1.0.0)

estimate_liability_multi

Estimating the genetic or full liability for multiple phenotypes
estimate_liability_single

Estimating the genetic or full liability
extract_estimation_info_graph

Title Internal Function used to extact input needed from graph input for liability estimation
convert_cir_to_age

Convert cumulative incidence rate to age
convert_format

Attempts to convert the list entry input format to a long format
extract_estimation_info_tbl

Title Internal Function used to extact input needed for liability estimation
get_family_graphs

Automatically identify family members of degree n
get_all_combs

construct all combinations of input vector
get_onset_time

Calculate age of diagnosis, age at end of follow up, and status
get_covmat

Construct kinship matrix from graph
kendler_family_calculations

Title Helper function for Kendler's FGRS
prepare_graph

Construct graph from register information
familywise_censoring

Censor Family Onsets for Multiple Families
estimate_gen_liability_ltfh

Estimate genetic liability similar to LT-FH
correct_positive_definite

Positive definite matrices
simulate_under_LTM_multi

Simulate under the liability threshold model (multiple phenotypes).
kendler

Title Kendler's FGRS
fixSexCoding

Fixing sex coding in trio info
familywise_attach_attributes

Wrapper to attach attributes to family graphs
simulate_under_LTM_single

Simulate under the liability threshold model (single phenotype).
rtmvnorm.gibbs

Gibbs Sampler for the truncated multivariate normal distribution
tnorm_mixture_conditional

Title: Calculates mean and variance of mixture of two truncated normal distributions
tnorm_mean

Title: Calculate the mean of the truncated normal distribution
graph_to_trio

Convert from igraph to trio information
graph_based_covariance_construction_multi

Constructing covariance matrix from local family graph for multi trait analysis
simulate_under_LTM

Simulate under the liability threshold model.
graph_based_covariance_construction

Constructing covariance matrix from local family graph
truncated_normal_cdf

CDF for truncated normal distribution.
get_relatedness

Relatedness between a pair of family members
tnorm_var

Title: Calculate the variance of the truncated normal distribution
prepare_thresholds

Calculate (personalised) thresholds based on CIPs.
Gibbs_estimator

Wrapper around the Gibbs Sampler that returns formatted liability estimates for the proband
construct_covmat_multi

Constructing a covariance matrix for multiple phenotypes
convert_age_to_cir

Convert age to cumulative incidence rate
attach_attributes

Attach attributes to a family graphs
convert_age_to_thresh

Convert age to threshold
construct_covmat

Constructing a covariance matrix for a variable number of phenotypes
PA_algorithm

Title Pearson-Aitken algorithm to calculate mean values in truncated multivariate normal distributions
censor_family_onsets

Censor onset times in a family based on a proband's end of follow-up.
construct_covmat_single

Constructing a covariance matrix for a single phenotype
LTFGRS-package

LTFGRS: Implementation of Several Phenotype-Based Family Genetic Risk Scores
convert_liability_to_aoo

Convert liability to age of onset
estimate_liability

Estimating the genetic or full liability for a variable number of phenotypes
convert_observed_to_liability_scale

Convert the heritability on the observed scale to that on the liability scale