how to use FlashPCA2 with my Plink2 GWAS Pipeline

179 views
Skip to first unread message

Ana Marija

unread,
Oct 8, 2019, 1:38:23 AM10/8/19
to flashpca-users
Hello,

I am running GWAS on my UK Biobank data with plink2 using these steps:

plink2 --threads 8 --bgen ukb_imp_chr6_v3.bgen  ref-first --sample ukb44316_imp_chr6_v3_s487317.sample --extract extractTheseSNPs --make-pgen --out ex6
plink2 --threads 8 --pgen ex6.pgen --psam ex6.psam --pvar ex6.pvar --maf 0.01 --geno 0.05 --hwe 0.000001  --make-bpgen --out chr6
plink2 --threads 8 --bim chr6.bim --fam chr6.fam --pgen chr6.pgen  --export vcf bgz vcf-dosage=DS --out VCFchr6
plink2 --threads 8 --vcf VCFchr6.vcf.gz --glm --pheno pheno_M.txt --pheno-name pheno –out FINchr6

Can you please let me know how can I use FlashPCA2 to calculate the first 10 PCs? Where in this pipeline I add this that you mentioned on your github page:

plink --bfile data --indep-pairwise 1000 50 0.05 --exclude range exclusion_regions_hg19.txt
plink --bfile data --extract plink.prune.in --make-bed --out data_pruned

You mentioned it should be after this plink QC steps, so after
plink2 --threads 8 --pgen ex6.pgen --psam ex6.psam --pvar ex6.pvar --maf 0.01 --geno 0.05 --hwe 0.000001  --make-bpgen --out chr6

but how and where?

Also is this  exclusion_regions_hg19.txt file always the same?

Thanks,
Ana

Gad Abraham

unread,
Oct 8, 2019, 7:52:11 PM10/8/19
to Ana Marija, flashpca-users
Hi Ana,

Maybe I'm misunderstanding but you probably should do QC on each
chromosome 1-22 (as you've done for chr6), thin them by LD, then join
into one file and do PCA on that.

FlashPCA2 can't read the new pgen/bpgen file format so you'll need to
convert the final dataset to the old bed/bim/fam format.

The exclusion_regions_hg19.txt file is based on hg19 positions, if
your data is in a different build then you'll need different
positions. It's intended for general purpose PCA, i.e., excluding high
LD regions that can mask population structure. But you can change it
if that's not what you want.

Regards
Gad
> --
> You received this message because you are subscribed to the Google Groups "flashpca-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to flashpca-user...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/flashpca-users/5138403e-92f9-4a15-89ff-f62e16c59e98%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages