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))
Run the code above in your browser using DataLab