Movatterモバイル変換


[0]ホーム

URL:


sffdr package

R-CMD-check

Overview

Thesffdr package implements the surrogate functionalfalse discovery rate (sfFDR) procedure which integrates GWAS summarystatistics of related traits to increase power within the fFDRframework. The inputs intosffdr are a set of p-values froma GWAS of interest and a set of p-values (or test statistics) from oneor many informative GWAS. There are a few key quantities estimated bythe package: the functional q-value, functional local FDR, andfunctional p-value.

The quantities estimated bysffdr can be used for avariety of significance analyses in genome-wide studies whileincorporating informative data: the functional q-values provide positiveFDR (related to FDR) control, the functional local FDRs can be used forpost-GWAS analysis such as functional fine mapping, and the functionalp-values provide type I error rate control.

Citing this package

The methods implemented in this package are described in:

Bass AJ, Wallace C. Exploiting pleiotropy to enhance variantdiscovery with functional false discovery rates.medRxiv;2024.

Note that this work is an extension of the functional FDR methodologyand the software builds on some of the functions in thefFDR package found athttps://github.com/StoreyLab/fFDR.

Getting help

To report any bugs or issues related to usage please report it onGitHub athttps://github.com/ajbass/sffdr.

Installation

To install the development version of the package:

# install development version of packageinstall.packages("devtools")library("devtools")devtools::install_github("ajbass/sffdr")

Quick start

Load thesffdr package and example data set:

library(sffdr)set.seed(123)data(bmi)head(sumstats)p<- sumstats$bmiz<-as.matrix(sumstats[,-1])

Thesumstats data frame contains 10,000 independentp-values for body mass index (BMI), body fat percentage (BFP),cholesterol, and triglycerides. In this example, our primary trait ofinterest is BMI and the informative traits are BFP, cholesterol, andtriglycerides.

We first model the relationship between the functional proportion oftrue null hypotheses and the summary statistics using thefpi0est function. The functionpi0_model canbe used to help create the design matrix forfpi0est.

# Create model: choose knots at small quantilesmpi0<-pi0_model(z = z,knots =c(0.01,0.025,0.05,0.1))# Estimation of functional pi0 using the design matrix in mpi0fpi0<-fpi0est(p = p,z = mpi0$zt,pi0_model = mpi0$fmod)

Alternatively, the model can be directly inputted intofpi0est:

# Create design matrix (can include other variables (e.g., MAF) or specify more complicated models)fmod<-"~ns(bfp, knots = c(0.01, 0.025, 0.05, 0.1))"fpi0_mod<-fpi0est(p = p,z = mpi0$zt,pi0_model = fmod)

You should look at the p-values in your informative studies to choosethe location (quantiles) of the knots. Ideally, it should cover thelocation of the non-null p-values. In our analyses, we found thatknots = c(0.005, 0.01, 0.025, 0.05, 0.1) performed wellwhen there were about 160,000 LD-independent SNPs. Note that the aboveexample data set only has 10,000 p-values.

The functional FDR and p-value quantities can be estimated with thesffdr function:

# apply sfFDRsffdr_out<-sffdr(p,fpi0 = fpi0$fpi0)# plot significance resultsplot(sffdr_out,rng =c(0,1e-6))# Functional P-values, Q-values, and local FDRfp<- sffdr_out$fpvaluesfq<- sffdr_out$fqvaluesflfdr<- sffdr_out$flfdr

The functional q-value (fqvalue) is a measure ofsignificance in terms of the positive FDR (closely related to FDR), thelocal FDR (flfdr) is a posterior error probability, and thefunctional p-value (fpvalue) can be interpreted as astandard p-value. See?sffdr for additional details andinput arguments (users may want to changeepsilon = min(p)depending on how small the primary study p-values are).

Thus far, we have assumed that the SNPs are independent. Below weshow how to specify LD-independent SNPs in the software:

# Boolean to specify which SNPs are independent (e.g., pruning)# All SNPs are LD-independent in this example data setindep_snps<-rep(TRUE,length(p))# Create modelmpi0<-pi0_model(z = z,indep_snps = indep_snps,knots =c(0.01,0.025,0.05,0.1))# Estimation fpi0 using design matrix from mpi0fpi0<-fpi0est(p = p,z = mpi0$zt,indep_snps = indep_snps,pi0_model = mpi0$fmod)# Estimate FDR quantities and functional p-valuesffdr_out<-sffdr(p,fpi0 = fpi0$fpi0,indep_snps = indep_snps)

Note that the LD-independent SNPs are used for model fitting insfFDR, and the functional p-values, q-values, and local FDRs areestimated for all SNPs. See?ffinemap to perform functionalfine mapping in a region of interest (assuming a single causal locus)with the functional local FDR.


[8]ページ先頭

©2009-2025 Movatter.jp