The .bcf file generated by bcftools mpileup cannot be opened with BCFtools
1
0
Entering edit mode
10 months ago
liying ▴ 20

Hello everyone! I'm encountering an issue where both "bcftools view" and "bcftools call" are unable to open the .bcf file when using the following code. Does anyone have any suggestions or advice? Thank you!

My codes:

bcftools mpileup -O u -f ~/data/GRCz11/Danio_rerio.GRCz11.dna.toplevel.fa zebrafishAligned.sortedByCoord.out.bam > zebrafish_bcftools.bcf

bcftools call -mv -O v zebrafish_bcftools.bcf -o res.vcf

The error:

Failed to open zebrafish_bcftools.bcf: unknown file type.

The bcftools version is 1.9; however, I was able to use "bcftools view" after converting the MGP mouse VCF file to BCF format.

bcftools view test.vcf -O b -o A1.bcf.gz
bcftools variant-calling • 1.3k views
ADD COMMENT
0
Entering edit mode

what is the output of file zebrafish_bcftools.bcf ?

ADD REPLY
0
Entering edit mode

zebrafish_bcftools.bcf: data; instead of Binary Call Format (BCF) version 2.2 (just like A1.bcf)

ADD REPLY
1
Entering edit mode
10 months ago

re-try your command, do not save the output of mpileup in an uncompressed bcf file, but pipe the output into bcftools call

ADD COMMENT
0
Entering edit mode

Thanks a lot ! I think I may have found the reason. I used bcftools mpileup -O u -f ~/data/GRCz11/Danio_rerio.GRCz11.dna.toplevel.fa zebrafishAligned.sortedByCoord.out.bam -o zebrafish2.bcf to do the variant calling, and I found "[mpileup] 1 samples in 1 input files" in the Log file; meanwhile, I tested bcftools mpileup -O v -f ~/data/GRCz11/Danio_rerio.GRCz11.dna.toplevel.fa zebrafishAligned.sortedByCoord.out.bam > zebrafish.vcf to generate VCF directly. And found that indeed the first sentence in the VCF is "[mpileup].....". It seems that the logging information was input into the BCF file, causing this issue.

ADD REPLY
0
Entering edit mode

I found "[mpileup] 1 samples in 1 input files" in the Log file; meanwhile,

hum... did you use something like nohup ?

ADD REPLY
0
Entering edit mode

Yes. I used nohup bcftools ...... &

ADD REPLY
1
Entering edit mode

nohup is evil , it combines stderr+stdout, you'd better use tmux or screen

How to run R script in linux system

How can I use nohup command when filtering SNPs?

how to use nohup with parallel

etc...


ADD REPLY
0
Entering edit mode

Thank you!!

ADD REPLY

Login before adding your answer.

Traffic: 1965 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