Haplotype assembly is a two-step process.
Convert your BAM file into a compact fragment file format. This is a mandatory precursor to running HapCUT2.
Step 2: Assemble haplotypes with HAPCUT2
Use the fragment file generated in Step 1 to assemble haplotype blocks.
Input Requirements:
- A BAM file containing reads aligned to a reference genome.
- A VCF file containing short variant calls (SNVs and indels) and diploid genotypes for the same individual. Note: The program does not accept gzipped VCF files.
If you have data from different technologies or multiple BAM files for the same individual, run Step 1 on each BAM file separately, concatenate the resulting fragment files, and then run Step 2 on the combined file.
# 1. Extract fragments
./build/extractHAIRS [options] --bam reads.sorted.bam --VCF variants.vcf --out fragment_file
# 2. Assemble haplotypes
./build/HAPCUT2 --fragments fragment_file --VCF variants.vcf --output haplotype_output_file