Sovereign 8s.is mirror of standardgalactic/TS2024_UKBBageEffect
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tabea Schoeler 771c5be1e3
Update lme.R
2026-03-11 11:59:02 +01:00
analysis Update lme.R 2026-03-11 11:59:02 +01:00
figures Add files via upload 2025-06-05 18:22:35 +02:00
README.md Update README.md 2026-03-11 11:56:54 +01:00

Design and model choices shape inference of age-varying genetic effects on complex traits

1. Preprocessing of phenotype data

  • Analytical script: extractPheno.R
  • All necessary functions required to run the script are included in functions.R
  • Extract and recode phenotype data
  • Generate slopes of change for genome-wide tests on change

2. Perform genome-wide scans using REGENIE

GWA in REGENIE - Step 1:

$myprog \
--step 1 \
--bed $DATA/ukbb/_001_ukb_cal_allChrs \
--phenoFile $OUT/output/regenie/phenofiles/$run \
--keep $DATA/ukbb/qc_pass_MAC100.id \
--extract $DATA/ukbb/qc_pass_MAC100.snplist \
--force-qt \
--minINFO 0.9 \
--phenoCol $run \
--covarFile $OUT/output/regenie/phenofiles/${run}_Covar \
--catCovarList SEX,batch \
--maxCatLevels 3000 \
--bsize 1000 \
--lowmem \
--lowmem-prefix $OUT/output/regenie/genofiles/${run} \
--out $OUT/output/regenie/genofiles/${run}_s1 \
--threads $SLURM_CPUS_PER_TASK 

GWA in REGENIE - Step 2:

$myprog \
--step 2 \
--pgen $UKBB/genotypes/imp/v3/pgen/ukb22828_c"$a"_b0_v3 \
--ref-first \
--phenoFile $OUT/output/regenie/phenofiles/$run \
--covarFile $OUT/output/regenie/phenofiles/${run}_Covar \
--catCovarList SEX,batch \
--maxCatLevels 3000 \
--phenoCol $run \
--approx \
--pred $OUT/output/regenie/genofiles/${run}_s1_pred.list \
--bsize 400 \
--out $OUT/output/regenie/genofiles/chr${a}_${run} \
--force-qt \
--threads $SLURM_CPUS_PER_TASK \
$extra_args

Parameter specifications

  • gene-by-age-interaction model (cross-sectional): extra_args="--interaction age --no-condtl"
  • phenotype outcome: $run (e.g, run=bmi_0 for baseline bmi, run=bmi_change for change in bmi)
  • REGENIE software: myprog=$PROGS/regenie/regenie_v3.2.6.gz_x86_64_Linux
  • chromosome number: $a

Process the results

  • Analytical script: processGWA.R

    • generates summary statistic files
    • performs clumping to select LD-independent variants
  • Analytical script: sumGWA.R

    • summarizes clumping output for all traits and models

3. Processing of variant-specific data

  • Analytical script: gene.R

    • Extract defined genetic variants for UKB participants
    • Required R-packages: bigsnpr
    • Estimate genetic effects across age-heterogeneous subgroups per variant

4. Generate participation weights

  • Analytical script: bias.R
  • Performs generate Inverse Probability Weights to correct for selective participation in UKB follow-ups

5. Generate polygenic scores

  • Analytical script: pgs.R
  • Generates polygenic scores to test for polygenic x age interaction effects step 6
  • Requires the polygenic score software PRSice-2

6. Obtain age estimates and age-varying genetic effects for candidate genetic variants

  • Analytical script: lme.R

    • Use for phenotypic analyses, including cross-sectional and longitudinal age effects, cohort effects, quadratic age effects and weighted age effects
    • Use for genotypic analyses, including cross-sectional and longitudinal age-varying genetic effects, cohort-varying genetic effects, quadratic age-varying genetic effects and weighted age-varying genetic effects

7. Perform Mendelian Randomization analysis using time-varying genetic effects

8. Summary of the results