varona.utils.fix_vcf
VCF file utilities, mainly to fix problems.
- vcf_header_inject_contigs(header: VariantHeader, assembly: Assembly) VariantHeader [source]
Inject contigs into a VCF header.
Some VCF files do not have contigs in the header. This causes problems with pysam when trying to write out a new VCF. This function shoe-horns contigs into the headers.
Warning
This function only works for human assemblies GRCh37 and GRCh38, and for GRCh37 it uses the 1000 genomes project contigs. For that reason, non-1000-genome-project-GRCh37 VCF files are not quite compatible at this time.
- Parameters:
header – The VCF header.
- Returns:
The VCF header with contigs injected.