Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bcftools consensus in V1.17 not applying any variants to reference #1948

Closed
rchapman2000 opened this issue Jun 22, 2023 · 1 comment
Closed

Comments

@rchapman2000
Copy link

rchapman2000 commented Jun 22, 2023

Hello,

I found an issue with bcftools consenus that is very similar to #1918.

For some context, I am creating a new assembly pipeline for my laboratory, and I use bcftools consensus to apply variants to a reference genome. As I was checking my assembly, I noticed that it was identical to the reference sequence, but my VCF files contained variants that should have been applied (See example below):

#CHROM	POS	ID	REF	ALT	QUAL	FILTER	INFO	FORMAT	unknown
NC_063383.1	4952	.	C	T	0.512731	.	AB=0;ABP=0;AC=0;AF=0;AN=2;AO=1;CIGAR=1X;DP=1;DPB=1;DPRA=0;EPP=5.18177;EPPR=0;GTI=0;LEN=1;MEANALT=1;MQM=60;MQMR=0;NS=1;NUMALT=1;ODDS=2.07944;PAIRED=0;PAIREDR=0;PAO=0;PQA=0;PQR=0;PRO=0;QA=0;QR=0;RO=0;RPL=0;RPP=5.18177;RPPR=0;RPR=1;RUN=1;SAF=1;SAP=5.18177;SAR=0;SRF=0;SRP=0;SRR=0;TYPE=snp	GT:DP:AD:RO:QR:AO:QA:GL	0/0:1:0,1:0:0:1:0:0,-0.30103,-4.34294e-09

However, BCFTools consensus runs and outputs a message as if all of the variants were applied:

bcftools consensus -f NC_063383.fasta sample-variants.vcf.gz > corrected.fasta
Applied 53 variants

I was using BCFtools V1.17, and upon downgrading to V1.16, the issue seems to have been resolved.

image

Note as well, I installed BCFTools via conda.

Thank you!

@pd3
Copy link
Member

pd3 commented Jun 23, 2023

There was a change in the default behavior, motivated by #1828. Newly the program considers information in FORMAT/GT first, in case it is a homozygous reference 0/0.

If you want to apply all variants from the ALT column regardless of the genotype, run with -s -

-s, --samples LIST             Comma-separated list of samples to include or
                                     "-" to ignore samples and use REF,ALT

@pd3 pd3 closed this as completed Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants