Entering edit mode
7.4 years ago
shahbazmunir11
▴
10
Hi, I am using htsjdk library and want to read vcf file. I tried the following code but it gives error "Exception in thread "main" htsjdk.tribble.TribbleException$InvalidHeader: Your input file has a malformed header: We never saw the required CHROM header line (starting with one #) for the input VCF file". I checked the file and created the sample file but same error. Any suggestion? Thanks for your time and consideration.
VCFCodec codec = new VCFCodec();
LineReader r= LineReaderUtil.fromBufferedStreamSystem.in);
LineIteratorImpl t= new LineIteratorImpl(r);
codec.readActualHeader(t);
while(t.hasNext()){
VariantContext ctx = codec.decode(t.next());
}
r.close();
t.close();
show us the header.
Case 1: The file "Sample2_Working" is working but the file "Sample_Error" gives an error. Both files are same but with the different header. Case 2: The file "Sample2_Working" is working but with another error. "An index is required, but none found". How can I generate the index file?
Thanks
Case1: Sample_Error header 3rd line
this is not a valid header line. A VCF header line is
Okay i will remove those lines. This sample file is working but with another error "An index is required, but none found." I have created the .tbi index file but its not working. How we can resolve this error? Thanks