0
0
Entering edit mode
16 months ago

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
... 10 more

VCF bcftools header • 1.0k views
1
Entering edit mode

Try adding the version, as the error message suggests. I think this is the minimum requirement for a valid vcf.

##fileformat=VCFv4.3

0
Entering edit mode

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.

To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" java.lang.IllegalArgumentException: Features added out of order: previous (TabixFeature{referenceIndex=16, start=640854, end=640854, featureStartFilePosition=20737, featureEndFilePosition=-1}) > next (TabixFeature{referenceIndex=16, start=640783, end=640783, featureStartFilePosition=20848, featureEndFilePosition=-1})
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:303)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)