This skill turns raw Hi-C, Micro-C, or Omni-C FASTQ into a deduplicated, filtered .pairs file with pairtools, and - just as importantly - decides whether the library worked. A clean .pairs file is a list of 5'-canonicalized, single-ligation, deduplicated, both-uniquely-mapped contacts; every step strips a specific proximity-ligation artifact. The skill covers the bwa mem -SP5M alignment idiom (mates aligned independently through ligation junctions), the pairtools parse/sort/dedup/select/stats/restrict/phase pipeline, the walks-policy and parse-vs-parse2 choices, restriction-fragment handling for single- and multi-enzyme protocols, allele-specific phasing, and the library-QC readout (cis/trans ratio, orientation balance, duplicate complexity) that confirms the experiment succeeded before any matrix is built.
conda install -c bioconda pairtools bwa bwa-mem2 chromap samtools cooler bcftools
# Optional complexity-curve estimation:
conda install -c bioconda preseq
A reference FASTA (indexed with bwa index or bwa-mem2 index) and a chrom.sizes file are required. For allele-specific work, a phased VCF and a diploid reference are also needed.
Tell your AI agent what you want to do: - "Align my Hi-C FASTQ and turn it into a deduplicated pairs file" - "Run pairtools parse, sort, dedup, and select on this BAM" - "Tell me if my Hi-C library is good - check cis/trans and duplicates" - "Process Micro-C reads without applying a 1kb distance cut" - "Handle Pore-C multi-way contacts instead of collapsing them to pairwise" - "Set up allele-specific phasing into two coolers"
"I have Hi-C R1/R2 FASTQ and an hg38 reference. Align with bwa mem -SP5M, parse to pairs with pairtools, sort, dedup keeping both UU and UC, and write a valid pairs file ready for cooler cload."
"Run pairtools stats on my deduplicated pairs and interpret it: what fraction is long-range cis, what is the trans noise floor, do the orientations converge to 25% above 1kb, and is the duplicate rate telling me to sequence deeper or stop?"
"This is a Micro-C library - process it the restriction-agnostic way and do NOT apply Hi-C's 1kb min-distance cut, since the nucleosome ladder below 1kb is the signal I want."
"These are Arima dual-enzyme Hi-C reads and I need fragment-level assignment - make sure the digest file encodes all four junction motifs, not just DpnII."
"My data is Pore-C concatemers - use a walks policy that keeps the multi-way contacts instead of collapsing them to pairwise."
"Set up allele-specific Hi-C: build a diploid reference from my phased VCF, align with suboptimal hits, run pairtools phase, and split into haplotype-1, haplotype-2, and trans pairs for two separate coolers."
"I have hundreds of Hi-C libraries to scan quickly - use chromap --preset hic for integrated alignment, dedup, and pairs output instead of the bwa-mem2 + pairtools chain."
bwa mem -SP5M (or bwa-mem2, or chromap --preset hic) so in-read ligation junctions are reconstructed and long-range/trans contacts are preserved..pairs file, choosing the walks policy by protocol (5unique for standard pairwise Hi-C, all/parse2 for multi-way).pairtools stats and interpret the cis/trans ratio, orientation-vs-distance balance, and duplicate-complexity curve to judge whether the library worked.-SP5 from the aligner flags - -SP aligns mates independently (proper-pair logic destroys long-range/trans contacts) and -5 anchors pairtools' 5' convention. -M is legacy compatibility only.--bytile-dups to separate optical from PCR duplicates; only the PCR fraction reflects complexity.pairtools restrict only for sub-kb, capture-Hi-C, or bench-QC work, and encode all enzyme motifs for Arima/Hi-C 3.0.-SP5M idiom