1. 程式人生 > >利用PLINK進行GWAS分析

利用PLINK進行GWAS分析

PLINK軟體輸入檔案的常見格式型別:</br> 1,一般格式:PED/MAP</br> 2,轉置格式:TPED/TFAM</br> 3,二進位制格式:BED/BIM/FAM</br>

幾種格式之間可以相互轉換。推薦使用BED/BIM/FAM這種格式,讀取速度快。BED檔案包含SNP資料,是二進位制格式,不能由Notepad++等文字編輯器開啟。BIM檔案包括SNP位置資訊,FAM檔案包括家系表型資訊,這兩種檔案都是文字格式。 PED檔案格式:

column1 = FamilyID
column2 = IndividualID
column3 = PaternalID
column4 = Sex
column5 =Phenotype (1 = unaffected, 2 = affected, 0 = missing)
column6 + column7 = genotype pair at SNP1
column8 + column9 = genotype pair at SNP2
…………

例如:</br> fam1 id1 fid mid 1 1 A T G G</br> fam1 id2 fid mid 2 1 A T C G</br>

MAP檔案格式:

column1 = Chromosome
column2 = SNPIdentifier
column3 = Genetic Distance in morgans(0, if missing)
column4 = Physical base-pair position in bp units
# column3 and column4 are not required for basic association testing.

MAP檔案中染色體編號是根據人類染色體設計的:</br> 1-22:常染色體</br> 23:X染色體</br> 24: Y染色體</br> 25:XY染色體擬常染色體區</br> 26:線粒體</br> PLINK1.07中--sheep,--cow,--horse,--mouse,--dog,可以根據這幾種的動物基因組設定染色體編號。</br> 讀取綿羊SNP資料可以用plink --file test --sheep

PLINK1.09中--chr-set 26,設定1-26號染色體為常染色體,27號為X染色體,28號為Y染色體。

輸入檔案格式彼此轉換的方法:</br> 1、PED/MAP 轉換為TPED/TFAM格式

plink --ped test.ped --map test.map  --recode --transpose --out test1
或者
plink --file test --recode --transpose --out test1
#生成test1.tped和test1.tfam檔案

2、TPED/TFAM轉化為PED/MAP檔案

plink --tped test1.tped --tfam test1.tfam  --recode --out test2
或者
plink --tfile test1 --recode --out test2
#生成test2.ped和test2.map檔案

3、生成二進位制格式輸入檔案

#PED/MAP轉為二進位制格式
plink --file test --make-bed --out test3
#TFAM/TPED轉為二進位制格式
plink --tfile test1 --make-bed --out test3
#生成test3.bed,test3.bim和test3.fam檔案

4、二進位制格式轉為PED/MAP或TPED/TFAM

#用bfile來讀取test3.bed,test3.bim和test3.fam檔案
plink --bfile test3  --recode --transpose --out test4
#生成test4.tped和test4.tfam

plink --bfile test3 --recode --out test5
#生成test5.ped和test5.fam

其他格式轉換命令:</br> --recodeAD,SNP編碼成加性顯性模式,以0、1、2編碼SNP,NA為缺失值;</br>--recode12,SNP編碼為數字1或2,缺失值為0.