Skip to content

Instantly share code, notes, and snippets.

View alicebraun's full-sized avatar
🧬

Alice Braun alicebraun

🧬
View GitHub Profile
@alicebraun
alicebraun / PGS-output.R
Last active May 31, 2025 11:36
PGS-output.R
###########
#PGC_GPRS.R
#Polygenic Score Analysis from PLINK PRS-CS or C-PT output
###########
# libraries
library(Hmisc)
library(plyr)
library(rms)
library(pROC)
@alicebraun
alicebraun / effectiveN_gwas.R
Last active May 31, 2025 11:37
effectiveN_gwas
############################################################
# 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)