下面是使用tabix从特定区域获取VCF文件的代码,然后使用vcftools中的“保存”选项对特定(欧洲)人口进行筛选。
####select specific population
if [ "$POP_FILE" != "" ]; then
vcftools --vcf temp.vcf --keep $POP_FILE --recode --recode-INFO-all > temp2.vcf 2> /dev/null
else
cp -f temp.vcf temp2.vcf
fiPROBLEM:它创建recode.vcf文件,但是重定向不会发生,因为temp2文件是空的
发布于 2015-04-06 21:44:56
我将避免使用vcftools,而是使用bcftools (https://github.com/samtools/bcftools):
if [ "$POP_FILE" != "" ]; then
bcftools view temp.vcf -S $POP_FILE -o temp2.vcf
else
cp -f temp.vcf temp2.vcf
fi要安装bcftools,请执行以下操作:
git clone --branch=develop git://github.com/samtools/bcftools.git
git clone --branch=develop git://github.com/samtools/htslib.git
cd htslib && make && cd ..
cd bcftools && make && cd ..
sudo cp bcftools/bcftools /usr/local/bin/https://stackoverflow.com/questions/26150577
复制相似问题