Bcftools how to add DP to FORMAT field (get per sample read depth for REF vs ALT alleles )
1
0
Entering edit mode
6 days ago
Linda ▴ 20

I'm trying to achieve what this post was looking for Add Dp Tag To Genotype Field Of Vcf File

Currently this is my command:

bcftools mpileup -Ou --max-depth 8000 --min-MQ 30 --min-BQ 30 -f reference.fasta sample1.sorted.bam | bcftools call --ploidy 1 -Ou -mv |  bcftools filter -s LowQual -e \'%QUAL<20\'  > sample1.flt.vcf

#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  sample1.sorted.bam
Imtechella_halotolerans_length_3113269  4051    .   C   T   41.4148 PASS    DP=2;VDB=0.02;SGB=-0.453602;MQ0F=0;AC=1;AN=1;DP4=0,0,0,2;MQ=42  GT:PL   1:71,0
Imtechella_halotolerans_length_3113269  4081    .   C   T   45.4146 PASS    DP=2;VDB=0.02;SGB=-0.453602;MQ0F=0;AC=1;AN=1;DP4=0,0,0,2;MQ=42  GT:PL   1:75,0

As far as I can understand the DP specified in the INFO is depth of coverage across all samples. How can I get the depth per sample info in the format/genotype field?

Any help appreciated!

bcftools snp vcf calling • 123 views
ADD COMMENT
1
Entering edit mode
6 days ago

Hi, you can specify this via the mpileup command. Please take a look at this snippet from my historical pipeline:

That is:

bcftools mpileup \
  --redo-BAQ \
  --min-BQ 30 \
  --per-sample-mF \
  --annotate FORMAT/AD,FORMAT/ADF,FORMAT/ADR,FORMAT/DP,FORMAT/SP,INFO/AD,INFO/ADF,INFO/ADR \
  -f "${Ref_FASTA}" \
  Aligned_Sorted_PCRDuped_FiltMAPQ.bam |\
  bcftools call \
    --multiallelic-caller \
    --variants-only \
    -Ob > Aligned_Sorted_PCRDuped_FiltMAPQ.bcf ;

Kevin

ADD COMMENT
1
Entering edit mode

Brilliant thanks Kevin

ADD REPLY

Login before adding your answer.

Traffic: 1707 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6