Entering edit mode
16 months ago
Begonia_pavonina
▴
90
Hello everyone,
I am working with a specific variant calling pipeline, and the output is a VCF file missing headers. It seems there are no option to add the header in the output. Trying to add an header with picard FixVcfHeader, I get errors as shown below. Would anyone have an idea what is missing with FixVcfHeader? Or knowing any tool that could add the header to the VCF file?
Exception in thread "main" htsjdk.tribble.TribbleException$MalformedFeatureFile: Unable to parse header with error: Your input file has a malformed header: We never saw a header line specifying VCF version, for input source: file:///~/output.vcf
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:121)
at htsjdk.tribble.AbstractFeatureReader.getFeatureReader(AbstractFeatureReader.java:81)
at htsjdk.variant.vcf.VCFFileReader.<init>(VCFFileReader.java:145)
at htsjdk.variant.vcf.VCFFileReader.<init>(VCFFileReader.java:95)
at picard.vcf.FixVcfHeader.doWork(FixVcfHeader.java:113)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:303)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)
Caused by: htsjdk.tribble.TribbleException$InvalidHeader: Your input file has a malformed header: We never saw a header line specifying VCF version
at htsjdk.variant.vcf.VCFCodec.readActualHeader(VCFCodec.java:108)
at htsjdk.tribble.AsciiFeatureCodec.readHeader(AsciiFeatureCodec.java:79)
at htsjdk.tribble.AsciiFeatureCodec.readHeader(AsciiFeatureCodec.java:37)
at htsjdk.tribble.TribbleIndexedFeatureReader.readHeader(TribbleIndexedFeatureReader.java:261)
... 10 more
Try adding the version, as the error message suggests. I think this is the minimum requirement for a valid vcf.
Thank you for the answer. The error message has changed (see below).
If I understand well, I can't fix header because the VCF file is not sorted. But I can't use bcftools sort, as the file has to be indexed with tabix. unfortunately, the file can't be indexed, the sequences positions are not sorted.
It seems that there is a loop of problems to manage files without headers!
If anyone has a procedure to process an header less VCF file I would be interested.