.map文件
格式说明链接:link
map格式的文件, 主要是图谱文件信息, 主要包括染色体名称, 所在的染色体和所在染色体的坐标.
map文件包括:
- 染色体编号(1-22, X, Y or 0 if unplaced), 未知为0
- SNP名称(字符或数字), 如果不重要, 可以从1编号, 注意要和bed文件SNP列一一对应
- 染色体的摩尔位置(可选项, 可以用0)
- SNP物理坐标
Example
1 snp1 0 1
1 snp2 0 2
1 snp3 0 3
- 这里有3个SNP, 分别名为snp1, snp3, snp3 (第二列)
- 这三个SNP在第一个染色体上 (第一列)
- 第三列为0
- 第四列为SNP所在染色体的坐标
.ped文件
格式说明链接:link
bed格式的文件, 主要包括SNP的信息, 包括个体ID, 系谱信息, 表型和SNP的分型信息.
.ped 文件主要有 6 列,后面都是基因型:
- 第一列: Family ID # 如果没有, 可以用个体ID代替
- 第二列: Individual ID # 个体ID编号
- 第三列: Paternal ID # 父本编号
- 第四列: Maternal ID # 母本编号
- 第五列: Sex (1=male; 2=female; other=unknown) # 性别, 如果未知, 用0表示
- 第六列: Phenotype (0=unknown; 1=unaffected; 2=affected) # 表型数据, 如果未知, 用0表示
- 第七列以后: 为SNP分型数据, 可以是AT CG或11 12, 或者A T C G或1 1 2 2
Example
1 1 0 0 1 0 G G 2 2 C C
1 2 0 0 2 0 A A 0 0 A C
1 3 1 2 1 2 0 0 1 2 A C
2 1 0 0 1 0 A A 2 2 0 0
2 2 0 0 2 2 A A 2 2 0 0
2 3 1 2 1 2 A A 2 2 A A
- 数据包括两个家系 (第一列)
- 每个家系有三个个体 (第二列)
- 第三列父本编号
- 第四列母本编号
- 第五列性别
- 第六列表型值
- 第七列, 第八列为一个基因型
- 第九列, 第十列为第二个基因型
- 第十一列, 第十二列为第三个基因型
map、ped文件转换为bed、bim、fam文件
plink --file hapmap --out hapmap --make-bed
利用Plink进行数据预处理(修建SNP集)
1、删除基因型缺失率大于5%、次要等位基因频率大于0.01的SNPs
plink --file hapmap --geno 0.05 --maf 0.01 --out hapmap --make-bed
2、基于连锁不平衡的SNP修剪(窗宽500、删除LD大于0.1的SNP对中一个、将窗口向前移动10个SNP)
plink --file hapmap --indep-pairwise 500 10 0.1
plink --file hapmap --extract plink.prune.in --make-bed --out prunedhapmap
3、基于随机采样保留部分SNPs(例如只随机保留20%的SNP)
plink --file hapmap --thin 0.2 --out hapmap --make-bed
4、采用上述所有步骤并输出bed、bim、fam文件
plink --file hapmap --geno 0.05 --maf 0.01 --indep-pairwise 500 10 0.1 --thin 0.2
plink --file hapmap --extract plink.prune.in --make-bed --out prunedhapmap
plink --bfile cluster_remove --recode --out data --noweb #由bed文件转为ped、map文件
plink --file data --geno 0.05 --maf 0.01 --indep-pairwise 500 10 0.1 --thin 0.2
plink --file data --extract plink.prune.in --make-bed --out pruneddata
5、将23andme原始数据文件转化为.ped文件
plink --23file File.txt --make-bed --out NewFile
6、将多个数据融合
link --file genom0 --merge-list filesets3.txt --make-bed --out combdata
其中fileset3.txt中包含要融合的文件名。