Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Align long reads using minimap2 for Oxford Nanopore and PacBio data. Supports various presets for different read types and applications. Use when aligning ONT or PacBio reads to a reference genome for variant calling, SV detection, or coverage analysis.
.claude/skills/bio-longread-alignment/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-12 | ✗→✓ | ▲ Improved | — | — |
| case-14 | ✗→✓ | ▲ Improved | — | — |
| case-11 | ✓→✓ | = Same ✓ | — | — |
| case-16 | ✓→✓ | = Same ✓ | — | — |
| case-03 | ✗→✗ | = Same ✗ | — | — |
Reference examples tested with: minimap2 2.26+, samtools 1.19+
Before using code patterns, verify installed versions match. If versions differ:
<tool> --version then <tool> --help to confirm flagsIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Align my long reads to the reference" → Map ONT or PacBio reads using minimap2 with technology-specific presets for optimal sensitivity and accuracy.
minimap2 -ax map-ont ref.fa reads.fq | samtools sort -o aligned.bam (ONT), minimap2 -ax map-hifi (PacBio HiFi)bash# Basic ONT alignment minimap2 -ax map-ont reference.fa reads.fastq.gz | \ samtools sort -o aligned.bam samtools index aligned.bam
bash# PacBio HiFi reads (high accuracy) minimap2 -ax map-hifi reference.fa reads.fastq.gz | \ samtools sort -o aligned.bam samtools index aligned.bam
bash# PacBio CLR (continuous long reads, lower accuracy) minimap2 -ax map-pb reference.fa reads.fastq.gz | \ samtools sort -o aligned.bam samtools index aligned.bam
bash# Build index once minimap2 -d reference.mmi reference.fa # Use index for alignment minimap2 -ax map-ont reference.mmi reads.fastq.gz | samtools sort -o aligned.bam
bashminimap2 -ax map-ont \ -t 8 \ # Threads -R '@RG\tID:sample\tSM:sample' \ # Read group --secondary=no \ # No secondary alignments --MD \ # Generate MD tag for variants -Y \ # Use soft clipping for supplementary reference.fa reads.fastq.gz | \ samtools sort -@ 4 -o aligned.bam
bash# For direct RNA or cDNA sequencing minimap2 -ax splice reference.fa reads.fastq.gz | \ samtools sort -o aligned.bam
bash# Provide known splice junctions minimap2 -ax splice --junc-bed junctions.bed \ reference.fa reads.fastq.gz | samtools sort -o aligned.bam
bash# Assembly with ~0.1% divergence minimap2 -ax asm5 reference.fa assembly.fa > aligned.sam # Assembly with higher divergence (~5%) minimap2 -ax asm20 reference.fa assembly.fa > aligned.sam
bash# PAF format (faster, for quick analysis) minimap2 -x map-ont reference.fa reads.fastq.gz > alignments.paf
bash# Keep all alignments (for SV calling) minimap2 -ax map-ont \ --secondary=yes \ -N 5 \ # Max secondary alignments reference.fa reads.fastq.gz | samtools sort -o aligned.bam
bash# During alignment pipeline minimap2 -ax map-ont reference.fa reads.fastq.gz | \ samtools view -b -q 10 | \ # Min mapping quality 10 samtools sort -o aligned.bam
bash# Concatenate inputs minimap2 -ax map-ont reference.fa reads1.fastq.gz reads2.fastq.gz | \ samtools sort -o aligned.bam # Or use file list cat file_list.txt | xargs minimap2 -ax map-ont reference.fa | \ samtools sort -o aligned.bam
bash# Get alignment statistics samtools flagstat aligned.bam # Detailed stats samtools stats aligned.bam | grep ^SN
bash# Extract alignments to BED awk 'OFS="\t" {print $6, $8, $9, $1, $12, ($5=="+")?"+":"-"}' alignments.paf > alignments.bed
| Preset | Description | Best For | |--------|-------------|----------| | map-ont | ONT reads | Nanopore genomic | | map-hifi | PacBio HiFi | PacBio genomic | | map-pb | PacBio CLR | PacBio CLR | | splice | Long RNA reads | cDNA, direct RNA | | asm5 | Low divergence | Same species assembly | | asm20 | High divergence | Cross-species assembly | | sr | Short reads | Illumina (basic) |
| Parameter | Default | Description | |-----------|---------|-------------| | -t | 3 | CPU threads | | -k | 15 | K-mer size | | -w | 10 | Minimizer window | | -a | off | Output SAM | | -x | none | Preset | | --secondary | yes | Output secondary | | -N | 5 | Max secondary alignments | | --MD | off | Generate MD tag | | -R | none | Read group header | | -Y | off | Soft clipping for supplementary |
| Format | Flag | Description | |--------|------|-------------| | PAF | (default) | Pairwise Alignment Format | | SAM | -a | Sequence Alignment Map | | BAM | -a \| samtools | Binary SAM |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-03 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-09 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.