← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-genome-assembly-hifi-assembly / references / usage-guide.md

HiFi Assembly - Usage Guide

Overview

This skill builds haplotype-resolved diploid and telomere-to-telomere (T2T) genome assemblies from PacBio HiFi reads. HiFi reads are simultaneously long (15-25 kb) and accurate (~Q30), which made phased diploid assembly routine and shifted the field's deliverable from one collapsed reference to two phased haplotypes (and onward to the pangenome). The core tool is hifiasm (HiFi-only, Hi-C, or trio phasing); verkko handles true T2T when HiFi is paired with ultralong ONT and trio/Hi-C. The recurring judgment is that a "primary" assembly is a haplotype mosaic that exists in no cell, and that switch errors - the defining error of phasing - are invisible to N50, BUSCO, and base QV, so k-mer/trio QC (Merqury hap-mer blob plots, switch/hamming error) is the only window onto them.

Prerequisites

# Core assembler + trio k-mer tool
conda install -c bioconda hifiasm yak

# GFA-to-FASTA extraction
conda install -c bioconda gfatools

# T2T (HiFi + ultralong ONT); heavy, Snakemake-orchestrated
conda install -c bioconda verkko

# Phasing QC (hap-mers, switch/hamming) - see assembly-qc
conda install -c bioconda merqury meryl

Profile the sample first (k-mer spectrum via GenomeScope) to learn genome size and heterozygosity - this drives the purge setting and whether phasing is even meaningful.

Quick Start

Tell your AI agent what you want to do: - "Assemble my diploid HiFi reads with hifiasm" - "Phase my assembly with Hi-C since I do not have parental data" - "Run a trio-binned assembly with both parents' Illumina reads" - "My sample is an inbred line - assemble it without purging real duplications" - "I have HiFi plus ultralong ONT and want a T2T assembly" - "Convert the hifiasm GFA output to FASTA"

Example Prompts

HiFi-only and Hi-C phasing

"Assemble my diploid plant HiFi reads with hifiasm, then explain why the primary assembly is not one of the two haplotypes and which output I should hand to a phased variant caller." "I have HiFi plus a Hi-C library and no parents. Run hifiasm Hi-C phasing and tell me whether the resulting hap1/hap2 are globally or partially phased."

Trio phasing

"Build yak k-mer databases from the parental Illumina reads at k=31 and run a trio-binned hifiasm assembly of the child. Note that the output uses the .dip. prefix."

Inbred / coverage diagnostics

"This is a doubled-haploid line. Assemble it with purging disabled so hifiasm does not delete real segmental duplications, and explain why default purging would be wrong here." "My hap1 came out 1.4x the size of hap2. Diagnose this as a coverage-estimate problem and re-run with --hom-cov set from the k-mer histogram."

T2T

"I have 40x HiFi, ultralong ONT with a 90 kb N50, and parental reads. Decide whether verkko or hifiasm --ul is the right call for a T2T assembly and justify it."

Phasing QC handoff

"I have a phased assembly but only N50 and BUSCO were reported. Explain why those cannot see switch errors and what k-mer QC I need to actually validate the phasing."

What the Agent Will Do

  1. Establish the sample type (outbred diploid, inbred/doubled-haploid, mole) and what data exist (parents, Hi-C, ultralong ONT) - this determines everything downstream.
  2. QC the HiFi reads (length, QV, contamination) before assembling.
  3. Select the phasing mechanism: HiFi-only (partial), Hi-C (global, no parents), or trio (gold standard); or verkko/hifiasm --ul if T2T is the genuine goal and ultralong reads exist.
  4. Set the purge level appropriately (-l0 for inbred/homozygous; default otherwise) and pin --hom-cov if haplotype sizes come out unbalanced.
  5. Run hifiasm (or verkko) and extract contigs from GFA S lines to FASTA.
  6. Identify the output by its prefix (.bp. = HiFi-only/Hi-C, .dip. = trio) and report which file is the mosaic primary vs the two haplotypes.
  7. Route phasing QC to k-mer/trio metrics (Merqury hap-mer blob plot, switch/hamming) and contiguity/completeness/QC to assembly-qc.

Tips