linux 查看vcf文件,Linux生信练习4-vcf

本文介绍了如何在Linux环境中利用bcftools和awk等工具处理VCF文件,包括区分SNP和INDEL,统计平均测序深度,分析插入/删除比例,SNP突变组合分布,筛选特定条件的变异条目,以及计算AF等操作。内容覆盖了生物信息学中VCF文件的基本分析流程。
摘要由CSDN通过智能技术生成

原始数据准备

cd biosoft/bowtie2/bowtie2-2.4.1-linux-x86_64/example/reads/

../../bowtie2 -x ../index/lambda_virus -1 reads_1.fq -2 reads_2.fq | samtools sort -@ 5 -o tmp.bam -

bcftools mpileup -f ../reference/lambda_virus.fa tmp.bam |bcftools call -vm > tmp.vcf

Q1

把突变记录的vcf文件区分成 INDEL和SNP条目

grep -v "^#" tmp.vcf | grep INDEL > tmp.indel.vcf

grep -v "^#" tmp.vcf | grep -v INDEL > tmp.snp.vcf

Q2

统计INDEL和SNP条目的各自的平均测序深度

cut -f 8 tmp.indel.vcf | cut -d";" -f 4 | less -SN

number=$(grep -c gi tmp.indel.vcf)

sum=$(cut -f 8 tmp.indel.vcf | cut -d";" -f 4 | cut -d"=" -f 2 | paste -s -d +|bc)

echo "$sum/$number" | bc

cut -f 8 tmp.snp.vcf | cut -d";" -f 1 | less -SN

number=$(grep -c gi tmp.snp.vcf)

sum=$(cut -f 8 tmp.snp.vcf | cut -d"

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值