cyvcf2
cyvcf2 copied to clipboard
Error updating INFO with new field
Hi,
I want to add a new INFO field but I'm getting an error in the first record for which there's a match to annotate:
Assertion failed: (!inf->vptr_free), function bcf_update_info, file vcf.c, line 3356. Abort trap: 6
I'm using the following code:
vcf_data = VCF(invcf, gts012=True)
vcf_data.add_info_to_header({'ID': 'tissue_val', 'Description': 'Top N values',
'Type': 'Character', 'Number': '.'})
vcf_data.add_info_to_header({'ID': 'tissue_name', 'Description': 'Top N tissues',
'Type': 'Character', 'Number': '.'})
....
When there's a variant match:
record.INFO["tissue_val"] = ','.join(top_N_val)
record.INFO["tissue_name"] = ','.join(top_N_tissues)
I'm using cyvcf2 v0.11.5 installed through conda. Any help?
Best, Pedro Barbosa
Ok, in one docker container it worked. The only difference it's that I built the docker image with manual installation of bcftools and htslib before installation of cyvcf2 with conda:
RUN git clone git://github.com/samtools/htslib.git && git clone git://github.com/samtools/bcftools.git
RUN cd htslib && make && cd ../
RUN bcftools && make && cd ../
ENV PATH "$PATH:/tools/htslib"
ENV PATH "$PATH:/tools/bcftools"
ENV BCFTOOLS_PLUGINS "/tools/bcftools/plugins"