PLINK软件输入文件的常见格式类型:
1,一般格式:PED/MAP
2,转置格式:TPED/TFAM
3,二进制格式:BED/BIM/FAM
几种格式之间可以相互转换。推荐使用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 …………
例如: fam1 id1 fid mid 1 1 A T G G fam1 id2 fid mid 2 1 A T C G
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文件中染色体编号是根据人类染色体设计的: 1-22:常染色体 23:X染色体 24: Y染色体 25:XY染色体拟常染色体区 26:线粒体 PLINK1.07中--sheep,--cow,--horse,--mouse,--dog,可以根据这几种的动物基因组设置染色体编号。 读取绵羊SNP数据可以用plink --file test --sheep
PLINK1.09中--chr-set 26,设定1-26号染色体为常染色体,27号为X染色体,28号为Y染色体。
输入文件格式彼此转换的方法: 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
其他格式转换命令: --recodeAD,SNP编码成加性显性模式,以0、1、2编码SNP,NA为缺失值;--recode12,SNP编码为数字1或2,缺失值为0.
转自:http://zhangyy.site/notes/2015/04/04/GWAS2file.html
参考:https://www.cnblogs.com/leezx/p/9013615.html
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/208430.html原文链接:https://javaforall.net
