This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########### | |
#PGC_GPRS.R | |
#Polygenic Score Analysis from PLINK PRS-CS or C-PT output | |
########### | |
# libraries | |
library(Hmisc) | |
library(plyr) | |
library(rms) | |
library(pROC) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################ | |
# Effective N calculation for individual samples # | |
############################################################ | |
# From RICOPILI daner format | |
extract_frq <- function(df) { | |
# Identify columns for cases (FRQ_A_*) and controls (FRQ_U_*) | |
case_cols <- grep("^FRQ_A_\\d+$", colnames(df), value = TRUE) | |
control_cols <- grep("^FRQ_U_\\d+$", colnames(df), value = TRUE) | |