add methurator gtestimator and plot modules#11110
add methurator gtestimator and plot modules#11110edogiuili wants to merge 19 commits intonf-core:masterfrom
Conversation
famosab
left a comment
There was a problem hiding this comment.
Thank you for your contribution to nf-core! We really appreciate it. I added a few comments to your PR.
|
|
||
| output: | ||
| tuple val(meta), path("methurator_*.yml") , emit: summary_report | ||
| path "versions.yml" , emit: versions |
There was a problem hiding this comment.
Can you update the versions output to utilize topics? More information about that can be found in the docs.
| input: | ||
| tuple val(meta), path(bam) | ||
| tuple val(meta2), path(bai) | ||
| tuple val(meta3), path(fasta) |
There was a problem hiding this comment.
Can we put all these inputs into one tuple? That will make sure you're sure that EVERY time everything comes together in the right combination.
There was a problem hiding this comment.
Since methurator uses MethylDackel inside, I sticked to the inputs that are present in MethylDackel nf-core module. Do you think it's still better to put them all into one tuple?
There was a problem hiding this comment.
Its not something I will force you to do :D but its something we try to move towards to because it has some advantages (but it will be obsolete in the future with how nextflow will change its input syntax) so I would say this is up to you and keeping it consistent to methyldackel is a good argument to keep it like this
There was a problem hiding this comment.
You can run
nextflow lint -format -sort-declarations -spaces 4 -harshil-alignmenton this file to clean this up nicely.
| """ | ||
|
|
||
| stub: | ||
| def prefix = task.ext.prefix ?: "methurator_summary_${meta.id}" |
There was a problem hiding this comment.
Why is it called _summary here and in th output just merthurator?
There was a problem hiding this comment.
See comments on above nf.test file
There was a problem hiding this comment.
You can run
nextflow lint -format -sort-declarations -spaces 4 -harshil-alignmenton this file to clean this up nicely.
|
|
||
| output: | ||
| tuple val(meta), path("plots/*.html") , emit: plots | ||
| path "versions.yml" , emit: versions |
There was a problem hiding this comment.
Can you update the versions output to utilize topics? More information about that can be found in the docs.
| def prefix = task.ext.prefix ?: "plots/${meta.id}.html" | ||
| """ | ||
| mkdir plots/ | ||
| touch ${prefix} |
There was a problem hiding this comment.
Lets not create a dir if it only contains one output
There was a problem hiding this comment.
This is necessary cause the process outputs the file into the plots/ folder, so I needed to create a file in that folder to avoid getting the following error in the stub:
Missing output file(s) `plots/*.html` expected by process `METHURATOR_PLOT (test_bam)
But maybe there is a more elegant way of doing this :D
… report with methurator_summary
|
Thanks for your suggestions Famke! I've addressed them all, apart from:
For the additional snapshots, instead of capturing the full files—which are unstable—I extracted a snapshot of the content from lines 3 to 9 for the methurator/gtestimator summary reports, and a snapshot of the HTML filename for the methurator plots. What do you think? |
|
A small fix in the eval() expression to extract the software version. I changed the expression from |
|
Hey Famke, I fixed the last suggestion you made, however, the nf-test seem to have run on files that are not related to this module, but rather to other modules. I do not know why this would happen 😕 |
Happens because github -> you just need to merge the master branch then it only runs yours |
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com>
famosab
left a comment
There was a problem hiding this comment.
I added a few more comments :)
| tuple val(meta), path(bam) | ||
| tuple val(meta2), path(bai) | ||
| tuple val(meta3), path(fasta) |
There was a problem hiding this comment.
Can we put all these inputs into one tuple? That will make sure you're sure that EVERY time everything comes together in the right combination. At least bam and bai i would put in the same tuple. If the fasta does not change per input sample we can have it extra.
| tuple val(meta3), path(fasta) | ||
|
|
||
| output: | ||
| tuple val(meta), path("methurator_summary.yml"), emit: summary_report |
There was a problem hiding this comment.
Can we somehow control the output name?
| tuple val(meta), path("methurator_summary.yml"), emit: summary_report | |
| tuple val(meta), path("${prefix}.yml"), emit: summary_report |
| def args = task.ext.args ?: '' | ||
| if (params.rrbs) { | ||
| args += '--rrbs' | ||
| } |
There was a problem hiding this comment.
| } | |
| } | |
| prefix = task.ext.prefix?: "${meta.id}" |
| --outdir . \\ | ||
| --compute_ci \\ | ||
| ${args} | ||
|
|
There was a problem hiding this comment.
| mv methurator_summary.yml ${prefix}.yml |
| stub: | ||
| """ | ||
| touch methurator_summary.yml |
There was a problem hiding this comment.
And adjust it in the stub as well
| e.g. [ id:'test', single_end:false ] | ||
| - bam: | ||
| type: file | ||
| description: BAM/CRAM file |
There was a problem hiding this comment.
can you be more specific, is only one bam allowed or can it be multiple?
There was a problem hiding this comment.
The tool supports one or multiple BAM files, but within a Nextflow workflow I would only use 1 file at the time to enable parallel execution.
There was a problem hiding this comment.
ok that would mean that via nextflow only one plot would be created downstream right? then we can maybe handle it differently in the plot module aswell?
There was a problem hiding this comment.
It depends. If the --minimum-coverage parameter specified in the gtestimator module contains only 1 character (e.g. "3"), then yes. However, the users can specify more than 1 minimum coverage value (e.g. "1,3,5"), in which case one plot per minimum coverage value specified will be dumped in the plots/ folder.
There was a problem hiding this comment.
ok maybe we can add this info to the meta map then but then its ok we leave it as is
There was a problem hiding this comment.
Can you please add ontologies to the meta map?
| description: | | ||
| HTML plots generated from the saturation analysis. | ||
| pattern: "plots/*.html" | ||
| ontologies: [] |
There was a problem hiding this comment.
Can you please add ontologies to the meta map?
In this PR, I add methurator gtestimator and plot modules.
PR checklist
topic: versions- See version_topicslabelnf-core modules test <MODULE> --profile dockernf-core modules test <MODULE> --profile singularitynf-core modules test <MODULE> --profile condanf-core subworkflows test <SUBWORKFLOW> --profile dockernf-core subworkflows test <SUBWORKFLOW> --profile singularitynf-core subworkflows test <SUBWORKFLOW> --profile conda