Pore-C tutorial: haplotype-aware scaffolding from hifiasm hap assemblies (tetraploid example)¶
This tutorial shows how to scaffold pre-separated haplotypes produced by hifiasm using C-Phasing in haplotype-aware mode (--mode hapaware) with Hi-C data.
The goal is to keep haplotypes consistent while producing chromosome-scale scaffolds.
0. Prerequisites¶
Input data¶
- hifiasm haplotype assemblies (FASTA), for example:
hap1.fahap2.fahap3.fahap4.fa
- Pore-C read pairs (FASTQ), for example:
porec_reads.fastq.gz
Notes - This tutorial assumes you already have haplotype-separated assemblies (one FASTA per haplotype). - If you have hifiasm
*.hap*.p_ctg.fastaoutputs, convert/select the hap FASTA files you want to scaffold.
1. Prepare a combined FASTA (recommended)¶
C-Phasing expects a single assembly FASTA as the contig set to scaffold.
For hap-aware scaffolding, concatenate the hap assemblies into one FASTA.
Important: unique contig names¶
Ensure contig IDs are unique across haplotypes. If hifiasm already prefixes contig names per hap, you are fine. Otherwise, rename contigs to avoid collisions.
A simple pattern is to add a prefix per haplotype, e.g. h1, h2, h3, h4.
2. Provide an initial haplotype clustering file (-fc)¶
--mode hapaware is designed for cases where haplotypes are already separated.
Providing an initial cluster file helps C-Phasing keep haplotypes consistent.
Create a haps.clusters.txt with two columns:
group_idcontig_id
Example (illustrative):
Tip: In hap-aware mode,
-fc first.clusters.txtis the key input that encodes haplotype priors.
3. Run C-Phasing (Hi-C + hapaware)¶
Run the main pipeline with Hi-C read pairs and --mode hapaware.