MODKIT_BEDGRAPH produces empty output when pileup run with --combine-mods
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- awk
- Domain
- bioinformatics
Research direction
Start with modules/local/bed2bedgraphs/modkit_bedgraphs/main.nf and inspect the awk filter against pileup output produced with --combine-mods. Reproduce the command from the issue, verify the column format and strand/mod conditions, and confirm that the resulting bedgraph files contain methylation data rather than zero lines.
Written by the indexing model from the issue text.
Description
Description of the bug
I ran the ONT workflow (pipeline version 2.0.0) with --combine-mods in the pileup step. The bedgraph output files came out empty for all 4 of my samples. There was no error or warning, they just have 0 lines.
Command I used for pileup (matches what the pipeline ran internally):
modkit pileup --motif CG 0 --combine-mods --ref <reference.fa> <input.bam>
What I think might be happening is that with --combine-mods, modkit writes just a bare base letter (e.g. C) into column 4 of the pileup output, instead of a base,context,offset triplet like C,CG,0.
The bedgraph conversion script (modules/local/bed2bedgraphs/modkit_bedgraphs/main.nf) filters on column 4 expecting that triplet format:
awk -v strand=$strand -v mod=$mod 'BEGIN{OFS="\t"} (($4==mod) && ($6==strand)) && ($5 >= 5) {print $1,$2,$3,$11,$12,$13}' ${in_bed}
where mod is one of "C,CHH,0", "C,CHG,0", "C,CG,0", "A,A,0".
Since column 4 in my pileup output is just "C", it never matches any of those triplets, so the filter drops every row. This happens consistently across all 4 of my samples and all 8 output files (positive/negative strand × 4 mod/context combos).
To reproduce:
- Run the ONT workflow with --combine-mods set in the pileup step.
- Check the resulting *.bedgraph.gz files, they'll have 0 lines.
Expected: bedgraph files should contain the methylation data from the pileup step.
Actual: bedgraph files are empty, with no error reported anywhere in the log.
Workaround: I pulled methylation data directly from the pileup .bed.gz output instead, which seems unaffected by this issue.
Command used and terminal output
Relevant files
No response
System information
No response
- Dominant language
- Nextflow
- Stars
- 25
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nf-core/methylong
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Things to improve Openenhancement
-
Error in DMR step Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
To-do list Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in nf-core/methylong
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
EBI-Metagenomics/mgnifams#62 ·
-
Difficulty 2/5 Half a day Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100