gsortはゲノムファイルをソートするためのツール。たとえば、何らかの理由でVCFを並べ替えて、X、Y、2,1,3、などの順序で並べ替えることができる。他のソートツールでは不可能だったGATK order(1 ... X、Y、MT)に一致するようなソートもできる。ソートは、ユーザーが指定したTSVファイルに従って行われる。ソートできるのは、BED、VCF、GTFになる。
インストール
mac os10.14のminiconda2-4.0.5環境でテストした。
本体 Github
#anaconda環境ならcondaで導入できる
conda install -c bioconda -y gsort
>gsort -h
$ gsort -h
Usage: gsort [--memory MEMORY] [--parent] PATH GENOME
Positional arguments:
PATH a tab-delimited file to sort
GENOME a genome file of chromosome sizes and order
Options:
--memory MEMORY, -m MEMORY
megabytes of memory to use before writing to temp files. [default: 1300]
--parent, -p for gff only. given rows with same chrom and start put those with a 'Parent' attribute first
--help, -h display this help and exit
実行方法
vcfを指定した ファイル順にソートする
gsort --memory 1500 input.vcf.gz input.genome | bgzip -c > my.crazy-order.vcf.gz
引用
https://github.com/brentp/gsort