fill-ref-md5
Quick Start
- Command:
fill-ref-md5 [OPTIONS] in.vcf.gz out.vcf.gz - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/fill-ref-md5 - Reference: see
references/help.mdfor full options and examples
When To Use This Tool
- Add
referenceandcontigheader lines with MD5 checksums to a compressed VCF. - Make a VCF header more compliant with the VCFv4.1-style reference metadata recommendations.
- Populate missing contig MD5 values from a reference FASTA before data sharing or downstream indexing.
Common Patterns
# 1) Compute MD5s from a reference FASTA and cache them in a dictionary
fill-ref-md5 -r ref.fa -d ref.fa.dict in.vcf.gz out.vcf.gz
# 2) Add assembly/species/taxonomy annotations to contig header lines
fill-ref-md5 \
-r ref.fa \
-d ref.fa.dict \
-i AS:GRCh38,SP:"Homo sapiens",TX:9606 \
in.vcf.gz out.vcf.gz
Recommended Workflow
- Ensure input VCF is bgzip-compressed and tabix-indexed
- Prepare reference FASTA indexed by
samtools faidx - Run
fill-ref-md5 -r ref.fa -d ref.fa.dict in.vcf.gz out.vcf.gz - Verify output VCF header contains new reference/contig tags
Guardrails
- Input VCF must be compressed and tabix-indexed
- Reference FASTA must be indexed by samtools faidx
- Dictionary file opens in append mode; existing records are not modified
- You need at least one of
-dor-r;-dalone only works if the dictionary already contains all required chromosomes. --helpworks, but--versionis not implemented and errors as an unknown parameter.- The script shells out to
tabix,samtools faidx, andmd5sum, so those helpers must be available.