[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EE1P351RCBXJ4WDSD0JH46":3,"skill-same:01M7EE1P351RCBXJ4WDSD0JH46":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EE1P351RCBXJ4WDSD0JH46","bio-long-read-sequencing-nanopore-methylation",null,"Calls DNA base modifications (5mC, 5hmC, 6mA, 4mC) directly from Oxford Nanopore and PacBio HiFi long reads encoded as MM\u002FML SAM tags, piles them into per-site bedMethyl with modkit (or pb-CpG-tools for PacBio), and produces phased allele-specific methylation. Covers why methylation is a basecalling decision that cannot be recovered later, the MM\u002FML tag-drop failure that silently zeroes methylation through alignment, the MM ? vs . no-call semantics, 5mC\u002F5hmC resolution vs bisulfite, modkit's 10th-percentile auto-threshold, and the haplotagged ASM workflow. Use when calling 5mC\u002F5hmC\u002F6mA from a modBAM, generating bedMethyl, preserving methylation tags through alignment, doing allele-specific or differential methylation, or QC-ing a modification BAM.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-long-read-sequencing-nanopore-methylation\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-long-read-sequencing-nanopore-methylation\ndescription: Calls DNA base modifications (5mC, 5hmC, 6mA, 4mC) directly from Oxford Nanopore and PacBio HiFi long reads encoded as MM\u002FML SAM tags, piles them into per-site bedMethyl with modkit (or pb-CpG-tools for PacBio), and produces phased allele-specific methylation. Covers why methylation is a basecalling decision that cannot be recovered later, the MM\u002FML tag-drop failure that silently zeroes methylation through alignment, the MM ? vs . no-call semantics, 5mC\u002F5hmC resolution vs bisulfite, modkit's 10th-percentile auto-threshold, and the haplotagged ASM workflow. Use when calling 5mC\u002F5hmC\u002F6mA from a modBAM, generating bedMethyl, preserving methylation tags through alignment, doing allele-specific or differential methylation, or QC-ing a modification BAM.\ntool_type: cli\nprimary_tool: modkit\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"long-read-sequencing\u002Fnanopore-methylation\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: modkit 0.3+, dorado 1.0+, minimap2 2.28+, samtools 1.19+, pb-CpG-tools 2.3+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nInputs that determine what is even possible - record them:\n- The basecaller MODIFICATION model (e.g. `5mCG_5hmCG`) fixes which mods can ever be piled up; it must be requested at basecall time and cannot be added later.\n- The MM\u002FML tags must survive every fastq\u002Falignment step or methylation is silently lost.\n- modkit auto-estimates the pass threshold from the data (per run); fix it for cross-sample comparisons.\n\nIf code throws an error, introspect the installed tool (`modkit pileup --help`, `modkit --help`) and adapt the example to the actual API rather than retrying.\n\n# Nanopore Methylation\n\n**\"Call methylation from my long reads\"** -> First confirm the MM\u002FML tags exist and survived alignment, then pile them into per-site bedMethyl - because methylation is a basecalling decision, not something that can be added now.\n- CLI: `modkit pileup aligned.bam out.bed --ref ref.fa --cpg --combine-strands`\n\n## The Single Most Important Modern Insight -- Methylation Is a Basecalling Decision, and the Tags Silently Die in Alignment\n\nTwo facts gate the entire skill:\n\n1. **If the reads were not basecalled with a modification model, the signal is already gone.** Mods are inferred from raw signal at basecall time (ONT Remora model in Dorado; PacBio kinetics model in jasmine) and written into the unaligned BAM as MM\u002FML tags. A plain BAM or a FASTQ cannot yield methylation - there is no post-hoc tool. The only fix is re-basecalling from POD5 (`dorado basecaller sup,5mCG_5hmCG pod5\u002F`). The agent's FIRST move is to check the tags exist: `samtools view in.bam | head | grep -o 'MM:Z:[^\\t]*'`.\n2. **The MM\u002FML tags silently die in a normal alignment workflow.** `samtools fastq` drops auxiliary tags unless given `-T MM,ML`; minimap2 ignores them unless given `-y`; hard-clipping breaks MM's per-base skip counting unless `-Y` is set. Miss any one and the aligned BAM still sorts, indexes, and looks fine, but `modkit pileup` returns an empty\u002Fall-canonical bedMethyl with no error. Use `dorado aligner` (carries tags natively) or `samtools fastq -T MM,ML | minimap2 -y -Y`, and re-grep for MM:Z AFTER alignment.\n\n## End-to-End modBAM Pipeline\n\n```bash\n# 1. MODS-BASECALL (from POD5; the only step that can ever produce methylation)\ndorado basecaller sup,5mCG_5hmCG pod5\u002F > calls.bam      # unaligned BAM, has MM\u002FML\n\n# 2. TAG-PRESERVING ALIGN (route a is simplest)\ndorado aligner ref.mmi calls.bam > aligned.bam                                  # a) native\nsamtools fastq -T MM,ML calls.bam | minimap2 -y -Y -ax lr:hq ref.fa - \\\n  | samtools sort -o aligned.bam && samtools index aligned.bam                  # b) manual\nsamtools view aligned.bam | head | grep -q 'MM:Z' && echo 'tags survived'       # verify!\n\n# 3. PILEUP -> bedMethyl (auto-thresholds at the 10th percentile of ML; NOT 0.5)\nmodkit pileup aligned.bam out.bed --ref ref.fa --cpg --combine-strands\nbgzip out.bed && tabix -p bed out.bed.gz\n\n# 4. (optional) DIFFERENTIAL methylation, long-read native\nmodkit dmr pair -a A.bed.gz -b B.bed.gz --ref ref.fa --regions cpgislands.bed -o dmr.tsv\n```\n\n## MM \u002F ML Tag Spec (what the numbers mean)\n\n- `MM:Z` encodes modification positions: `\u003Ccanonical base>\u003Cstrand>\u003Cmod code>\u003C. or ?>,\u003Cskip counts>;`. Mod codes: `m`=5mC, `h`=5hmC, `a`=6mA, `c`=4mC. The `.`\u002F`?` modifier is load-bearing: `.` = skipped bases are implicitly canonical (count toward the unmodified denominator); `?` = skipped bases are no-call\u002Funknown (land in Nnocall, outside the denominator). Misreading `?` as `.` inflates the canonical denominator and deflates methylation.\n- `ML:B:C` is a uint8 per call: value N means probability in `[N\u002F256, (N+1)\u002F256)`, so 255 is ~0.998, never exactly 1.0. Do not threshold `== 1.0`.\n\n## bedMethyl Columns (modkit, 18 columns)\n\nCols 1-9 are tab-delimited BED9; cols 10-18 are space-delimited (a parsing gotcha). The ones that matter:\n\n| Col | Name | Meaning |\n|-----|------|---------|\n| 10 | Nvalid_cov | Nmod + Ncanonical + Nother_mod (the denominator; this is \"coverage\" for QC) |\n| 11 | percent_modified | (Nmod \u002F Nvalid_cov) * 100 (a percent, 0-100) |\n| 12 | Nmod | passing calls of this modification |\n| 13 | Ncanonical | passing calls of the canonical base |\n| 14 | Nother_mod | passing calls of a different mod on the same base (5hmC in a 5mC row) |\n| 16 | Nfail | calls below the pass threshold (excluded from Nvalid_cov) |\n| 18 | Nnocall | aligned canonical base with no mod call (e.g. `?`-skipped) |\n\nFor count-based DMR (DSS\u002FmethylKit) hand over Nmod and Nvalid_cov, never percent_modified.\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended | Why |\n|----------|-------------|-----|\n| ONT 5mC for mammals | `dorado ...sup,5mCG_5hmCG` -> `modkit pileup --cpg --combine-strands` | mammalian 5mC is overwhelmingly CpG |\n| Compare ONT to WGBS\u002Farray | `modkit pileup --combine-mods` (or `--preset traditional`) | WGBS conflates 5mC+5hmC; combine to match |\n| Study 5hmC biology | keep 5mC and 5hmC split; ideally add oxBS\u002FTAB-seq | bisulfite cannot separate them |\n| Plants (CHG\u002FCHH) or bacterial 6mA\u002F4mC | all-context model + `--motif` (not `--cpg`) | methylation is not CpG-restricted there |\n| Allele-specific methylation \u002F imprinting | phase + haplotag -> `modkit pileup --partition-tag HP` | one read carries SNV phase AND methylation |\n| PacBio HiFi 5mC | `ccs --hifi-kinetics` -> `jasmine` -> pb-CpG-tools (or modkit) | primrose is deprecated; Revio does 5mC on-instrument |\n| Differential methylation statistics | `modkit dmr` (native) or export to -> methylation-analysis | DSS\u002FmethylKit for dispersion modeling |\n| RNA modifications (m6A etc.) | -> epitranscriptomics | direct-RNA mods are out of scope here |\n\n## Phased Allele-Specific Methylation\n\n```bash\n# Order is strict: align (tags preserved) -> phase+haplotag -> pileup partitioned by HP\n# 1-2. Clair3\u002FDeepVariant -> whatshap\u002Flongphase phase + haplotag (adds HP:i:1\u002F2) -> haplotype-phasing\nmodkit pileup aligned.haplotagged.bam asm_out\u002F --ref ref.fa --cpg --combine-strands --partition-tag HP\n# --partition-tag writes one UNCOMPRESSED bedMethyl per HP value into asm_out\u002F, named by the tag\n# value (e.g. 1.bed, 2.bed). bgzip + tabix each before dmr, which requires indexed inputs:\nbgzip asm_out\u002F1.bed && tabix -p bed asm_out\u002F1.bed.gz\nbgzip asm_out\u002F2.bed && tabix -p bed asm_out\u002F2.bed.gz\nmodkit dmr pair -a asm_out\u002F1.bed.gz -b asm_out\u002F2.bed.gz --ref ref.fa -o asm.tsv\n```\n\nEach haplotype gets ~half the coverage, so the per-site 10x floor effectively wants ~20x total. Imprinted loci (one haplotype ~fully methylated) are the canonical positive control.\n\n## Per-Method Failure Modes\n\n### No methylation in a plain BAM\n**Trigger:** BAM basecalled without a mods model. **Mechanism:** mods are a basecall-time decision. **Symptom:** no MM:Z tags; modkit returns nothing. **Fix:** re-basecall from POD5 with a mods model; there is no post-hoc tool.\n\n### Tags died in alignment (the #1 silent killer)\n**Trigger:** `samtools fastq | minimap2` without `-T MM,ML`\u002F`-y`. **Mechanism:** fastq export and minimap2 drop the tags. **Symptom:** valid aligned BAM, empty bedMethyl, no error. **Fix:** `dorado aligner`, or `samtools fastq -T MM,ML | minimap2 -y -Y`; verify MM:Z after alignment.\n\n### Methylation fraction looks too low\n**Trigger:** misreading `?` (no-call) as `.` (canonical). **Mechanism:** unscored bases counted as unmethylated. **Symptom:** deflated percent_modified; large Nnocall. **Fix:** check the MM modifier and Nnocall; `modkit update-tags` to convert styles if needed.\n\n### 5mC understated vs WGBS\n**Trigger:** comparing ONT-5mC-only to bisulfite. **Mechanism:** WGBS reads 5mC+5hmC together. **Symptom:** ONT looks lower by the 5hmC fraction. **Fix:** `--combine-mods`\u002F`--preset traditional` to combine before comparing.\n\n### Cross-sample thresholds not comparable\n**Trigger:** relying on modkit's auto-threshold per sample. **Mechanism:** the 10th-percentile cut is data-dependent. **Symptom:** sample-specific thresholds confound a DMR. **Fix:** fix a common `--filter-threshold`\u002F`--mod-thresholds` across samples.\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|-----------|--------|-----------|\n| Nvalid_cov >= 10 per CpG | field standard | below it, single-site fractions are noisy (~20x total for phased) |\n| modkit pass = 10th percentile of ML | modkit docs | discards the lowest-confidence ~10%; improves WGBS concordance |\n| R10 ONT vs WGBS r ~ 0.84-0.95 | benchmarks | adequate-depth site-level concordance (R10 > R9) |\n| ML 255 ~ 0.998 (not 1.0) | SAM spec | uint8 bin [255\u002F256, 1.0); never test == 1.0 |\n| no `--min-coverage` flag on pileup | modkit API | filter bedMethyl on Nvalid_cov post-hoc instead |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Empty bedMethyl \u002F Nvalid_cov 0 | tags dropped or never present | grep MM:Z; re-basecall or re-align preserving tags |\n| `modkit pileup --min-coverage` unknown flag | no such flag | filter on Nvalid_cov (col 10) after pileup |\n| `modkit extract in.bam out.tsv` errors | needs a subcommand | `modkit extract full` \u002F `modkit extract calls` |\n| `modkit dmr` fails on raw .bed | inputs must be indexed | `bgzip` + `tabix -p bed` first |\n| Sparse bedMethyl with `--combine-strands` | records lack MN tags (old basecaller or hard-clipped) | basecall with current Dorado and align with `-Y` (no hard-clip) |\n| Methylation lower than expected | `?` read as `.`; or 5hmC excluded vs WGBS | check Nnocall; `--combine-mods` to match WGBS |\n| primrose not found (PacBio) | deprecated\u002Farchived | use `jasmine` (or Revio on-instrument 5mC) |\n\n## References\n\n- Simpson JT, Workman RE, Zuzarte PC, et al. 2017. Detecting DNA cytosine methylation using nanopore sequencing. *Nat Methods* 14:407-410.\n- Yuen ZW-S, Srivastava A, Daniel R, et al. 2021. Systematic benchmarking of tools for CpG methylation detection from nanopore sequencing (METEORE). *Nat Commun* 12:3438.\n- Tse OYO, Jiang P, Cheng SH, et al. 2021. Genome-wide detection of cytosine methylation by single molecule real-time sequencing. *PNAS* 118(5):e2019768118.\n- Cheetham SW, Kindlova M, Ewing AD. 2022. Methylartist: tools for visualizing modified bases from nanopore sequence data. *Bioinformatics* 38(11):3109-3112.\n- SAM Optional Fields Specification (SAMtags): MM\u002FML base-modification tags. samtools\u002Fhts-specs.\n\n## Related Skills\n\n- basecalling - The upstream gate: methylation must be requested at basecall time\n- long-read-alignment - Carry MM\u002FML through with `-y -Y` (or use dorado aligner)\n- haplotype-phasing - Phase + haplotag the BAM for allele-specific methylation\n- clair3-variants - SNVs to phase before allele-specific methylation\n- methylation-analysis\u002Fdmr-detection - DMR statistics downstream of bedMethyl\n- methylation-analysis\u002Fmethylkit-analysis - methylKit differential methylation\n- epitranscriptomics\u002Fm6anet-analysis - Direct-RNA m6A (out of scope here)\n- workflows\u002Fmethylation-pipeline - End-to-end methylation pipeline\n","## Version Compatibility\n\nReference examples tested with: modkit 0.3+, dorado 1.0+, minimap2 2.28+, samtools 1.19+, pb-CpG-tools 2.3+.\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- CLI: `\u003Ctool> --version` then `\u003Ctool> --help` to confirm flags\n\nInputs that determine what is even possible - record them:\n- The basecaller MODIFICATION model (e.g. `5mCG_5hmCG`) fixes which mods can ever be piled up; it must be requested at basecall time and cannot be added later.\n- The MM\u002FML tags must survive every fastq\u002Falignment step or methylation is silently lost.\n- modkit auto-estimates the pass threshold from the data (per run); fix it for cross-sample comparisons.\n\nIf code throws an error, introspect the installed tool (`modkit pileup --help`, `modkit --help`) and adapt the example to the actual API rather than retrying.\n\n# Nanopore Methylation\n\n**\"Call methylation from my long reads\"** -> First confirm the MM\u002FML tags exist and survived alignment, then pile them into per-site bedMethyl - because methylation is a basecalling decision, not something that can be added now.\n- CLI: `modkit pileup aligned.bam out.bed --ref ref.fa --cpg --combine-strands`\n\n## The Single Most Important Modern Insight -- Methylation Is a Basecalling Decision, and the Tags Silently Die in Alignment\n\nTwo facts gate the entire skill:\n\n1. **If the reads were not basecalled with a modification model, the signal is already gone.** Mods are inferred from raw signal at basecall time (ONT Remora model in Dorado; PacBio kinetics model in jasmine) and written into the unaligned BAM as MM\u002FML tags. A plain BAM or a FASTQ cannot yield methylation - there is no post-hoc tool. The only fix is re-basecalling from POD5 (`dorado basecaller sup,5mCG_5hmCG pod5\u002F`). The agent's FIRST move is to check the tags exist: `samtools view in.bam | head | grep -o 'MM:Z:[^\\t]*'`.\n2. **The MM\u002FML tags silently die in a normal alignment workflow.** `samtools fastq` drops auxiliary tags unless given `-T MM,ML`; minimap2 ignores them unless given `-y`; hard-clipping breaks MM's per-base skip counting unless `-Y` is set. Miss any one and the aligned BAM still sorts, indexes, and looks fine, but `modkit pileup` returns an empty\u002Fall-canonical bedMethyl with no error. Use `dorado aligner` (carries tags natively) or `samtools fastq -T MM,ML | minimap2 -y -Y`, and re-grep for MM:Z AFTER alignment.\n\n## End-to-End modBAM Pipeline\n\n```bash\n# 1. MODS-BASECALL (from POD5; the only step that can ever produce methylation)\ndorado basecaller sup,5mCG_5hmCG pod5\u002F > calls.bam      # unaligned BAM, has MM\u002FML\n\n# 2. TAG-PRESERVING ALIGN (route a is simplest)\ndorado aligner ref.mmi calls.bam > aligned.bam                                  # a) native\nsamtools fastq -T MM,ML calls.bam | minimap2 -y -Y -ax lr:hq ref.fa - \\\n  | samtools sort -o aligned.bam && samtools index aligned.bam                  # b) manual\nsamtools view aligned.bam | head | grep -q 'MM:Z' && echo 'tags survived'       # verify!\n\n# 3. PILEUP -> bedMethyl (auto-thresholds at the 10th percentile of ML; NOT 0.5)\nmodkit pileup aligned.bam out.bed --ref ref.fa --cpg --combine-strands\nbgzip out.bed && tabix -p bed out.bed.gz\n\n# 4. (optional) DIFFERENTIAL methylation, long-read native\nmodkit dmr pair -a A.bed.gz -b B.bed.gz --ref ref.fa --regions cpgislands.bed -o dmr.tsv\n```\n\n## MM \u002F ML Tag Spec (what the numbers mean)\n\n- `MM:Z` encodes modification positions: `\u003Ccanonical base>\u003Cstrand>\u003Cmod code>\u003C. or ?>,\u003Cskip counts>;`. Mod codes: `m`=5mC, `h`=5hmC, `a`=6mA, `c`=4mC. The `.`\u002F`?` modifier is load-bearing: `.` = skipped bases are implicitly canonical (count toward the unmodified denominator); `?` = skipped bases are no-call\u002Funknown (land in Nnocall, outside the denominator). Misreading `?` as `.` inflates the canonical denominator and deflates methylation.\n- `ML:B:C` is a uint8 per call: value N means probability in `[N\u002F256, (N+1)\u002F256)`, so 255 is ~0.998, never exactly 1.0. Do not threshold `== 1.0`.\n\n## bedMethyl Columns (modkit, 18 columns)\n\nCols 1-9 are tab-delimited BED9; cols 10-18 are space-delimited (a parsing gotcha). The ones that matter:\n\n| Col | Name | Meaning |\n|-----|------|---------|\n| 10 | Nvalid_cov | Nmod + Ncanonical + Nother_mod (the denominator; this is \"coverage\" for QC) |\n| 11 | percent_modified | (Nmod \u002F Nvalid_cov) * 100 (a percent, 0-100) |\n| 12 | Nmod | passing calls of this modification |\n| 13 | Ncanonical | passing calls of the canonical base |\n| 14 | Nother_mod | passing calls of a different mod on the same base (5hmC in a 5mC row) |\n| 16 | Nfail | calls below the pass threshold (excluded from Nvalid_cov) |\n| 18 | Nnocall | aligned canonical base with no mod call (e.g. `?`-skipped) |\n\nFor count-based DMR (DSS\u002FmethylKit) hand over Nmod and Nvalid_cov, never percent_modified.\n\n## Decision Tree by Scenario\n\n| Scenario | Recommended | Why |\n|----------|-------------|-----|\n| ONT 5mC for mammals | `dorado ...sup,5mCG_5hmCG` -> `modkit pileup --cpg --combine-strands` | mammalian 5mC is overwhelmingly CpG |\n| Compare ONT to WGBS\u002Farray | `modkit pileup --combine-mods` (or `--preset traditional`) | WGBS conflates 5mC+5hmC; combine to match |\n| Study 5hmC biology | keep 5mC and 5hmC split; ideally add oxBS\u002FTAB-seq | bisulfite cannot separate them |\n| Plants (CHG\u002FCHH) or bacterial 6mA\u002F4mC | all-context model + `--motif` (not `--cpg`) | methylation is not CpG-restricted there |\n| Allele-specific methylation \u002F imprinting | phase + haplotag -> `modkit pileup --partition-tag HP` | one read carries SNV phase AND methylation |\n| PacBio HiFi 5mC | `ccs --hifi-kinetics` -> `jasmine` -> pb-CpG-tools (or modkit) | primrose is deprecated; Revio does 5mC on-instrument |\n| Differential methylation statistics | `modkit dmr` (native) or export to -> methylation-analysis | DSS\u002FmethylKit for dispersion modeling |\n| RNA modifications (m6A etc.) | -> epitranscriptomics | direct-RNA mods are out of scope here |\n\n## Phased Allele-Specific Methylation\n\n```bash\n# Order is strict: align (tags preserved) -> phase+haplotag -> pileup partitioned by HP\n# 1-2. Clair3\u002FDeepVariant -> whatshap\u002Flongphase phase + haplotag (adds HP:i:1\u002F2) -> haplotype-phasing\nmodkit pileup aligned.haplotagged.bam asm_out\u002F --ref ref.fa --cpg --combine-strands --partition-tag HP\n# --partition-tag writes one UNCOMPRESSED bedMethyl per HP value into asm_out\u002F, named by the tag\n# value (e.g. 1.bed, 2.bed). bgzip + tabix each before dmr, which requires indexed inputs:\nbgzip asm_out\u002F1.bed && tabix -p bed asm_out\u002F1.bed.gz\nbgzip asm_out\u002F2.bed && tabix -p bed asm_out\u002F2.bed.gz\nmodkit dmr pair -a asm_out\u002F1.bed.gz -b asm_out\u002F2.bed.gz --ref ref.fa -o asm.tsv\n```\n\nEach haplotype gets ~half the coverage, so the per-site 10x floor effectively wants ~20x total. Imprinted loci (one haplotype ~fully methylated) are the canonical positive control.\n\n## Per-Method Failure Modes\n\n### No methylation in a plain BAM\n**Trigger:** BAM basecalled without a mods model. **Mechanism:** mods are a basecall-time decision. **Symptom:** no MM:Z tags; modkit returns nothing. **Fix:** re-basecall from POD5 with a mods model; there is no post-hoc tool.\n\n### Tags died in alignment (the #1 silent killer)\n**Trigger:** `samtools fastq | minimap2` without `-T MM,ML`\u002F`-y`. **Mechanism:** fastq export and minimap2 drop the tags. **Symptom:** valid aligned BAM, empty bedMethyl, no error. **Fix:** `dorado aligner`, or `samtools fastq -T MM,ML | minimap2 -y -Y`; verify MM:Z after alignment.\n\n### Methylation fraction looks too low\n**Trigger:** misreading `?` (no-call) as `.` (canonical). **Mechanism:** unscored bases counted as unmethylated. **Symptom:** deflated percent_modified; large Nnocall. **Fix:** check the MM modifier and Nnocall; `modkit update-tags` to convert styles if needed.\n\n### 5mC understated vs WGBS\n**Trigger:** comparing ONT-5mC-only to bisulfite. **Mechanism:** WGBS reads 5mC+5hmC together. **Symptom:** ONT looks lower by the 5hmC fraction. **Fix:** `--combine-mods`\u002F`--preset traditional` to combine before comparing.\n\n### Cross-sample thresholds not comparable\n**Trigger:** relying on modkit's auto-threshold per sample. **Mechanism:** the 10th-percentile cut is data-dependent. **Symptom:** sample-specific thresholds confound a DMR. **Fix:** fix a common `--filter-threshold`\u002F`--mod-thresholds` across samples.\n\n## Quantitative Thresholds\n\n| Threshold | Source | Rationale |\n|-----------|--------|-----------|\n| Nvalid_cov >= 10 per CpG | field standard | below it, single-site fractions are noisy (~20x total for phased) |\n| modkit pass = 10th percentile of ML | modkit docs | discards the lowest-confidence ~10%; improves WGBS concordance |\n| R10 ONT vs WGBS r ~ 0.84-0.95 | benchmarks | adequate-depth site-level concordance (R10 > R9) |\n| ML 255 ~ 0.998 (not 1.0) | SAM spec | uint8 bin [255\u002F256, 1.0); never test == 1.0 |\n| no `--min-coverage` flag on pileup | modkit API | filter bedMethyl on Nvalid_cov post-hoc instead |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| Empty bedMethyl \u002F Nvalid_cov 0 | tags dropped or never present | grep MM:Z; re-basecall or re-align preserving tags |\n| `modkit pileup --min-coverage` unknown flag | no such flag | filter on Nvalid_cov (col 10) after pileup |\n| `modkit extract in.bam out.tsv` errors | needs a subcommand | `modkit extract full` \u002F `modkit extract calls` |\n| `modkit dmr` fails on raw .bed | inputs must be indexed | `bgzip` + `tabix -p bed` first |\n| Sparse bedMethyl with `--combine-strands` | records lack MN tags (old basecaller or hard-clipped) | basecall with current Dorado and align with `-Y` (no hard-clip) |\n| Methylation lower than expected | `?` read as `.`; or 5hmC excluded vs WGBS | check Nnocall; `--combine-mods` to match WGBS |\n| primrose not found (PacBio) | deprecated\u002Farchived | use `jasmine` (or Revio on-instrument 5mC) |\n\n## References\n\n- Simpson JT, Workman RE, Zuzarte PC, et al. 2017. Detecting DNA cytosine methylation using nanopore sequencing. *Nat Methods* 14:407-410.\n- Yuen ZW-S, Srivastava A, Daniel R, et al. 2021. Systematic benchmarking of tools for CpG methylation detection from nanopore sequencing (METEORE). *Nat Commun* 12:3438.\n- Tse OYO, Jiang P, Cheng SH, et al. 2021. Genome-wide detection of cytosine methylation by single molecule real-time sequencing. *PNAS* 118(5):e2019768118.\n- Cheetham SW, Kindlova M, Ewing AD. 2022. Methylartist: tools for visualizing modified bases from nanopore sequence data. *Bioinformatics* 38(11):3109-3112.\n- SAM Optional Fields Specification (SAMtags): MM\u002FML base-modification tags. samtools\u002Fhts-specs.\n\n## Related Skills\n\n- basecalling - The upstream gate: methylation must be requested at basecall time\n- long-read-alignment - Carry MM\u002FML through with `-y -Y` (or use dorado aligner)\n- haplotype-phasing - Phase + haplotag the BAM for allele-specific methylation\n- clair3-variants - SNVs to phase before allele-specific methylation\n- methylation-analysis\u002Fdmr-detection - DMR statistics downstream of bedMethyl\n- methylation-analysis\u002Fmethylkit-analysis - methylKit differential methylation\n- epitranscriptomics\u002Fm6anet-analysis - Direct-RNA m6A (out of scope here)\n- workflows\u002Fmethylation-pipeline - End-to-end methylation pipeline\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","cli","2026-09-20","long-read-sequencing\u002Fnanopore-methylation\u002FSKILL.md","modkit","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-long-read-sequencing-nanopore-methylation","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-long-read-sequencing-nanopore-methylation",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-long-read-sequencing-nanopore-methylation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-long-read-sequencing-nanopore-methylation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-long-read-sequencing-nanopore-methylation\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fmodkit_methylation.sh","SCRIPT","脚本",2077,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-long-read-sequencing-nanopore-methylation\u002Fexamples\u002Fmodkit_methylation.sh",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",4366,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-long-read-sequencing-nanopore-methylation\u002Fusage-guide.md",[63,71,78,85,92,99],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":70},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":70},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":70},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":70},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":70},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":70},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]