top of page
搜尋

HowTo : SNP array to vcf

生物資訊界已經廣泛使用vcf格式作為紀錄DNA變異的格式

這個格式包含SNV/indel/SV/CNV


而最近遇到一個資料轉換的問題跟大家分享解法


動機:

三級分析例如GWAS,起始資料格式是vcf格式

然而illumina SNP array的變異檔案格式是gtc

我們是否可以將gtc格式轉換成vcf格式,以利後續三級分析



GTCtoVCF

illumina github上提供一個小工具:GTCtoVCF

https://github.com/Illumina/GTCtoVCF

這是一個python 2.7的工具,請照網站說明安裝

由於幾個套件不能在Windows版本 conda安裝

這次環境在Linux環境執行


相依套件

bash Miniconda2-latest-Linux-x86_64.sh 
conda install -c miniconda numpy=1.11.2
conda install -c bioconda pyvcf=0.6.8
conda install -c bioconda pysam=0.9.0

下載

git clone https://github.com/Illumina/GTCtoVCF.git

其他準備資料

由於參考序列有一些規定,為了避免麻煩直接用內建腳本下載

## 下載參考序列
bash scripts/download_reference.sh genome.fa

GTC轉換VCF

不用擔心測試資料來源,在test資料夾中有測試用資料

tests/data/RegressionGTCDirectory/input 中有兩份gtc檔案

除了gtc檔案及參考序列外,還需要manifest(tests/data/small_manifest.csv)

python gtc_to_vcf.py \
--gtc-paths tests/data/RegressionGTCDirectory/input/ \
--manifest-file tests/data/small_manifest.csv \
--genome-fasta-file genome.fa \
--output-vcf-path tests/data/RegressionGTCDirectory/output/ 

檢查輸出

ls tests/data/RegressionGTCDirectory/output/








恭喜你完成VCF檔案轉換,接下來就可以進行GWAS 或 變異評估解讀等等三級分析


Reference

https://github.com/Illumina/GTCtoVCF












bottom of page