Skip to content
/ plmmr Public

Fit penalized linear mixed models to correct for unobserved confounding effects.

Notifications You must be signed in to change notification settings

pbreheny/plmmr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e1c9dc2 · Apr 4, 2025
Mar 5, 2025
Apr 4, 2025
Oct 22, 2024
Oct 22, 2024
Feb 18, 2025
Apr 3, 2025
Feb 6, 2025
Mar 3, 2025
Feb 27, 2025
Feb 6, 2025
May 7, 2024
Sep 19, 2024
Apr 4, 2025
Mar 3, 2025
Mar 3, 2025
Jan 30, 2025
Mar 3, 2025
Mar 20, 2025
Apr 27, 2024
Dec 31, 2024

Repository files navigation

GitHub version CRAN version R-CMD-check Codecov test coverage

plmmr

The plmmr (penalized linear mixed models in R) package contains functions that fit penalized linear mixed models to correct for unobserved confounding effects.

Installation

To install the latest version of the package from GitHub, use this:

devtools::install_github("pbreheny/plmmr")

You can also install plmmr from CRAN:

install.packages('plmmr')

For a description of the motivation of the functions in this package (along with examples) refer to the second module of this GWAS data tutorial

Minimal example

library(plmmr)
X <- rnorm(100*20) |> matrix(100, 20)
y <- rnorm(100)
fit <- plmm(X, y) 
plot(fit)

cvfit <- cv_plmm(X, y)
plot(cvfit)
summary(cvfit)

So how fast is plmmr? And how well does it scale?

To illustrate these important questions, I created a separate GitHub repository that has all the scripts for a plmmr workflow using publicly-available genome-wide association (GWAS) data. The main takeaway: using GWAS data from a study with 1,400 samples and 800,000 SNPs, a full plmmr analysis will run in about half an hour using a single core on a laptop.

Three smaller datasets ship with plmmr, and tutorials walking through how to analyze these data sets are documented in the documentation site. While these datasets are useful for didactic purposes, they are not large enough to really highlight the computational scalability of plmmr -- this is what motivated the creation of the separate repository for a GWAS workflow.

Note on branches

The branches of this repo are organized in the following way:

  • master is the main (or 'head') branch.

  • gh_pages is where we are keeping all the documentation for plmmr

  • gwas_scale is an archived branch that contains the development version of the package I used to run my dissertation analysis. Will delete this eventually.

About

Fit penalized linear mixed models to correct for unobserved confounding effects.

Resources

Citation

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages