Skip to content

Instantly share code, notes, and snippets.

@nievergeltlab
Created May 24, 2021 21:07
Show Gist options
  • Save nievergeltlab/992aae651d9d5507147050f4daba07f2 to your computer and use it in GitHub Desktop.
Save nievergeltlab/992aae651d9d5507147050f4daba07f2 to your computer and use it in GitHub Desktop.
#PLINK2 with dosages
for chr in 2 # {1..22}
do
./plink2 --bgen /mnt/ukbb/adam/bgen/ukb_imp_chr"$chr"_v3.bgen ref-first\
--maf 0.01 \
--geno 0.05 \
--keep UKB_ptsd_eur_unrelated_m0_may13_2021.pheno \
--sample /mnt/ukbb/adam/ptsd/preimputation_genotypes/ukb41209_imp_chr1_v3_s487320.sample \
--pheno UKB_ptsd_eur_unrelated_m0_may13_2021.pheno --pheno-name PCL_sum_imp \
--covar /mnt/ukbb/adam/ptsd/UKB_ptsd_eur_unrelated_m0_may13_2021_pcs.cov \
--glm cols=chrom,pos,ref,alt,ax,a1freq,machr2,a1freqcc,firth,test,nobs,orbeta,se,ci,tz,p \
--make-bed --out ukbb_gwas_name_here_"$chr"
done
Using best guess data
for chr in {1..22}
do
./plink2 --bfile /mnt/ukbb/adam/ptsd/bgeneur/ukbb_ptsd_bgen_eur_unrel_"$chr" \
--maf 0.01 \
--geno 0.05 \
--pheno UKB_ptsd_eur_unrelated_m0_may13_2021.pheno --pheno-name PCL_sum_imp \
--covar /mnt/ukbb/adam/ptsd/UKB_ptsd_eur_unrelated_m0_may13_2021_pcs.cov \
--glm cols=chrom,pos,ref,alt,ax,a1freq,machr2,a1freqcc,firth,test,nobs,orbeta,se,ci,tz,p \
--make-bed --out regular_ukbb_gwas_name_here_"$chr"
done
#BOLT LMM with dosages (outputs are different from PLINK)
/mnt/ukbb/adam/ptsd/BOLT-LMM_v2.3.5/bolt \
--bed=/mnt/ukbb/adam/ptsd/pca/UKB_ptsd_eur_related_{1..22}.bed \
--bim=/mnt/ukbb/adam/ptsd/pca/UKB_ptsd_eur_related_{1..22}.bim \
--fam=/mnt/ukbb/adam/ptsd/pca/UKB_ptsd_eur_related_1.fam \
--LDscoresFile=/mnt/ukbb/adam/ptsd/BOLT-LMM_v2.3.5/tables/LDSCORE.1000G_EUR.tab.gz \
--geneticMapFile=/mnt/ukbb/adam/ptsd/BOLT-LMM_v2.3.5/tables/genetic_map_hg19_withX.txt.gz \
--numThreads=6 \
--bgenFile=/mnt/ukbb/adam/bgen/ukb_imp_chr{1..22}_v3.bgen \
--bgenMinMAF=1e-2 \
--bgenMinINFO=0.8 \
--sampleFile=/mnt/ukbb/adam/ptsd/preimputation_genotypes/ukb41209_imp_chr1_v3_s487320.sample \
--verboseStats \
--lmmForceNonInf \
--statsFile=unimputed_output_filename_here.gz \
--statsFileBgenSnps=imputed_output_filename_here.gz \
--phenoFile=UKB_ptsd_eur_unrelated_m0_may13_2021.pheno \
--phenoCol=PCL_sum_imp \
--covarFile=/mnt/ukbb/adam/ptsd/UKB_ptsd_eur_unrelated_m0_may13_2021_pcs.cov \
--qCovarCol=PC{1:10} \
--remove /mnt/ukbb/adam/ptsd/bolt.in_plink_but_not_imputed.FID_IID.969.txt \
--noBgenIDcheck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment