-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Hi! When running cue, I am getting an error:
[E::bcf_hdr_parse_sample_line] Could not parse the "#CHROM.." line, either FORMAT is missing or spaces are present instead of tab
s:
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT
Traceback (most recent call last):
File "pysam/libcbcf.pyx", line 4355, in pysam.libcbcf.VariantFile.open
File "pysam/libcbcf.pyx", line 2210, in pysam.libcbcf.makeVariantHeader
ValueError: cannot create VariantHeader
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/vsfishman/soft/cue/engine/call.py", line 183, in <module>
min_score=data_config.min_qual_score, min_len=data_config.min_sv_len)
File "/home/vsfishman/soft/cue/seq/io.py", line 360, in bed2vcf
vcf_format_file = get_vcf_format_variant_file(vcf_fname + ".format", chr_index.contigs())
File "/home/vsfishman/soft/cue/seq/io.py", line 327, in get_vcf_format_variant_file
vcf_file = VariantFile(vcf_fname)
File "pysam/libcbcf.pyx", line 4117, in pysam.libcbcf.VariantFile.__init__
File "pysam/libcbcf.pyx", line 4357, in pysam.libcbcf.VariantFile.open
ValueError: file `b'/mnt/10tb/home/vsfishman/genomes/process/1000206901/reports//svs.vcf.format'` does not have valid header (mod
e=`b'r'`) - is it VCF/BCF format?
I believe this is because when pysam is installed with new htclib (>=1.14), which does not accept empty vcf with format field:
samtools/htslib#1328 (comment)
I suggest replacing the line 326 of io.py
vcf.write("#%s\n" % "\t".join(["CHROM", "POS", "ID", "REF", "ALT", "QUAL", "FILTER", "INFO", "FORMAT"]))
with:
vcf.write("#%s\n" % "\t".join(["CHROM", "POS", "ID", "REF", "ALT", "QUAL", "FILTER", "INFO"]))
in this case, FORMAT will be added later on when actually writing records to the vcf file.
Metadata
Metadata
Assignees
Labels
No labels