GWAS imputation

GWAS imputation是什么?

  • Genotype imputation 是運用連鎖不平衡的原理依據一個高密度的參考基因組填補要研究數據的一種方法。
  • 常用的參考基因組數據庫包括The HapMap Consortium database (International HapMap 3 Consortium, 2010)、the 1000 Genomes Project (1KG; 1000 Genomes Project Consortium,2012)。千人基因組計劃涵蓋了世界各地的1,092個人的全基因組信息 (其中181 samples from Admixed American, 246 from African, 286 from East Asian, and 379 from European ancestry groups)。

原理如下圖:


image.png

image.png

為什么要做GWAS imputation?

常用的GWAS芯片大約60萬個位點,經過質控后大約只剩下30多萬個位點,對于全基因組30億個堿基來說,只覆蓋了全基因組萬分之一的區域,因此大片的區域為空白。經過基因型填補后,SNP密度大大增加,如果與表型相關聯的位置沒有SNP,填補前是沒有顯著性的,填補后則有可能出現顯著性。因此,基因型填補可以大大增加GWAS的統計效能。

GWAS imputation 常用軟件

  • Minimac, IMPUTE2,PLINK, BEAGLE, MaCH+minimac, fastPHASE

GWAS imputation 步驟

image.png

1、在線資源

2、本地運行

imputation一般步驟:

  1. Liftover PED/MAP files from build 36 to build 37:由于基因組版本的問題,數據中SNP位點的位置在不同的版本中可能有差異,因此要轉換為統一的版本以便后續比對。一般被稱為pre-processing過程。
    具體包括:
  • Create a ?bed file based on MAP file.
  • Map the bed file to build 37 using ?UCSVC liftover tool.
  • Create list of unmapped SNPs.
  • Create plink mappings file.
  • Create new plink data without unmapped SNPs using ?Plink.
  1. Quality control of study data:對原始數據進行質控(Quality control)提高填補的準確性
    具體包括:
  • 將要填補的數據與參考基因組比對,看SNP在正鏈還是負鏈上,過濾掉翻轉的SNP
  • 要求SNP符合哈迪溫伯格平衡>10-4, MAF>0.01, call rate>0.95。不符合條件的SNP被過濾掉。
  • 檢查SNP是否在參考基因組中,有的參考基因組中沒有這個SNP,也會被過濾掉
  • 檢查位點在要填補的數據和參考基因組中的頻率是否差異過大,如果差異超過25%該SNP將會被過濾掉
  • 比較數據和參考基因組之間的haplotype結構差異(r-squared > 0.1的SNP),差異過大的SNP被過濾掉。
  1. Phasing the study data
    具體包括:
  • Gather the map files as provided in the ALL_1000G_phase1integrated_v3_impute.tgz from the impute website.
  • Phase the study data using the map files.
  1. Imputing study data
  • 將數據按染色體分開,用 Impute2軟件填補經過phased的數據, 一般填補最小分辨率為5 million base。
  • 將數據合并到一起

流程:

由于以上步驟很多,為了方便imputation過程,很多人開發了自動化的pipeline,如

  1. https://github.com/CNSGenomics/impute-pipe
  2. https://github.com/pgxcentre/genipe
  3. http://www.arrayserver.com/wiki/index.php?title=Genetics_GwasImputePipeline.pdf
  4. https://github.com/molgenis/molgenis-pipelines

step1: QC

##QC1: Remove SNPs with missing genotype rate >5% 
${plink} --bfile ${outpath4step}/${name} --missing --out ${outpath4step}/${name}.plink 
awk 'NR < 2 { next } $5 > 0.05' ${outpath4step}/${name}.plink.lmiss > ${outpath4step}/${name}.plink.lmiss.exclude

${plink} --bfile ${outpath4step}/${name} \
    --exclude ${outpath4step}/${name}.plink.lmiss.exclude \
    --make-bed --out ${outpath4step}/${name}.plink_QC1 

##QC2 :Remove SNPs deviated from HWE (10e-4)
${plink} --bfile ${outpath4step}/${name}.plink_QC1 \
    --hardy --out ${outpath4step}/${name}.plink_QC1 
awk '$3=="UNAFF" && $9 <0.0001 {print $2}' ${outpath4step}/${name}.plink_QC1.hwe  \
    > ${outpath4step}/${name}.plink_QC1.hwe.exclude 
