causal_loci: Identification of putative causal loci

View source: R/causal_loci.R

causal_lociR Documentation

Identification of putative causal loci

Description

Identification of putative causal loci using KnockoffTrio's feature statistics

Usage

causal_loci(window, M = 10, fdr = 0.1)

Arguments

window

The result window from function KnockoffTrio. If there are multiple result windows (e.g., when you analyze multiple regions in the genome), please use rbind to combine all the windows before running causal_loci.

M

A positive integer for the number of knockoffs. The default is 10.

fdr

A real number in a range of (0,1) indicating the target FDR level. The default is 0.1. Use 0.2 for a more lenient FDR control.

Value

A list that contains the following elements for claiming significance using knockoff statistics. The result window also contains FBAT p-values and ACAT-combined p-values, which can be used for claiming significance in addition to knockoff statistics. If p-values are used, Bonferroni correction is usually necessary to adjust for multiple testing for controlling the family-wise error rate - see examples below.

window

A data frame for an updated result window that includes an extra column for KnockoffTrio's Q-values. A locus with a Q-value <= the target FDR level, i.e., window$q<=fdr, is considered as putative causal at the target FDR.

thr.w

A positive real number indicating the significance threshold for KnockoffTrio's feature statistics. A locus with a feature statistic >= thr.w, i.e., window$w>=thr.w is considered as putative causal at the target FDR. The loci selected by window$w>=thr.w are equivalent to those by window$q<=fdr. No loci are selected at the target FDR level if thr.w=Inf.

Examples

data(KnockoffTrio.example)
knockoff<-create_knockoff(trio.hap=KnockoffTrio.example$trio.hap,
          duo.hap=KnockoffTrio.example$duo.hap, pos=KnockoffTrio.example$pos, M=10)
window<-KnockoffTrio(trio=KnockoffTrio.example$trio, trio.ko=knockoff$trio.ko,
        duo=knockoff$duo, duo.ko=knockoff$duo.ko, pos=KnockoffTrio.example$pos)

#Identification of significant loci using KnockoffTrio's feature statistics (W or Q) 
#at a target FDR
target_fdr<-0.1
result<-causal_loci(window,M=10,fdr=target_fdr)
sig_loci_by_w_index<-which(result$window$w>=result$thr.w)
sig_loci_by_q_index<-which(result$window$q<=target_fdr)

#Identification of significant loci using FBAT p-values with Bonferroni correction
#for controlling the family-wise error rate at 0.05
sig_loci_by_p_fbat_index<-which(window$p.burden<0.05/nrow(window))

#Identification of significant loci using ACAT p-values with Bonferroni correction
#for controlling the family-wise error rate at 0.05
sig_loci_by_p_acat_index<-which(window$p<0.05/nrow(window))

KnockoffTrio documentation built on April 4, 2025, 2:14 a.m.