No header in VCF file
0
0
Entering edit mode
10 weeks 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
        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
VCF bcftools header • 240 views
ADD COMMENT
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
ADD REPLY
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 htsjdk.tribble.index.tabix.TabixIndexCreator.addFeature(TabixIndexCreator.java:89)
        at htsjdk.variant.variantcontext.writer.IndexingVariantContextWriter.add(IndexingVariantContextWriter.java:203)
        at htsjdk.variant.variantcontext.writer.VCFWriter.add(VCFWriter.java:242)
        at picard.vcf.FixVcfHeader.doWork(FixVcfHeader.java:203)
        at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:303)
        at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:103)
        at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:113)
ADD REPLY

Login before adding your answer.

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