본문 바로가기
생물정보학

Phasing 하기

by BIJoy 2023. 12. 4.

Phasing 이란?

쉽게 말하면 나의 diploid 유전형을 아빠의 haploid와 엄마의 haploid로 구분해주는 과정

예) 나의 유전형이 1이라면 0|1 이런식으로 누구에게서 왔는지 알 수 있게 해줌.

 

eagle이라는 툴을 사용하면 쉽게 할 수 있음

plink 파일(bed, bim, fam) 을 사용하여 수행해봄

 

./Eagle/Eagle_v2.4.1/eagle --bfile {plink_file_name} --geneticMapFile ./Eagle/Eagle_v2.4.1/genetic_map_hg38_withX.txt --outPrefix {output_name} --numThreads 16

 

geneticMapFile은 Eagle 메뉴얼 페이지 가서 읽어보고 받아오면 됨. 

https://alkesgroup.broadinstitute.org/Eagle/#x1-130004

 

저 코드를 작성하게 되면 

{output_name}.haps.gz 파일과 {output_name}.sample 파일이 나옴

haps.gz 파일을 열어보면 이게 phasing이 된건가? 싶음. 그래서 찾아봤더니 파일 포맷을 바꿔야 한다고 함.

 

shapeit이란 파일을 사용하여 haps 포맷 파일을 vcf 파일로 바꿔준다.

그 전에 haps.gz 파일의 압축을 gunzip으로 풀어주고

 

gunzip {output_name}.haps.gz
./shapeit/bin/shapeit -convert --input-haps {output_name} --output-vcf {output_name}.vcf

 

이렇게 해주면 내가 알고 있는 phasing 형식을 갖춘 vcf 파일이 만들어짐.