${plink} --bfile ${outpath4step}/${name}.plink_QC1 \
    --exclude ${outpath4step}/${name}.plink_QC1.hwe.exclude \
    --make-bed --out ${outpath4step}/${name}.plink_QC2

##QC3 :Remove MAF>0.01
${plink} --bfile ${outpath4step}/${name}.plink_QC2 \
    --maf 0.01 \
    --make-bed \
    --out ${outpath4step}/${name}.plink_QC3

Step2: Alignment of the SNPs

# make sure that the GWAS dataset is well aligned with the reference panel of haplotypes
# if not, use the UCSC liftOver tool to perform the conversion to build37 coordinates

# download 1000 genome refernce file
for i in {1..22}
do
    nohup wget -c -q http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502/ALL.chr$i.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz &
    nohup wget -c -q http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/release/20130502/ALL.chr$i.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz.tbi &
done

# Combine all chromosomes in a single file
bcftools concat ALL.chr{1..22}.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz \
-Oz -o  ALL.autosomes.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz --threads 48

# Preparing a VCF file
bgzip -c example.vcf > example.vcf.gz
tabix -p vcf example.vcf.gz
# convert VCF to PLINK
# To build PLINK compatible files from the VCF files, duplicate positions and SNP id need to be merged or removed. 
# remove all duplicate entries. 
# Catalogue duplicate SNP id:
grep -v '^#' <(zcat ALL.autosomes.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz) | cut -f 3 | sort | uniq -d > ALL.autosomes.dups

# Using BCFTools, split multi-allelic SNPs, and using plink remove duplicate SNPs id found in previous step:
bcftools norm -d both -m +any -Ob ALL.autosomes.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz --threads 64 \
 | plink --bcf /dev/stdin --make-bed --out ALL.autosomes --allow-extra-chr 0 --memory 60000 --exclude ALL.autosomes.dups

java -jar GenotypeHarmonizer.jar \
    --inputType PLINK_BED \
    --input /hapmap3CeuChr20B37Mb6RandomStrand \
    --update-id \
    --outputType PLINK_BED \
    --output /all_chrs \
    --refType VCF \
    --ref /ALL.autosomes.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz

step3.pre-phasing using SHAPEIT2

shapeit -B all_chrs \
-M /home/zhouwei/zhou_data/GWAS/imputation/impute-pipe/data/reference/ALL_1000G_phase1integrated_v3_impute/genetic_map_chr20_combined_b37.txt \
-O phased_all_chrs -T 64

Step 4: Imputation into pre-phased haplotypes

impute2 -use_prephased_g -Ne 20000 -iter 30 -align_by_maf_g -os 0 1 2 3 -seed 1000000 \
-o_gz -int 1 5e6 \
-h /ALL_1000G_phase1integrated_v3_chr20_impute.hap.gz \
-l /ALL_1000G_phase1integrated_v3_chr20_impute.legend.gz \
-m /genetic_map_chr20_combined_b37.txt \
-known_haps_g phased_all_chrs.haps \
-o /chr20.chunk1

impute2 \
-use_prephased_g -Ne 20000 -iter 30 -align_by_maf_g -os 0 1 2 3 -seed 1000000 -o_gz -int 5e6 10e6 \
-h /ALL_1000G_phase1integrated_v3_chr20_impute.hap.gz \
-l /ALL_1000G_phase1integrated_v3_chr20_impute.legend.gz \
-m /genetic_map_chr20_combined_b37.txt \
-known_haps_g phased_all_chrs.haps \
-o chr20.chunk2

Step 5: Combine all the chunks

cat chr22.chunk1.gz chr22.chunk2.gz > chr22_chunkAll.gen.gz

待完善

參考:
http://www.bbmriwiki.nl/wiki/Impute2Pipeline
http://databeauty.com/blog/tutorial/2017/02/20/GWAS-prephasing-and-imputation.html

?著作權歸作者所有,轉載或內容合作請聯系作者
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 227,533評論 6 531
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 98,055評論 3 414
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 175,365評論 0 373
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 62,561評論 1 307
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 71,346評論 6 404
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 54,889評論 1 321
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 42,978評論 3 439
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,118評論 0 286
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 48,637評論 1 333
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 40,558評論 3 354
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 42,739評論 1 369
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,246評論 5 355
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 43,980評論 3 346
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,362評論 0 25
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 35,619評論 1 280
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 51,347評論 3 390
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 47,702評論 2 370

推薦閱讀更多精彩內容