This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unable to generate VCF using bcftools
Exception in thread "main" htsjdk.tribble.TribbleException$MalformedFeatureFile: Unable to parse header with error: Input stream does not contain a BCF encoded file; BCF magic header info not found, at record 0 with position 0:, for input source: file:///home/arshiya/efs/FastQC/ERR101899_sorted.bcf
    at htsjdk.tribble.TribbleIndexedFeatureReader.readHeader(TribbleIndexedFeatureReader.java:263)
    at htsjdk.tribble.TribbleIndexedFeatureReader.<init>(TribbleIndexedFeatureReader.java:102)
    at htsjdk.tribble.TribbleIndexedFeatureReader.<init>(TribbleIndexedFeatureReader.java:127)
    at htsjdk.tribble.AbstractFeatureReader.getFeatureReader(AbstractFeatureReader.java:120)
    at htsjdk.tribble.AbstractFeatureReader.getFeatureReader(AbstractFeatureReader.java:80)
    at htsjdk.variant.vcf.VCFFileReader.<init>(VCFFileReader.java:140)
    at htsjdk.variant.vcf.VCFFileReader.<init>(VCFFileReader.java:92)
    at picard.vcf.VcfFormatConverter.doWork(VcfFormatConverter.java:97)
    at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:305)
    at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)
    at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)
Caused by: htsjdk.tribble.TribbleException: Input stream does not contain a BCF encoded file; BCF magic header info not found, at record 0 with position 0:
    at htsjdk.variant.bcf2.BCF2Codec.error(BCF2Codec.java:482)
    at htsjdk.variant.bcf2.BCF2Codec.readHeader(BCF2Codec.java:153)
    at htsjdk.variant.bcf2.BCF2Codec.readHeader(BCF2Codec.java:58)
    at htsjdk.tribble.TribbleIndexedFeatureReader.readHeader(TribbleIndexedFeatureReader.java:261)
    ... 10 more
next-gen

Thank you.. What is the command for converting the BAM file to BCF

1 answer

your file 'ERR101899_sorted.bcf' is not a BCF file

check this with:

file ERR101899_sorted.bcf

output should be something like " Binary Call Format (BCF) version 2.1" or "compressed gzip file"

otherwise show us the output of

head ERR101899_sorted.bcf

This is what I get when I use the header command

chr1    633613  A   1   ^!. 2
chr1    633614  A   1   .   3
chr1    633615  A   1   .   9
chr1    633616  A   1   .   =
chr1    633617  T   1   .   M
chr1    633618  A   1   .   [
chr1    633619  T   1   .   [
chr1    633620  T   1   .   g
chr1    633621  A   1   .   ]
chr1    633622  A   1   .   g

it looks like the output of samtools mpileup. There is something wrong in your worklow.

Log in to answer this question.