Long-read alignment maps Oxford Nanopore and PacBio reads (or whole assemblies) to a reference with minimap2. The central decision is the -x preset, which is not a label but a bundle that rewrites k-mer/window and the entire scoring and chaining model - so the right preset depends on the reads' error rate (noisy R9 vs accurate Q20/R10/HiFi), not just the platform. This skill also covers the tags downstream callers silently depend on (-Y for SV split reads, -y for methylation MM/ML, --MD/--cs for variant tools), the multi-part-index MAPQ trap on large references, and when to swap minimap2 for Winnowmap (repeats/centromeres), VACmap/lra (complex SVs), or pbmm2 (PacBio-native).
conda install -c bioconda minimap2 samtools
# Optional specialized aligners:
conda install -c bioconda winnowmap pbmm2 lra
# VACmap: see https://github.com/micahvista/VACmap
Tell your AI agent what you want to do: - "Align my accurate R10 Nanopore reads with the lr:hq preset and give me a sorted BAM" - "Map PacBio HiFi reads and keep the tags Sniffles needs" - "Align my Dorado methylation BAM without losing the MM/ML tags" - "Spliced-align my direct RNA reads"
"I have ONT R10.4.1 reads basecalled with Dorado sup. Map them to GRCh38 with the correct preset, keep supplementary alignments soft-clipped for SV calling, add the MD tag, and give me a sorted+indexed BAM ready for Clair3 and Sniffles."
"These are Dorado-basecalled reads with 5mC MM/ML tags. Align them to the genome without dropping the methylation tags so I can run modkit pileup."
"My reads are mismapping in centromeric and segmental-duplication regions of a T2T reference. Align them with something that handles repetitive sequence correctly."
"These are PacBio Iso-Seq full-length cDNA reads. Spliced-align them to the genome so I can feed the BAM to isoform collapse."
"Align my assembly to the reference at ~1% divergence and call the variants from the alignment."
-Y, -y, --MD, --cs) and a read group.samtools sort and index, or use pbmm2 for a one-call sorted+indexed PacBio BAM.-I/--split-prefix to avoid the multi-part-index MAPQ problem.lr:hq, not map-ont - it is ~4x faster and at least as accurate.map-pb is PacBio CLR only; never use it for HiFi (use map-hifi).-Y (soft-clip supplementaries) so breakpoint sequence survives; --secondary=no is fine.samtools fastq -T MM,ML and minimap2 -y, or the tags vanish with no error..mmi bakes in k/w/H/I; build it with the same preset you will align with.-uf (stranded); without it minimap2 invents junctions on the wrong strand.lr:hq/lr:hqae and fixes the 2.27 --MD regression.-y