【问题标题】:Redirecting vcftools file in linux - tips在 linux 中重定向 vcftools 文件 - 提示
【发布时间】:2014-10-01 21:00:27
【问题描述】:

以下代码使用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    
fi

问题:它会创建 recode.vcf 文件,但由于 temp2 文件为空,因此不会发生重定向

【问题讨论】:

    标签: linux bioinformatics genetics vcf-variant-call-format vcftools


    【解决方案1】:

    我会避免使用 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/
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-15
      • 2015-04-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-17
      • 1970-01-01
      相关资源
      最近更新 更多