This usecase describe how to run LDSC analysis (https://github.com/bulik/ldsc) on Morningness and Intelligence summary statistics data. All commands below assume that $SIF
and $SINGULARITY_BIND
environmental variables are defined as described in Getting started section of the main README file.
- Assign the paths of the containers and reference data
export COMORMENT=/cluster/projects/p697/github/comorment
export SINGULARITY_BIND="$COMORMENT/containers/reference:/REF:ro"
export SIF=$COMORMENT/containers/singularity
export REP="rep${SLURM_ARRAY_TASK_ID}"
export EXTRACT="--extract /REF/ldsc/1000G_EUR_Phase3_plink/1000G.EUR.QC.prune_maf0p05_rand2M_r2p8.$REP.snps"
- The path of the summary statistics, name this path as 'sumstats_ld'
export sumstats_ld=$COMORMENT/containers/reference/sumstats
- Uncompress sumstat data if required and copy these uncompressed sumstats to your working directory
gunzip $sumstats_ld/Morningness_sumstats_Jansenetal.txt.gz
unzip $sumstats_ld/SavageJansen_IntMeta_sumstats.zip
cp $sumstats_ld/Morningness_sumstats_Jansenetal.txt .
- Arranging sumstats file for LDSC analysis via munge_sumstats.py
singularity exec --home $PWD:/home $SIF/ldsc.sif python /tools/ldsc/munge_sumstats.py \
--sumstats sumstats/SavageJansen_2018_intelligence_metaanalysis.txt \
--N 2000 \
--out int_munge \
--merge-alleles /REF/ldsc/w_hm3.snplist
singularity exec --home $PWD:/home $SIF/ldsc.sif python /tools/ldsc/munge_sumstats.py \
--sumstats Morningness_sumstats_Jansenetal.txt \
--out mor_munge \
--merge-alleles /REF/ldsc/w_hm3.snplist \
--signed-sumstats OR,0
- remove .gz extension for munged sumstats
mv mor_munge.sumstats.gz mor_munge.sumstats
mv int_munge.sumstats.gz int_munge.sumstats
- Ready to run LDSC analysis
singularity exec --home $PWD:/home $SIF/ldsc.sif python /tools/ldsc/ldsc.py \
--rg int_munge.sumstats,mor_munge.sumstats \
--ref-ld-chr /REF/ldsc/eur_w_ld_chr/ \
--w-ld-chr /REF/ldsc/eur_w_ld_chr/ \
--out int_mor
The succesfull munge_sumstats.py and ldsc.py results shoud look like this: