格式转换--2024-03-23

格式转换
hapmap格式:hmp.txt
plink格式:ped和map以及二进制文件bed/bim/fam
vcf格式:vcf

1. hapmap <-> vcf

hapmap -> vcf

run_pipeline.pl -SortGenotypeFilePlugin -inputFile hmp.txt -outputFile test.sort.hmp.txt -fileType Hapmap

run_pipeline.pl -Xmx100g -fork1 -h test.sort.hmp.txt -export -exportType VCF

vcf -> hapmap

run_pipeline.pl -Xms10g -Xmx100g  -vcf in.vcf.gz -sortPositions -export out.hmp.txt -exportType HapmapDiploid

2. hapmap_to_qtl2

Convert HapMap file into a useable R qtl2 genotype file

#下载
git clone https://github.com/jlboat/hapmap_to_qtl2.git

#使用
usage: hapmap_to_qtl2.py [-h] --hapmap HAPMAP [--output OUTPUT]

This script was designed to convert a hapmap file into R qtl2 format.

optional arguments:
    -h, --help       show this help message and exit
    --output OUTPUT  File name for qtl2 output.

required arguments:
    --hapmap HAPMAP  The name of the input hapmap file. 

3. vcf <-> plink

vcf -> plink

plink --vcf input.vcf --recode --out output --double-id  --autosome-num 42

plink --file A --make-bed --out A --autosome-num 42

结果生成:ped/map以及二进制文件bed/bim/fam

添加--recode参数将输出结果调整为ped格式

plink -> vcf

plink --bfile binary_fileset --export vcf --out new_vcf  
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容