Module for running Red repeat detector - #41
Conversation
JAlvarezJarreta
left a comment
There was a problem hiding this comment.
Looks great, just a few comments.
|
|
||
| output: | ||
| tuple val(meta), path("rpt/*.bed"), emit: bed | ||
| tuple val("${task.process}"), val('red'), eval("conda list red --json | python -c 'import sys,json; print(json.load(sys.stdin)[0][\"version\"])' || echo 2.0"), emit: versions_red, topic: versions |
There was a problem hiding this comment.
| tuple val("${task.process}"), val('red'), eval("conda list red --json | python -c 'import sys,json; print(json.load(sys.stdin)[0][\"version\"])' || echo 2.0"), emit: versions_red, topic: versions | |
| tuple val("${task.process}"), val('red'), eval("conda list red --json | jq -r '.version' || echo 2.0"), emit: versions_red, topic: versions |
Not sure if this will work, but sounds less overkilling than loading Python to just extract the version.
There was a problem hiding this comment.
Having looked into this, we could maybe use jq -r '.[0].version' but I think I'm inclined to stick with Python unless you strongly feel otherwise. From what I can gather, many nf-core modules use small Python one-liners to parse JSON since it is considered part of the expected runtime environment, whereas jq is not. Therefore, this seems like the more portable option.
| mkdir -p genome rpt | ||
|
|
||
| # Red only scans .fa files in the genome directory | ||
| cp ${fasta} genome/${meta.id}.fa |
There was a problem hiding this comment.
| cp ${fasta} genome/${meta.id}.fa | |
| ln -snf ${fasta} genome/${meta.id}.fa |
If its only scanning, and given these can be large files, should we create a symlink instead?
There was a problem hiding this comment.
Good idea, although needed to use ln -snf \$(realpath "${fasta}") genome/${meta.id}.fa
| - red: | ||
| type: string | ||
| description: The tool name | ||
| - conda list red --json | python -c 'import sys,json; print(json.load(sys.stdin)[0]["version"])' || echo 2.0: |
There was a problem hiding this comment.
Same as above if it works.
| - red: | ||
| type: string | ||
| description: The tool name | ||
| - conda list red --json | python -c 'import sys,json; print(json.load(sys.stdin)[0]["version"])' || echo 2.0: |
There was a problem hiding this comment.
Same as above if it works.
No description provided.