← Về thư mục
📄 / / profiles / r-and-d / raw_evidence / OpenAI4S / skills / bioskills / bio-long-read-sequencing-long-read-alignment / references / usage-guide.md

Long-Read Alignment - Usage Guide

Overview

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).

Prerequisites

conda install -c bioconda minimap2 samtools
# Optional specialized aligners:
conda install -c bioconda winnowmap pbmm2 lra
# VACmap: see https://github.com/micahvista/VACmap

Quick Start

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"

Example Prompts

Error-rate-matched preset

"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."

Methylation passthrough

"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."

Repeats and centromeres

"My reads are mismapping in centromeric and segmental-duplication regions of a T2T reference. Align them with something that handles repetitive sequence correctly."

Spliced cDNA / Iso-Seq

"These are PacBio Iso-Seq full-length cDNA reads. Spliced-align them to the genome so I can feed the BAM to isoform collapse."

Assembly to reference

"Align my assembly to the reference at ~1% divergence and call the variants from the alignment."

What the Agent Will Do

  1. Determine read type and error rate (R9 noisy vs R10/Q20/duplex accurate vs HiFi vs CLR vs RNA).
  2. Choose the matching preset (map-ont / lr:hq / map-hifi / map-pb / splice / asm*).
  3. Add the tags the downstream tool needs (-Y, -y, --MD, --cs) and a read group.
  4. Pipe to samtools sort and index, or use pbmm2 for a one-call sorted+indexed PacBio BAM.
  5. For repeat-heavy references or complex SVs, route to Winnowmap2 or VACmap/lra.
  6. For very large references, set -I/--split-prefix to avoid the multi-part-index MAPQ problem.

Tips

Resources