Skip to content

circadia-bio/R-itable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ§‘β€πŸ§‘β€πŸ§’β€πŸ§’ R-itable

Profile-likelihood heritability estimation for family cohort studies β€” no SOLAR required.

R License: MIT Lifecycle: experimental Status


⚠️ Ritable is in early development and has not been formally tested. The API may change without notice, estimation results have not yet been validated against a reference implementation such as SOLAR Eclipse, and the package has not undergone peer review. Use with caution and verify outputs independently before using in any research context.


πŸ“– What is R-itable?

R-itable (library(Ritable)) estimates narrow-sense heritability (hΒ²) for quantitative traits in pedigree-based family cohort studies. It implements a profile-likelihood variance-components approach equivalent to SOLAR Eclipse β€” without any proprietary dependencies, compiled code, or external binaries.

Built for neuroimaging and biomedical cohorts where you need to run heritability over dozens of traits across multiple covariate models and get results you can trace back to first principles.


✨ Features

  • πŸ”¬ Profile-likelihood VC estimator β€” eigendecomposition of the GRM, 1-D optimisation, exact LRT with one-sided χ²(1) boundary correction (matching SOLAR).
  • πŸ“ Profile-likelihood CIs β€” not Wald Β±1.96 SE; proper asymmetric intervals via uniroot().
  • πŸ”„ INT transformation β€” inverse-normal transform applied internally; also exported as int_transform() for use in other pipelines.
  • πŸ“¦ Batch mode β€” herit_batch() iterates over traits Γ— covariate models and returns a tidy data frame, ready for tables and figures.
  • 🌲 Forest plots β€” plot_forest() for immediate visualisation of batch output (requires ggplot2).
  • 🧩 Minimal dependencies β€” core functions require only base R, kinship2, rlang, and cli.

πŸ—‚οΈ Project Structure

R-itable/
β”œβ”€β”€ R/
β”‚   β”œβ”€β”€ itable-package.R       # package-level docs
β”‚   β”œβ”€β”€ build_grm.R            # build additive GRM from pedigree
β”‚   β”œβ”€β”€ int_transform.R        # rank-based inverse-normal transform
β”‚   β”œβ”€β”€ herit_vc.R             # single-trait VC estimator
β”‚   β”œβ”€β”€ herit_batch.R          # batch wrapper
β”‚   └── plot_forest.R          # ggplot2 forest plot
β”œβ”€β”€ tests/testthat/
β”‚   β”œβ”€β”€ helper-fixtures.R      # shared synthetic pedigree/data
β”‚   β”œβ”€β”€ test-build_grm.R
β”‚   β”œβ”€β”€ test-int_transform.R
β”‚   β”œβ”€β”€ test-herit_vc.R
β”‚   └── test-herit_batch.R
β”œβ”€β”€ vignettes/
β”‚   └── getting-started.Rmd
β”œβ”€β”€ data-raw/
β”‚   └── prepare_data.R
β”œβ”€β”€ DESCRIPTION
β”œβ”€β”€ NAMESPACE
└── NEWS.md

πŸš€ Getting Started

Prerequisites

install.packages(c("kinship2", "rlang", "cli"))

# For plotting:
install.packages("ggplot2")

Installation

# From GitHub (recommended while pre-CRAN)
remotes::install_github("circadia-bio/R-itable")

Basic usage

library(Ritable)

# 1. Build GRM from pedigree
A <- build_grm(my_pedigree, study_ids = my_data$IID)

# 2. Single trait
herit_vc("bmi", grm = A, data = my_data, covs = c("age", "sex"))

# 3. Many traits x models -> tidy data frame
res <- herit_batch(
  traits    = c("bmi", "hdl", "systolic_bp"),
  grm       = A,
  data      = my_data,
  covs_list = list(
    unadj = NULL,
    cov1  = c("age", "sex"),
    cov2  = c("age", "sex", "age2")
  )
)

# 4. Forest plot
plot_forest(res, model_filter = "cov2")

For a full walkthrough see vignette("getting-started", package = "Ritable").


πŸ“¦ Dependencies

Package Role
kinship2 Pedigree object and kinship matrix
rlang Error/warning handling, tidy eval
cli Progress bars and formatted messages
ggplot2 (Suggests) plot_forest()

πŸ‘₯ Authors

Role Name Affiliation
Author & maintainer Lucas FranΓ§a Northumbria University / Circadia Lab
Author Mario Leocadio-Miguel Northumbria University / Circadia Lab

🀝 Related Tools


πŸ“„ Licence

Released under the MIT License.

Copyright Β© Circadia Lab, 2026

About

πŸ§‘β€πŸ§‘β€πŸ§’β€πŸ§’ Profile-likelihood heritability estimation for family cohort studies β€” no SOLAR required.

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages